]> git.baikalelectronics.ru Git - kernel.git/commit
mvsdio: fix config failure with some high speed SDHC cards
authorNicolas Pitre <nico@cam.org>
Wed, 27 May 2009 02:35:34 +0000 (22:35 -0400)
committerPierre Ossman <pierre@ossman.eu>
Wed, 3 Jun 2009 19:51:00 +0000 (21:51 +0200)
commit62a4b3332d5e9df0948bc7a4b9a4d166c59b98b0
tree7be3bdf52625cf7134c27890bb313d01d9747209
parent89950f0da0c90ee5c054a0037ca85e3e7624a87f
mvsdio: fix config failure with some high speed SDHC cards

Especially with Sandisk SDHC cards, the second SWITCH command was failing
with a timeout and the card was not recognized at all.  However if the
system was busy, or debugging was enabled, or a udelay(100) was inserted
before the second SWITCH command in the core code, then the timing was
so that the card started to work.

With some unusual block sizes, the data FIFO status doesn't indicate a
"empty" state right away when the data transfer is done.  Queuing
another data transfer in that condition results in a transfer timeout.

The empty FIFO bit eventually get set by itself in less than 50 usecs
when it is not set right away. So let's just poll for that bit before
configuring the controller with a new data transfer.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
drivers/mmc/host/mvsdio.c