Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6467799ybl; Wed, 15 Jan 2020 05:14:50 -0800 (PST) X-Google-Smtp-Source: APXvYqw6SCc5mVBcMVM0cYc7eiOQGq5OeSeGtF8qNDAl5EPES0PhmXZ1qvmf+tNZMdpQ0eKj/nGE X-Received: by 2002:aca:2207:: with SMTP id b7mr21372602oic.109.1579094090499; Wed, 15 Jan 2020 05:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579094090; cv=none; d=google.com; s=arc-20160816; b=DwYbalImcI6DRgVuODcQmJRcVAj30iZy4gkNMhWDnMRQDjTyVBCP9LB0Lw5dPJZn3Y n4sYjw6GQxF819fInJ2KgwpKgfMY2F6ZcB3nZ65MTGXeoJMnJuT1sVSSl06W9fpshCt8 WHfVM3xkyoAYQCOU947ok3htuHjXQ7982H7KC367Jx6IFDGEWhrkfc6I1vn2KVSC0v2S +NSBXiBY7ihZVPIBgkBLXBQCBRn1QjplWOfFH9y7V5h79YBG5v1x1WVa+UbFzF4GP6aT PCzdD53pHOZRT1j6HqvCzutPZu7Q4a0aSrE5qOYTzsdlcWE4AOuq4pMYTkgTPw9L0uOe Bg4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=zzJUHnHw77m7rVCmso38ylBDtIFL7ZmibuwoCui3i1o=; b=TqF95IWZAnHAS4hofLbGrM5jR/db4yN+lI1uT9cT3fyFUOLdooF3t8l4vt+ilIdkEt baPItB4UIB2Y40vCT8rncSQufesryxn2gtRgJXInPlYzCqHxfHa/LbMXfd2dfTSsDoAw yL+9crrnuNaRj7Zx2PgCms7HQD/zDvv7vp+pdCa+N/J6rtFrerML/itmTCD3qvWlGeh/ zg5kV2XoKR8OpwWFejYPtDyga2eZR3gvrCBC02UV0eImRWt7v5Me4fSrit8uknW/m+ax MbHtBnLU9Ff3pituZp5piHpkmabI+QOopkCC0LSuf10rXWV+Nac1zJhjauDzDIJPTWyV YVHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si235063oth.167.2020.01.15.05.14.37; Wed, 15 Jan 2020 05:14:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728927AbgAONNQ (ORCPT + 99 others); Wed, 15 Jan 2020 08:13:16 -0500 Received: from mga01.intel.com ([192.55.52.88]:5833 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgAONNP (ORCPT ); Wed, 15 Jan 2020 08:13:15 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 05:13:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,322,1574150400"; d="scan'208";a="256769818" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.167]) ([10.237.72.167]) by fmsmga002.fm.intel.com with ESMTP; 15 Jan 2020 05:13:14 -0800 Subject: Re: [PATCH 2/3] mmc: sdhci_am654: Reset Command and Data line after tuning To: Faiz Abbas , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org References: <20200108143301.1929-1-faiz_abbas@ti.com> <20200108143301.1929-3-faiz_abbas@ti.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <1431a5a3-cc17-b03b-1f94-3e4290f3ce7d@intel.com> Date: Wed, 15 Jan 2020 15:12:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200108143301.1929-3-faiz_abbas@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/01/20 4:33 pm, Faiz Abbas wrote: > The tuning data is leftover in the buffer after tuning. This can cause > issues in future data commands, especially with CQHCI. Reset the command > and data lines after tuning to continue from a clean state. > > Fixes: 41fd4caeb00b ("mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver") > Cc: stable@vger.kernel.org > Signed-off-by: Faiz Abbas Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci_am654.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c > index 2d38b1e12a7e..59c0c41b3739 100644 > --- a/drivers/mmc/host/sdhci_am654.c > +++ b/drivers/mmc/host/sdhci_am654.c > @@ -240,6 +240,22 @@ static void sdhci_am654_write_b(struct sdhci_host *host, u8 val, int reg) > writeb(val, host->ioaddr + reg); > } > > +static int sdhci_am654_execute_tuning(struct mmc_host *mmc, u32 opcode) > +{ > + struct sdhci_host *host = mmc_priv(mmc); > + int err = sdhci_execute_tuning(mmc, opcode); > + > + if (err) > + return err; > + /* > + * Tuning data remains in the buffer after tuning. > + * Do a command and data reset to get rid of it > + */ > + sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); > + > + return 0; > +} > + > static struct sdhci_ops sdhci_am654_ops = { > .get_max_clock = sdhci_pltfm_clk_get_max_clock, > .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, > @@ -546,6 +562,8 @@ static int sdhci_am654_probe(struct platform_device *pdev) > goto pm_runtime_put; > } > > + host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning; > + > ret = sdhci_am654_init(host); > if (ret) > goto pm_runtime_put; >