linux/drivers/firewire
David Moore fe5ca63430 firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors
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: David Moore <dcm@acm.org>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Jarod 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: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-01-30 22:22:24 +01:00
..
fw-card.c firewire: fix unloading of fw-ohci while devices are attached 2007-08-25 18:00:27 +02:00
fw-cdev.c firewire: fw-cdev: reorder wakeup vs. spinlock 2007-10-17 00:00:10 +02:00
fw-device.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
fw-device.h firewire: fw-sbp2: add support for multiple logical units per target 2007-10-17 00:00:03 +02:00
fw-iso.c firewire: Clean up comment style. 2007-05-10 18:24:13 +02:00
fw-ohci.c firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors 2008-01-30 22:22:24 +01:00
fw-ohci.h firewire: fw-ohci: check for misconfigured bus (phyID == 63) 2007-10-17 00:00:08 +02:00
fw-sbp2.c firewire: fw-sbp2: remove unused misleading macro 2008-01-30 22:22:22 +01:00
fw-topology.c firewire: in-code doc updates. 2007-10-17 00:00:09 +02:00
fw-topology.h firewire: a header cleanup 2007-10-17 00:00:09 +02:00
fw-transaction.c firewire: Fix extraction of source node id 2008-01-30 22:22:24 +01:00
fw-transaction.h firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters) 2007-08-02 20:34:16 +02:00
Kconfig firewire: point to migration document 2007-10-07 13:48:41 +02:00
Makefile firewire: prefix modules with firewire- instead of fw- 2007-05-27 23:21:01 +02:00