kernel-ark/drivers
David Brownell e385ea63f4 mmc: at91_mci: don't use coherent dma buffers
At91_mci is abusing dma_free_coherent(), which may not be called with IRQs
disabled.  I saw "mkfs.ext3" on an MMC card objecting voluminously as each
write completed:

 WARNING: at arch/arm/mm/consistent.c:368 dma_free_coherent+0x2c/0x224()
 [<c002726c>] (dump_stack+0x0/0x14) from [<c00387d4>] (warn_on_slowpath+0x4c/0x68)
 [<c0038788>] (warn_on_slowpath+0x0/0x68) from [<c0028768>] (dma_free_coherent+0x2c/0x224)
  r6:00008008 r5:ffc06000 r4:00000000
 [<c002873c>] (dma_free_coherent+0x0/0x224) from [<c01918ac>] (at91_mci_irq+0x374/0x420)
 [<c0191538>] (at91_mci_irq+0x0/0x420) from [<c0065d9c>] (handle_IRQ_event+0x2c/0x6c)
 ...

This bug has been around for a LONG time.  The MM warning is from late
2005, but the driver merged a year later ...  so I'm puzzled why nobody
noticed this before now.

The fix involves noting that this buffer shouldn't be DMA-coherent; it's
just used for normal DMA writes.  So replace it with standard kmalloc()
buffering and DMA mapping calls.

This is the quickie fix.  A better one would not rely on allocating large
bounce buffers.  (Note that dma_alloc_coherent could have failed too, but
that case was ignored...  kmalloc is a bit more likely to fail though.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Pierre Ossman <drzeus-mmc@drzeus.cx>
Cc: Andrew Victor <linux@maxim.org.za>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-09-02 19:21:38 -07:00
..
accessibility
acpi ACPI: Fix typo in "Disable MWAIT via DMI on broken Compal board" 2008-09-02 11:00:23 -07:00
amba
ata [libata] pata_it821x: fix warning 2008-08-22 02:33:23 -04:00
atm removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
auxdisplay
base PM: Remove WARN_ON from device_pm_add 2008-08-21 10:15:37 -07:00
block Revert "pktcdvd: push BKL down into driver" 2008-08-27 13:42:00 -07:00
bluetooth [Bluetooth] Consolidate maintainers information 2008-08-18 13:23:53 +02:00
cdrom cdrom: handle TOC 2008-08-18 21:40:04 +02:00
char tty: Fix termios tty window resize race with pty/tty pair 2008-08-27 14:37:09 -07:00
clocksource
connector
cpufreq
cpuidle cpuidle: Make ladder governor honor latency requirements fully 2008-08-15 21:25:35 +02:00
crypto crypto: padlock - fix VIA PadLock instruction usage with irq_ts_save/restore() 2008-08-13 22:02:26 +10:00
dca
dio
dma
edac removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
eisa
firewire firewire: Kconfig help update 2008-08-19 18:47:56 +02:00
firmware firmware/memmap: cleanup 2008-08-12 16:07:31 -07:00
gpio
gpu drm/radeon: downgrade debug message from info to debug. 2008-09-01 08:51:52 +10:00
hid
hwmon hwmon-vid: Fix AMD K8 VID decoding 2008-08-15 11:50:15 -07:00
i2c i2c: Prevent log spam on some DVB adapters 2008-08-28 08:33:23 +02:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2008-09-02 11:44:11 -07:00
ieee1394 ieee1394: sbp2: let nodemgr retry node updates during bus reset series 2008-08-19 18:47:56 +02:00
infiniband IB/mlx4: Actually return L_Key and R_Key for fast register MRs 2008-08-27 14:40:38 -07:00
input Blackfin arch: move include/asm-blackfin header files to arch/blackfin 2008-08-27 10:51:02 +08:00
isdn
leds
lguest lguest: update commentry 2008-08-26 00:19:28 +10:00
macintosh
mca
md Fix problem with waiting while holding rcu read lock in md/bitmap.c 2008-09-01 12:48:13 +10:00
media dabusb_fpga_download(): fix a memory leak 2008-09-02 09:29:03 +01:00
memstick
message
mfd removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
misc acer-wmi: remove debugfs entries upon unloading 2008-09-02 19:21:37 -07:00
mmc mmc: at91_mci: don't use coherent dma buffers 2008-09-02 19:21:38 -07:00
mtd [MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl() 2008-09-02 09:29:05 +01:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-08-27 17:38:07 -07:00
nubus
of powerpc/ibmebus: Restore "name" sysfs attribute on ibmebus devices 2008-08-20 09:50:21 +10:00
oprofile powerpc/cell/oprofile: Avoid double vfree of profile buffer 2008-08-26 10:24:46 +10:00
parisc
parport
pci PCI: fix reference leak in pci_get_dev_by_id() 2008-08-21 15:22:46 -07:00
pcmcia [ARM] 5198/1: PalmTX: PCMCIA fixes 2008-08-16 16:35:33 +01:00
pnp
power
ps3
rapidio
regulator
rtc removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-08-27 17:38:07 -07:00
sbus sparc/drivers: use linux/of_device.h instead of asm/of_device.h 2008-08-11 14:30:53 -07:00
scsi remove blk_register_filter and blk_unregister_filter in gendisk 2008-08-29 11:47:07 +02:00
serial 8250: improve workaround for UARTs that don't re-assert THRE correctly 2008-09-02 19:21:38 -07:00
sh
sn
spi spi: bugfix spi_add_device() with duplicate chipselects 2008-08-15 08:35:44 -07:00
ssb ssb: allow compilation on systems without PCI 2008-08-18 11:05:13 -04:00
tc
telephony
thermal
uio UIO: generic irq handling for some uio platform devices 2008-08-21 10:15:39 -07:00
usb removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
video Blackfin arch: move include/asm-blackfin header files to arch/blackfin 2008-08-27 10:51:02 +08:00
virtio virtio_balloon: fix towards_target when deflating balloon 2008-08-26 00:19:25 +10:00
w1
watchdog [WATCHDOG] removed unused #include <version.h> 2008-08-26 20:32:02 +00:00
xen stop_machine: wean Xen off stop_machine_run 2008-08-26 00:19:27 +10:00
zorro
Kconfig
Makefile USB: Add MUSB and TUSB support 2008-08-13 17:33:00 -07:00