linux/drivers
Sergei Shtylyov c7bbc056a9 USB: musb: bugfixes for multi-packet TXDMA support
We really want to use DMA mode 1 for all multi-packet transfers;
that's one IRQ on DMA completion, instead of one per packet.

There is an important issue with such transfers, especially on
the host side:  when such transfers end with a full-size packet,
we must defer musb_dma_completion() calls until the FIFO empties.
Else we report URB completions too soon, and may clobber data in
the FIFO fifo when writing the next packet (losing data).

The Inventra DMA support uses DMA mode 1, but it ignores that
issue.  The CPPI DMA support uses mode 0, but doesn't handle
its TXPKTRDY interrupts quite right either; it can get stale
"packet ready" interrupts, and report transfer completion too
early using slightly different code paths, also losing data.

So I'm solving it in a generic way -- by adding a sort of the
"interrupt filter" into musb_host_tx(), catching these cases
where a DMA completion IRQ doesn't suffice and removing some
needlessly controller-specific logic.  When a TXDMA interrupt
happens and DMA request mode 1 is active, that filter resets
to mode 0 and defers URB completion processing until TXPKTRDY,
unless the FIFO is already empty.  Related filtering logic in
Inventra and CPPI code gets removed.

Since it should be competely safe now to use the DMA request
mode 1 for host side transfers with the CPPI DMA controller,
set it in musb_h_tx_dma_start() ... now renamed (and shared).

[ dbrownell@users.sourceforge.net: don't introduce more
CamElCase; use more concise explanations ]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-17 10:50:25 -07:00
..
accessibility
acpi Revert "ACPI battery: fix async boot oops" 2009-04-11 12:45:20 -07:00
amba
ata ata: Report 16/32bit PIO as best we can 2009-04-16 15:28:23 -04:00
atm Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n) 2009-04-13 15:04:33 -07:00
auxdisplay
base dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
block brd: fix cacheflushing 2009-04-15 12:10:13 +02:00
bluetooth
cdrom
char intelfb: support i854 2009-04-13 15:04:32 -07:00
clocksource
connector
cpufreq
cpuidle
crypto dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
dca
dio
dma dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
edac edac: use to_delayed_work() 2009-04-13 15:04:34 -07:00
eisa
firewire
firmware dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
gpio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
gpu Merge branch 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel 2009-04-14 13:16:40 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2009-04-03 15:25:44 -07:00
hwmon hwmon: sht15 humidity sensor driver 2009-04-13 15:04:29 -07:00
i2c i2c: Let new-style drivers implement attach_adapter 2009-04-13 17:02:14 +02:00
ide at91_ide: turn on PIO 6 support 2009-04-08 14:13:04 +02:00
idle dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) 2009-04-07 08:31:10 -07:00
ieee1394 dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2009-04-09 16:42:26 -07:00
input Merge branch 'next' into for-linus 2009-04-08 00:00:33 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-04-06 18:05:43 -07:00
leds leds: just ignore invalid GPIOs in leds-gpio 2009-04-08 14:13:48 +01:00
lguest
macintosh
mca
md block: move bio list helpers into bio.h 2009-04-15 08:28:09 +02:00
media Merge git://git.infradead.org/~dwmw2/firmware-2.6 2009-04-10 12:01:22 -07:00
memstick dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
message dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
mfd mfd: fix da903x warning 2009-04-05 00:32:25 +02:00
misc sgi-xpc: clean up numerous globals 2009-04-13 15:04:33 -07:00
mmc mmc_spi: support for non-byte-aligned cards 2009-04-08 20:45:51 +02:00
mtd Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6 2009-04-06 15:00:00 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-04-16 07:41:56 -07:00
nubus
of
oprofile Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-04-05 11:04:19 -07:00
parisc parport: Fix various uses of parport_pc 2009-04-14 08:48:50 -07:00
parport parport: Use the PCI IRQ if offered 2009-04-07 08:44:06 -07:00
pci Merge git://git.infradead.org/iommu-2.6 2009-04-13 11:35:50 -07:00
pcmcia
platform Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn.notify' into release 2009-04-07 18:18:42 -04:00
pnp dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
power Merge git://git.infradead.org/battery-2.6 2009-04-08 17:45:02 -07:00
ps3
rapidio dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
regulator
rtc Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2009-04-05 11:15:54 -07:00
s390 [S390] dasd: fix idaw boundary checking for track based ccw 2009-04-14 15:37:25 +02:00
sbus sbus: changed ioctls to unlocked 2009-04-14 19:46:19 -07:00
scsi Fix lpfc_parse_bg_err()'s use of do_div() 2009-04-14 09:58:17 -07:00
serial Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze 2009-04-13 08:17:52 -07:00
sh sh: intc: Added resume from hibernation support to the intc 2009-04-06 08:55:19 -07:00
sn dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) 2009-04-07 08:31:10 -07:00
spi spi: spi_write_then_read() bugfixes 2009-04-13 15:04:30 -07:00
ssb
staging Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n) 2009-04-13 15:04:33 -07:00
tc
telephony
thermal
uio
usb USB: musb: bugfixes for multi-packet TXDMA support 2009-04-17 10:50:25 -07:00
uwb dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
video intelfb: support i854 2009-04-13 15:04:32 -07:00
virtio
w1 mfd: remove DS1WM clock handling 2009-04-05 00:32:22 +02:00
watchdog [WATCHDOG] omap_wdt.c: move probe function to .devinit.text 2009-04-08 06:21:57 +00:00
xen xen: honour VCPU availability on boot 2009-04-08 14:25:51 -07:00
zorro
Kconfig
Makefile