[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc195864-0826-03e1-0f17-d105b46af933@intel.com>
Date: Fri, 6 Mar 2020 16:11:41 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Veerabhadrarao Badiganti <vbadigan@...eaurora.org>,
ulf.hansson@...aro.org
Cc: linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>
Subject: Re: [PATCH V3 2/2] mmc: sdhci-msm: Deactivate CQE during SDHC reset
On 6/03/20 4:08 pm, Veerabhadrarao Badiganti wrote:
> 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@...eaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> 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,
>
Powered by blists - more mailing lists