From patchwork Wed Feb 27 03:36:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10831021 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 618CF13B5 for ; Wed, 27 Feb 2019 03:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2E128E7B for ; Wed, 27 Feb 2019 03:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AD9A2C7ED; Wed, 27 Feb 2019 03:46:04 +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 DB9DF28E7B for ; Wed, 27 Feb 2019 03:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729551AbfB0DqD (ORCPT ); Tue, 26 Feb 2019 22:46:03 -0500 Received: from lucky1.263xmail.com ([211.157.147.130]:53798 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729435AbfB0DqD (ORCPT ); Tue, 26 Feb 2019 22:46:03 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.110]) by lucky1.263xmail.com (Postfix) with ESMTP id 179874E66; Wed, 27 Feb 2019 11:38:08 +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 P24029T140137178584832S1551238684445785_; Wed, 27 Feb 2019 11:38:07 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4a4c17db7002f9eb3bddb51c00b59f1f> 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 Cc: Heiko Stuebner , linux-mmc@vger.kernel.org, linux-rockchip@lists.infradead.org, Ziyuan Xu , Douglas Anderson , Shawn Lin Subject: [PATCH 1/3] mmc: dw_mmc: Check busy state in dw_mci_request() Date: Wed, 27 Feb 2019 11:36:41 +0800 Message-Id: <1551238603-82412-2-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551238603-82412-1-git-send-email-shawn.lin@rock-chips.com> References: <1551238603-82412-1-git-send-email-shawn.lin@rock-chips.com> 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 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 --- 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);