All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-msm: Disable CQE during SDHC reset
@ 2020-02-28 11:50 Veerabhadrarao Badiganti
  2020-03-04 11:54 ` [PATCH V2] " Veerabhadrarao Badiganti
  2020-03-06 14:08 ` [PATCH V3 0/2] Deactivate " Veerabhadrarao Badiganti
  0 siblings, 2 replies; 13+ messages in thread
From: Veerabhadrarao Badiganti @ 2020-02-28 11:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson
  Cc: linux-mmc, linux-kernel, linux-arm-msm, Veerabhadrarao Badiganti,
	Andy Gross, Bjorn Andersson

When SDHC gets reset (E.g. in suspend/resume 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 disable CQE after reset.

Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
---
 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..d7ba3b2 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)
+{
+	sdhci_reset(host, mask);
+	if (host->mmc->caps2 & MMC_CAP2_CQE)
+		cqhci_suspend(host->mmc);
+}
+
 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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-11 15:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [PATCH V3 2/2] mmc: sdhci-msm: Deactivate CQE during SDHC reset Veerabhadrarao Badiganti
2020-03-06 14:11     ` Adrian Hunter
2020-03-11 15:34   ` [PATCH V3 0/2] " Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.