]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: omap: fix broken PIO mode
authorPaul Walmsley <paul@pwsan.com>
Fri, 24 Aug 2012 06:00:18 +0000 (06:00 +0000)
committerChris Ball <cjb@laptop.org>
Tue, 4 Sep 2012 17:58:11 +0000 (13:58 -0400)
commit84d04e33be62e6a02aa5ac14db6e79b767f53db2
treed4048b6d8a0afdabe80444a06cb2a57b607e3ee0
parent72099e5d3c17b052e51b044657c22c5a0c64eb76
mmc: omap: fix broken PIO mode

After commit 96555ec480ea434e649cdb1ea0c40348c1ddd6b6 ("mmc:
omap_hsmmc: remove private DMA API implementation"), the Nokia N800
here stopped booting:

[    2.086181] Waiting for root device /dev/mmcblk0p1...
[    2.324066] Unhandled fault: imprecise external abort (0x406) at 0x00000000
[    2.331451] Internal error: : 406 [#1] ARM
[    2.335784] Modules linked in:
[    2.339050] CPU: 0    Not tainted  (3.6.0-rc3 #60)
[    2.344146] PC is at default_idle+0x28/0x30
[    2.348602] LR is at trace_hardirqs_on_caller+0x15c/0x1b0

...

This turned out to be due to memory corruption caused by long-broken
PIO code in drivers/mmc/host/omap.c.  (Previously, this driver had
been using DMA; but the above commit caused the MMC driver to fall
back to PIO mode with an unmodified Kconfig.)

The PIO code, added with the rest of the driver in commit
6392031df836f96dda03ac22881a229c0e7a0834 ("[MMC] Add OMAP MMC host
driver"), confused bytes with 16-bit words.  This bug caused memory
located after the PIO transfer buffer to be corrupted with transfers
larger than 32 bytes.  The driver also did not increment the buffer
pointer after the transfer occurred.  This bug resulted in data
corruption during any transfer larger than 64 bytes.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/omap.c