From patchwork Tue Mar 12 07:35:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10848661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96FFE1515 for ; Tue, 12 Mar 2019 07:37:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F301293A8 for ; Tue, 12 Mar 2019 07:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 729C2293DA; Tue, 12 Mar 2019 07:37:05 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDB8C293A8 for ; Tue, 12 Mar 2019 07:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=X1Gs+f5nGiFtgoOdUgotkHw5viuqPcoBIikmASH01GE=; b=WTYjF2UCuRzQhiaNlubeocFkCf aVCM74a7wB0RpoddghOg72j0tLpwka5zbac6ksNPWWkjeMYUzoqGZCl92vo9qLExWWKmdAKpzVGa4 ZRDesnjL/luHtKbg7YyYfSUVp5kbgDpL3W3CR50ypvSO+c4/d9MCslf5rpzKj1lKZc+CRPEO356gX JNeaSpiNbRuLwziV1eV2PFgHvmKgr+FserNZGytBDGhO9lOXtgrETaQBxy7QHq97nHwD6kcim5eRc nYEq0Y0f0cZ7wuTA9t+TxYsmwinXIkCeFdUfZS1/B8iMPcUoppbyBTtHpYKmcMlRU3Qa1TP4KHXU/ RVd9PchQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3byA-0006l5-5p; Tue, 12 Mar 2019 07:37:02 +0000 Received: from lucky1.263xmail.com ([211.157.147.133]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3by6-0006jI-Ls for linux-rockchip@lists.infradead.org; Tue, 12 Mar 2019 07:37:00 +0000 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.236]) by lucky1.263xmail.com (Postfix) with ESMTP id 7F76C4635; Tue, 12 Mar 2019 15:36:49 +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 (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P28493T139857189914368S1552376204389803_; Tue, 12 Mar 2019 15:36:48 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <23537a3ab8be116ba8f2224aa6dad95c> X-RL-SENDER: shawn.lin@rock-chips.com X-SENDER: lintao@rock-chips.com X-LOGIN-NAME: shawn.lin@rock-chips.com X-FST-TO: jh80.chung@samsung.com X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Shawn Lin To: Jaehoon Chung , Ulf Hansson Subject: [PATCH v2 1/3] mmc: dw_mmc: Check busy state in dw_mci_request() Date: Tue, 12 Mar 2019 15:35:07 +0800 Message-Id: <1552376109-126335-2-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552376109-126335-1-git-send-email-shawn.lin@rock-chips.com> References: <1552376109-126335-1-git-send-email-shawn.lin@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190312_003658_998282_081F3666 X-CRM114-Status: GOOD ( 13.86 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Shawn Lin , linux-mmc@vger.kernel.org, Douglas Anderson MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Move it from dw_mci_start_command() to dw_mci_request(). Then dw_mci_wait_while_busy() isn't called with host's lock hold. Signed-off-by: Shawn Lin Tested-by: Ziyuan Xu --- Changes in v2: None drivers/mmc/host/dw_mmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 80dc2fd..703dedf 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -426,7 +426,6 @@ static void dw_mci_start_command(struct dw_mci *host, mci_writel(host, CMDARG, cmd->arg); wmb(); /* drain writebuffer */ - dw_mci_wait_while_busy(host, cmd_flags); mci_writel(host, CMD, cmd_flags | SDMMC_CMD_START); @@ -1419,6 +1418,10 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) return; } + if ((mrq->cmd->opcode != MMC_SEND_STATUS && mrq->cmd->data) && + !(mrq->cmd->opcode == SD_SWITCH_VOLTAGE)) + dw_mci_wait_while_busy(host, SDMMC_CMD_PRV_DAT_WAIT); + spin_lock_bh(&host->lock); dw_mci_queue_request(host, slot, mrq);