]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: sdhci: improve card removal check in sdhci_card_event()
authorShawn Guo <shawn.guo@linaro.org>
Sun, 9 Jun 2013 11:49:24 +0000 (19:49 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:53:44 +0000 (09:53 +0800)
commitb4e7c6bbd2c5c4d278fdc4e1ae94d27001fe4dc8
treea4b25f7ec61b6b25d91ae940b46fe4a8f4f38eb1
parent6c1c1cf691db8eeccb527c63558b8d0611bbfd84
mmc: sdhci: improve card removal check in sdhci_card_event()

Commit 9668d765eab78d58e656177db2acb57c249b9c01 upstream.

The following error randomly appears on an imx6q board where gpio is
used to implement card-detection when mounting EXT4 rootfs during boot.

mmc1: Card removed during transfer!
mmc1: Resetting controller.
mmcblk0: unknown error -123 sending read/write command, card status 0x900
end_request: I/O error, dev mmcblk0, sector 106744
EXT4-fs error (device mmcblk0p2): ext4_find_entry:1312: inode #5011: comm swapper/0: reading directory lblock 0

It turns out that the error message comes from the card removal check
in function sdhci_card_event().  While we have a well implemented
function sdhci_do_get_cd() handling all the possible cases of
CD, the current code only checks controller internal CD case.  That
causes problem for other CD cases like gpio on above imx6q board.

Improve the check by using sdhci_do_get_cd() to cover all possible CD
cases, so that above error on the imx6q board gets fixed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/mmc/host/sdhci.c