On 11/04/18 10:24, Shawn Lin wrote: > 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); Pedantically we should not call mmc_card_set_removed() if we have not claimed the host. Of course we can't claim the host because the block driver already has it, but I am not sure this is the right place to do this. My first question is how come the I/O times out if the card is still present i.e. you are only unbinding the host controller, so you should remove the card while the host controller and card are still functional? > device_del(&card->dev); > of_node_put(card->dev.of_node); > } > -- 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