mmc: sdhci: Check card status after reset
authorRaul E Rangel <rrangel@chromium.org>
Wed, 4 Sep 2019 16:46:24 +0000 (10:46 -0600)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 13 Nov 2019 15:10:16 +0000 (16:10 +0100)
commitdcaac3f7840177ec9894abbd4a0fabf31801ecb6
tree7d60af4796a575b6e5be0f7827049c7843abe60b
parent31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c
mmc: sdhci: Check card status after reset

In sdhci_do_reset we call the reset callback which is typically
sdhci_reset. sdhci_reset can wait for up to 100ms waiting for the
controller to reset. If SDHCI_RESET_ALL was passed as the flag, the
controller will clear the IRQ mask. If during that 100ms the card is
removed there is no notification to the MMC system that the card was
removed. So from the drivers point of view the card is always present.

By making sdhci_reinit compare the present state it can schedule a
rescan if the card was removed while a reset was in progress.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c