From patchwork Tue Aug 19 03:53:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yisun1 X-Patchwork-Id: 4740431 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 51B9F9F39D for ; Tue, 19 Aug 2014 03:54:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 708C320120 for ; Tue, 19 Aug 2014 03:54:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58E522010F for ; Tue, 19 Aug 2014 03:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbaHSDyN (ORCPT ); Mon, 18 Aug 2014 23:54:13 -0400 Received: from mga14.intel.com ([192.55.52.115]:36223 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbaHSDyN convert rfc822-to-8bit (ORCPT ); Mon, 18 Aug 2014 23:54:13 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 18 Aug 2014 20:46:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,891,1400050800"; d="scan'208";a="578535321" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2014 20:53:45 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Aug 2014 20:53:45 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Aug 2014 20:53:45 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.198]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0195.001; Tue, 19 Aug 2014 11:53:43 +0800 From: "Sun, Yi Y" To: "linux-mmc@vger.kernel.org" , "ulf.hansson@linaro.org" Subject: RE: [PATCH v2] mmc: execute tuning when device is not busy. Thread-Topic: [PATCH v2] mmc: execute tuning when device is not busy. Thread-Index: AQHPt4S15HzdYfdctEqnRsXmZMkRLJvXUusQ Date: Tue, 19 Aug 2014 03:53:43 +0000 Message-ID: <525EAED47491124EB5123A51BD2FC791019DCB1B@SHSMSX101.ccr.corp.intel.com> References: <1407995498-17634-1-git-send-email-yi.y.sun@intel.com> In-Reply-To: <1407995498-17634-1-git-send-email-yi.y.sun@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Hi, Uffe, Could you please review the patch? Thanks! BRs, Sun Yi -----Original Message----- From: Sun, Yi Y Sent: Thursday, August 14, 2014 1:52 PM To: linux-mmc@vger.kernel.org; ulf.hansson@linaro.org Cc: Sun, Yi Y Subject: [PATCH v2] mmc: execute tuning when device is not busy. We find tuning timeout because of the secure erase operation lasts too long so not to do tuning when device is busy. Signed-off-by: Yi Sun --- drivers/mmc/host/sdhci.c | 7 ++++--- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 47055f3..6a584d7 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1355,11 +1355,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) present_state = sdhci_readl(host, SDHCI_PRESENT_STATE); /* * Check if the re-tuning timer has already expired and there - * is no on-going data transfer. If so, we need to execute - * tuning procedure before sending command. + * is no on-going data transfer and DAT0 is not busy. If so, + * we need to execute tuning procedure before sending command. */ if ((host->flags & SDHCI_NEEDS_RETUNING) && - !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) { + !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) && + (present_state & SDHCI_DATA_0_LVL_MASK)) { if (mmc->card) { /* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode = diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 4a5cd5e..0ae6b99d 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -72,6 +72,7 @@ #define SDHCI_WRITE_PROTECT 0x00080000 #define SDHCI_DATA_LVL_MASK 0x00F00000 #define SDHCI_DATA_LVL_SHIFT 20 +#define SDHCI_DATA_0_LVL_MASK 0x00100000 #define SDHCI_HOST_CONTROL 0x28 #define SDHCI_CTRL_LED 0x01