linux/drivers
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
..
acorn/char
acpi x86: don't disable TSC in any C states on AMD Fam10h 2008-01-30 13:32:41 +01:00
amba
ata
atm
auxdisplay
base
block cciss: fix bug in overriding ->data_len before completion 2008-01-29 21:55:18 +01:00
bluetooth
cdrom
char x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
clocksource
connector [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
cpufreq cpufreq: fix obvious condition statement error 2008-01-30 13:33:34 +01:00
cpuidle
crypto
dca
dio
dma
edac
eisa
firewire firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors 2008-01-30 22:22:24 +01:00
firmware x86: left over fix for leak of early_ioremp in dmi_scan 2008-01-30 13:33:32 +01:00
hid
hwmon
i2c
ide
ieee1394 ieee1394: ohci1394: don't schedule IT tasklets on IR events 2008-01-30 22:22:21 +01:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25 2008-01-29 22:54:01 +11:00
input x86: replace outb_p() with udelay(2) in drivers/input/mouse/pc110pad.c 2008-01-30 13:31:24 +01:00
isdn
kvm x86: get rid of _MASK flags 2008-01-30 13:31:27 +01:00
leds
lguest x86: use generic register name in the thread and tss structures 2008-01-30 13:31:02 +01:00
macintosh
mca
md
media
message
mfd
misc
mmc
mtd
net [net] Gracefully handle shared e1000/1000e driver PCI ID's 2008-01-31 00:30:15 +11:00
nubus
of
oprofile
parisc
parport
pci
pcmcia
pnp git-x86: drivers/pnp/pnpbios/bioscalls.c build fix 2008-01-30 13:32:31 +01:00
power
ps3
rapidio
rtc
s390 [VLAN]: Turn VLAN_DEV_INFO into inline function 2008-01-28 15:08:32 -08:00
sbus
scsi [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
serial
sh
sn
spi
ssb ssb: Add boardflags_hi field to the sprom data structure 2008-01-28 15:09:52 -08:00
tc
telephony
uio
usb
video x86: cpa: move flush to cpa 2008-01-30 13:34:07 +01:00
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile x86: early boot debugging via FireWire (ohci1394_dma=early) 2008-01-30 13:34:11 +01:00