linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Veerabhadrarao Badiganti <vbadigan@codeaurora.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: [PATCH V3 2/2] mmc: sdhci-msm: Deactivate CQE during SDHC reset
Date: Fri,  6 Mar 2020 19:38:43 +0530	[thread overview]
Message-ID: <1583503724-13943-3-git-send-email-vbadigan@codeaurora.org> (raw)
In-Reply-To: <1583503724-13943-1-git-send-email-vbadigan@codeaurora.org>

When SDHC gets reset (E.g. in runtime suspend path), CQE also gets
reset and goes to disable state. But s/w state still points it as CQE
is in enabled state. Since s/w and h/w states goes out of sync,
it results in s/w request timeout for subsequent CQE requests.

To synchronize CQE s/w and h/w state during SDHC reset,
explicitly deactivate CQE just before SDHC reset.

Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
---
Changes sicne V2:
	- Use cqhci_deactivate() instead of cqhci_disable().
	- Deactivate CQCHI just before SDHC reset.

Changes since V1:
	- Disable CQE only when SDHC undergoes s/w reset for all.
---
 drivers/mmc/host/sdhci-msm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 53b79ee..09ff731 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1823,6 +1823,13 @@ static void sdhci_msm_set_regulator_caps(struct sdhci_msm_host *msm_host)
 	pr_debug("%s: supported caps: 0x%08x\n", mmc_hostname(mmc), caps);
 }
 
+static void sdhci_msm_reset(struct sdhci_host *host, u8 mask)
+{
+	if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL))
+		cqhci_deactivate(host->mmc);
+	sdhci_reset(host, mask);
+}
+
 static const struct sdhci_msm_variant_ops mci_var_ops = {
 	.msm_readl_relaxed = sdhci_msm_mci_variant_readl_relaxed,
 	.msm_writel_relaxed = sdhci_msm_mci_variant_writel_relaxed,
@@ -1861,7 +1868,7 @@ static void sdhci_msm_set_regulator_caps(struct sdhci_msm_host *msm_host)
 MODULE_DEVICE_TABLE(of, sdhci_msm_dt_match);
 
 static const struct sdhci_ops sdhci_msm_ops = {
-	.reset = sdhci_reset,
+	.reset = sdhci_msm_reset,
 	.set_clock = sdhci_msm_set_clock,
 	.get_min_clock = sdhci_msm_get_min_clock,
 	.get_max_clock = sdhci_msm_get_max_clock,
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  parent reply	other threads:[~2020-03-06 14:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 11:50 [PATCH] mmc: sdhci-msm: Disable CQE during SDHC reset Veerabhadrarao Badiganti
2020-03-04 11:54 ` [PATCH V2] " Veerabhadrarao Badiganti
2020-03-04 12:28   ` Adrian Hunter
2020-03-04 13:10     ` Veerabhadrarao Badiganti
2020-03-04 14:10       ` Adrian Hunter
2020-03-04 16:50         ` Veerabhadrarao Badiganti
2020-03-05  8:59           ` Adrian Hunter
2020-03-06 10:14             ` Veerabhadrarao Badiganti
2020-03-06 14:08 ` [PATCH V3 0/2] Deactivate " Veerabhadrarao Badiganti
2020-03-06 14:08   ` [PATCH V3 1/2] mmc: cqhci: Add cqhci_deactivate() Veerabhadrarao Badiganti
2020-03-06 14:08   ` Veerabhadrarao Badiganti [this message]
2020-03-06 14:11     ` [PATCH V3 2/2] mmc: sdhci-msm: Deactivate CQE during SDHC reset Adrian Hunter
2020-03-11 15:34   ` [PATCH V3 0/2] " Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1583503724-13943-3-git-send-email-vbadigan@codeaurora.org \
    --to=vbadigan@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).