[PATCH] mmc: core: Set card as removed in mmc_remove_card()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A simply continueous background I/O could 100% make the system stuck for
a long time in my system when a unbind for the controller driver happens
simultaneously. See:

dd if=/dev/mmcblk0 of=/dev/null bs=512k count=100000 &&
echo fe320000.dwmmc > /sys/bus/platform/drivers/dwmmc_rockchip/unbind

The reason is all pending requests wait for timeout one by one, but never
propagates BLK_STS_IOERR in the first place when kicked from the queue.
Set the card as removed immediately in mmc_remove_card() to solve it.

Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>
---

 drivers/mmc/core/bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index fc92c6c..c6c5dfe 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -389,6 +389,7 @@ void mmc_remove_card(struct mmc_card *card)
 			pr_info("%s: card %04x removed\n",
 				mmc_hostname(card->host), card->rca);
 		}
+		mmc_card_set_removed(card);
 		device_del(&card->dev);
 		of_node_put(card->dev.of_node);
 	}
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux