From patchwork Sat Feb 14 06:17:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: addy ke X-Patchwork-Id: 5828461 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C390ABF440 for ; Sat, 14 Feb 2015 06:18:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E5BA2011E for ; Sat, 14 Feb 2015 06:18:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39F832020F for ; Sat, 14 Feb 2015 06:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753936AbbBNGSi (ORCPT ); Sat, 14 Feb 2015 01:18:38 -0500 Received: from regular1.263xmail.com ([211.150.99.134]:35722 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753917AbbBNGSg (ORCPT ); Sat, 14 Feb 2015 01:18:36 -0500 Received: from addy.ke?rock-chips.com (unknown [192.168.167.128]) by regular1.263xmail.com (Postfix) with SMTP id BB5336F18; Sat, 14 Feb 2015 14:18:32 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 592391F724; Sat, 14 Feb 2015 14:18:23 +0800 (CST) X-RL-SENDER: addy.ke@rock-chips.com X-SENDER-IP: 124.248.208.12 X-LOGIN-NAME: addy.ke@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: kfx@rock-chips.com X-DNS-TYPE: 1 Received: from unknown (yjw5ksg12.jupiterparts.com [124.248.208.12]) by smtp.263.net (Postfix) whith SMTP id 13612FTH32W; Sat, 14 Feb 2015 14:18:30 +0800 (CST) From: Addy Ke To: jh80.chung@samsung.com, ulf.hansson@linaro.org, olof@lixom.net, alim.akhtar@gmail.com, a.hajda@samsung.com, dianders@chromium.org Cc: heiko@sntech.de, cf@rock-chips.com, lintao@rock-chips.com, huangtao@rock-chips.com, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Addy Ke Subject: [PATCH v4 3/3] mmc: dw_mmc: Don't start command while data busy Date: Sat, 14 Feb 2015 14:17:48 +0800 Message-Id: <1423894668-8886-4-git-send-email-addy.ke@rock-chips.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423894668-8886-1-git-send-email-addy.ke@rock-chips.com> References: <1423828368-18456-1-git-send-email-addy.ke@rock-chips.com> <1423894668-8886-1-git-send-email-addy.ke@rock-chips.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should wait until unbusy before the next request. But this does't need if the command is CMD13, which can access SD Status register regardless of data busy. Signed-off-by: Addy Ke --- Changes in v4: - CMD13 doesn't need wait until unbusy. drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index ac21863..692d97a 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1076,6 +1076,10 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) WARN_ON(slot->mrq); + /* Wait until unbusy if the command isn't CMD13 */ + if (mrq->cmd->opcode != MMC_SEND_STATUS) + dw_mci_wait_busy(slot); + /* * The check for card presence and queueing of the request must be * atomic, otherwise the card could be removed in between and the