1. 18 4月, 2008 16 次提交
  2. 28 3月, 2008 1 次提交
    • J
      firewire: fw-ohci: plug dma memory leak in AR handler · 6b84236d
      Jarod Wilson 提交于
      There's an ugly little memory leak in firewire-ohci's
      ar_context_tasklet(), where we're not freeing up some of the memory we
      use for each ar_buffer, due to a moving pointer. The problem has been
      there for a while, but didn't get noticed until after converting the AR
      routines over to use coherent DMA and I started running into I/O stall-
      outs with the following message output repeatedly to the console:
      
      PCI-DMA: Out of IOMMU space for 53248 bytes at device 0000:04:09.0
      
      Plugging this leak is definitely necessary, but unfortunately, isn't the
      entire answer to my problem, it only increases the amount of I/O that I
      can do before hitting the problem. Still working on tracking down the
      root cause..
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6b84236d
  3. 14 3月, 2008 6 次提交
  4. 31 1月, 2008 4 次提交
    • D
      firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors · fe5ca634
      David Moore 提交于
      Previously, the fw-ohci driver used fixed-length buffers for storing
      descriptors for isochronous receive DMA programs.  If an application
      (such as libdc1394) generated a DMA program that was too large, fw-ohci
      would reach the limit of its fixed-sized buffer and return an error to
      userspace.
      
      This patch replaces the fixed-length ring-buffer with a linked-list of
      page-sized buffers.  Additional buffers can be dynamically allocated and
      appended to the list when necessary.  For a particular context, buffers
      are kept around after use and reused as necessary, so there is no
      allocation taking place after the DMA program is generated for the first
      time.
      
      In addition, the buffers it uses are coherent for DMA so there is no
      syncing required before and after writes.  This syncing wasn't properly
      done in the previous version of the code.
      
      -
      
      This is the fourth version of my patch that replaces a fixed-length
      buffer for DMA descriptors with a dynamically allocated linked-list of
      buffers.
      
      As we discovered with the last attempt, new context programs are
      sometimes queued from interrupt context, making it unacceptable to call
      tasklet_disable() from context_get_descriptors().
      
      This version of the patch uses ohci->lock for all locking needs instead
      of tasklet_disable/enable.  There is a new requirement that
      context_get_descriptors() be called while holding ohci->lock.  It was
      already held for the AT context, so adding the requirement for the iso
      context did not seem particularly onerous.  In addition, this has the
      side benefit of allowing iso queue to be safely called from concurrent
      user-space threads, which previously was not safe.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NKristian Høgsberg <krh@redhat.com>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      
      -
      
      Fixes the following issues:
        - Isochronous reception stopped prematurely if an application used a
          larger buffer.  (Reproduced with coriander.)
        - Isochronous reception stopped after one or a few frames on VT630x
          in OHCI 1.0 mode.  (Fixes reception in coriander, but dvgrab still
          doesn't work with these chips.)
      
      Patch update: struct member alignment, whitespace nits
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fe5ca634
    • S
      firewire: fw-ohci: CycleTooLong interrupt management · bb9f2206
      Stefan Richter 提交于
      The firewire-ohci driver so far lacked the ability to resume cycle
      master duty after that condition happened, as added to ohci1394 in Linux
      2.6.18 by commit 57fdb58f.  This ports
      this patch to fw-ohci.
      
      The "cycle too long" condition has been seen in practice
        - with IIDC cameras if a mode with packets too large for a speed is
          chosen,
        - sporadically when capturing DV on a VIA VT6306 card with ohci1394/
          ieee1394/ raw1394/ dvgrab 2.
          https://bugzilla.redhat.com/show_bug.cgi?id=415841#c7
      (This does not fix Fedora bug 415841.)
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bb9f2206
    • D
      firewire: fw-ohci: Bug fixes for packet-per-buffer support · bcee893c
      David Moore 提交于
      This patch corrects a number of bugs in the current OHCI 1.0
      packet-per-buffer support:
      
      1. Correctly deal with payloads that cross a page boundary.  The
      previous version would not split the descriptor at such a boundary,
      potentially corrupting unrelated memory.
      
      2. Allow user-space to specify multiple packets per struct
      fw_cdev_iso_packet in the same way that dual-buffer allows.  This is
      signaled by header_length being a multiple of header_size.  This
      multiple determines the number of packets.  The payload size allocated
      per packet is determined by dividing the total payload size by the
      number of packets.
      
      3. Make sync support work properly for packet-per-buffer.
      
      I have tested this patch with libdc1394 by forcing my OHCI 1.1
      controller to use the packet-per-buffer support instead of dual-buffer.
      
      I would greatly appreciate testing by those who have a DV devices and
      other types of iso streamers to make sure I didn't cause any
      regressions.
      
      Stefan, with this patch, I'm hoping that libdc1394 will work with all
      your OHCI 1.0 controllers now.
      
      The one bit of future work that remains for packet-per-buffer support is
      the automatic compaction of short payloads that I discussed with
      Kristian.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bcee893c
    • D
      firewire: fw-ohci: Fix for dualbuffer three-or-more buffers · 0642b657
      David Moore 提交于
      This patch fixes the problem where different OHCI 1.1 controllers behave
      differently when a received iso packet straddles three or more buffers
      when using the dual-buffer receive mode.  Two changes are made in order
      to handle this situation:
      
      1. The packet sync DMA descriptor is given a non-zero header length and
      non-zero payload length.  This is because zero-payload descriptors are
      not discussed in the OHCI 1.1 specs and their behavior is thus
      undefined.  Instead we use a header size just large enough for a single
      header and a payload length of 4 bytes for this first descriptor.
      
      2. As we process received packets in the context's tasklet, read the
      packet length out of the headers.  Keep track of the running total of
      the packet length as "excess_bytes", so we can ignore any descriptors
      where no packet starts or ends.  These descriptors may not have had
      their first_res_count or second_res_count fields updated by the
      controller so we cannot rely on those values.
      
      The main drawback of this patch is that the excess_bytes value might get
      "out of sync" with the packet descriptors if something strange happens
      to the DMA program.  I'm not if such a thing could ever happen, but I
      appreciate any suggestions in making it more robust.
      
      Also, the packet-per-buffer support may need a similar fix to deal with
      issue 1, but I haven't done any work on that yet.
      
      Stefan, I'm hoping that with this patch, all your OHCI 1.1 controllers
      will work properly with an unmodified version of libdc1394.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      0642b657
  5. 11 12月, 2007 1 次提交
    • J
      firewire: OHCI 1.0 Isochronous Receive support · a186b4a6
      Jarod Wilson 提交于
      Third rendition of FireWire OHCI 1.0 Isochronous Receive support, using a
      zer-copy method similar to OHCI 1.1 which puts the IR data payload directly
      into the userspace buffer. The zero-copy implementation eliminates the
      video artifacts, audio popping, and buffer underrun problems seen with
      version 1 of this patch, as well as fixing a regression in OHCI 1.1 support
      introduced by version 2 of this patch.
      
      Successfully tested in OHCI 1.1 mode on the following chipsets:
      
      - NEC uPD72847 (rev 01), OHCI 1.1 (PCI)
      - Ti XIO2200(A) (rev 01), OHCI 1.1 (PCIe)
      - Ti TSB41AB2 (rev 01), OHCI 1.1 (PCI on SB Audigy)
      - Apple UniNorth 2 (rev 81), OHCI 1.1 (PowerBook G4 onboard)
      
      Successfully tested in OHCI 1.0 mode on the following chipsets:
      
      - Agere FW323 (rev 06), OHCI 1.0 (Mac Mini onboard)
      - Agere FW323 (rev 06), OHCI 1.0 (PCI)
      - Via VT6306 (rev 46), OHCI 1.0 (PCI)
      - NEC OrangeLink (rev 01), OHCI 1.0 (PCI)
      - NEC uPD72847 (rev 01), OHCI 1.1 (PCI)
      - Ti XIO2200(A) (rev 01), OHCI 1.1 (PCIe)
      
      The bulk of testing was done in an x86_64 system, but was also successfully
      sanity-tested on other systems, including a PPC(32) PowerBook G4 and an i686
      EPIA M10k. Crude benchmarking (watching top during capture) puts the cpu
      utilization during capture on the EPIA's 1GHz Via C3 processor around 13%,
      which is down from 30% with the v1 code.
      
      Some implementation details:
      
      To maintain the same userspace API as dual-buffer mode, we set up two
      descriptors for every incoming packet. The first is an INPUT_MORE descriptor,
      pointing to a buffer large enough to hold just the packet's iso headers,
      immediately followed by an INPUT_LAST descriptor, pointing to a chunk of the
      userspace buffer big enough for the packet's data payload. With this setup,
      each incoming packet fills in these two descriptors in a manner that very
      closely emulates dual-buffer receive, to the point where the bulk of the
      handle_ir_* code is now identical between the two (and probably primed for
      some restructuring to share code between them).
      
      The only caveat I have at the moment is that neither of my OHCI 1.0 Via
      VT6307-based FireWire controllers work particularly well with this code
      for reasons I have yet to figure out.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a186b4a6
  6. 01 11月, 2007 1 次提交
  7. 23 10月, 2007 2 次提交
  8. 17 10月, 2007 6 次提交
  9. 08 9月, 2007 1 次提交
  10. 03 8月, 2007 1 次提交
  11. 19 7月, 2007 1 次提交