]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: core: Fix some driver hangs when dealing with broken devices
authorTrey Ramsay <tramsay@linux.vnet.ibm.com>
Fri, 16 Nov 2012 15:31:41 +0000 (09:31 -0600)
committerChris Ball <cjb@laptop.org>
Mon, 26 Nov 2012 00:43:46 +0000 (19:43 -0500)
commit5f8ef1aa72fad5356f9bb7d51ce8069cd9a89b48
tree0bc70da113e87fe9c9e73e34e0f79d1aeb2fa0bf
parent4e211ac2775f8260ff209426cf7ed4273661ce44
mmc: core: Fix some driver hangs when dealing with broken devices

There are infinite loops in the mmc code that can be caused by bad
hardware.  The code will loop forever if the device never comes back
from program mode, R1_STATE_PRG, and it is not ready for data,
R1_READY_FOR_DATA.

A long timeout is added to prevent the code from looping forever.
The timeout will occur if the device never comes back from program
state or the device never becomes ready for data.

It's not clear whether the timeout will do more than log a pr_err()
and then start a fresh hang all over again.  We may need to extend
this patch later to perform some kind of reset of the device (is
that possible?) or rejection of new I/O to the device.

Signed-off-by: Trey Ramsay <tramsay@linux.vnet.ibm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/block.c
drivers/mmc/core/core.c
drivers/mmc/core/mmc_ops.c