mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
mmc: core: Set host->bus_refs properly when card is set as corrupted
With rapid hotplug test case there could be a corner case when the SD card can go bad and removed quickly even before we try to reset the card as part of recovery. This will lead to reset failure with ENOMEDIUM and since recovery failed so we set the corrupted_card flag and try to remove the card. Since corrupted_card will be set so as part of rescan we'll remove the card and return before setting the bus_refs properly leading to card not getting detected after this. Only return after setting host->bus_refs properly when card is set as corrupted. Change-Id: Id14790f9b28d8fa58d31b034be48db5486ccfcb7 Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
This commit is contained in:
parent
5b540967b7
commit
e5ac7ee2f8
1 changed files with 5 additions and 5 deletions
|
|
@ -3154,11 +3154,6 @@ void mmc_rescan(struct work_struct *work)
|
|||
if (host->bus_ops && !host->bus_dead)
|
||||
host->bus_ops->detect(host);
|
||||
|
||||
#if defined(CONFIG_SDC_QTI)
|
||||
if (host->corrupted_card)
|
||||
return;
|
||||
#endif
|
||||
|
||||
host->detect_change = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -3180,6 +3175,11 @@ void mmc_rescan(struct work_struct *work)
|
|||
*/
|
||||
mmc_bus_put(host);
|
||||
|
||||
#if defined(CONFIG_SDC_QTI)
|
||||
if (host->corrupted_card)
|
||||
goto out;
|
||||
#endif
|
||||
|
||||
mmc_claim_host(host);
|
||||
if (mmc_card_is_removable(host) && host->ops->get_cd &&
|
||||
host->ops->get_cd(host) == 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue