From patchwork Wed Apr 11 07:24:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10334959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CF5E860134 for ; Wed, 11 Apr 2018 07:32:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9EA32872E for ; Wed, 11 Apr 2018 07:32:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE7D428744; Wed, 11 Apr 2018 07:32:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 586C92872E for ; Wed, 11 Apr 2018 07:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750819AbeDKHcI (ORCPT ); Wed, 11 Apr 2018 03:32:08 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:47863 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbeDKHcI (ORCPT ); Wed, 11 Apr 2018 03:32:08 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.130]) by lucky1.263xmail.com (Postfix) with ESMTP id 5366C1F59A6; Wed, 11 Apr 2018 15:31:46 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id D71743AF; Wed, 11 Apr 2018 15:31:46 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 249993MASA0; Wed, 11 Apr 2018 15:31:47 +0800 (CST) From: Shawn Lin To: Ulf Hansson Cc: Adrian Hunter , linux-mmc@vger.kernel.org, Shawn Lin Subject: [PATCH] mmc: core: Set card as removed in mmc_remove_card() Date: Wed, 11 Apr 2018 15:24:31 +0800 Message-Id: <1523431471-204238-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }