* [PATCH] mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops
@ 2025-03-11 15:01 Kamal Dasu
2025-03-11 15:46 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: Kamal Dasu @ 2025-03-11 15:01 UTC (permalink / raw)
To: Adrian Hunter, Kamal Dasu, Al Cooper,
Broadcom internal kernel review list, Ulf Hansson,
Florian Fainelli, linux-mmc, linux-arm-kernel, linux-kernel
Cc: stable
cqhci timeouts observed on brcmstb platforms during suspend:
...
[ 164.832853] mmc0: cqhci: timeout for tag 18
...
Adding cqhci_suspend()/resume() calls to disable cqe
in sdhci_brcmstb_suspend()/resume() respectively to fix
CQE timeouts seen on PM suspend.
Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)")
Cc: stable@vger.kernel.org
Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
---
drivers/mmc/host/sdhci-brcmstb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
index 0ef4d578ade8..bf55a9185eb6 100644
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -505,6 +505,12 @@ static int sdhci_brcmstb_suspend(struct device *dev)
struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host);
clk_disable_unprepare(priv->base_clk);
+ if (host->mmc->caps2 & MMC_CAP2_CQE) {
+ ret = cqhci_suspend(host->mmc);
+ if (ret)
+ return ret;
+ }
+
return sdhci_pltfm_suspend(dev);
}
@@ -529,6 +535,9 @@ static int sdhci_brcmstb_resume(struct device *dev)
ret = clk_set_rate(priv->base_clk, priv->base_freq_hz);
}
+ if (host->mmc->caps2 & MMC_CAP2_CQE)
+ ret = cqhci_resume(host->mmc);
+
return ret;
}
#endif
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops
2025-03-11 15:01 [PATCH] mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops Kamal Dasu
@ 2025-03-11 15:46 ` Florian Fainelli
2025-03-11 16:06 ` Kamal Dasu
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2025-03-11 15:46 UTC (permalink / raw)
To: Kamal Dasu, Adrian Hunter, Al Cooper,
Broadcom internal kernel review list, Ulf Hansson, linux-mmc,
linux-arm-kernel, linux-kernel
Cc: stable
On 3/11/25 08:01, Kamal Dasu wrote:
> cqhci timeouts observed on brcmstb platforms during suspend:
> ...
> [ 164.832853] mmc0: cqhci: timeout for tag 18
> ...
>
> Adding cqhci_suspend()/resume() calls to disable cqe
> in sdhci_brcmstb_suspend()/resume() respectively to fix
> CQE timeouts seen on PM suspend.
>
> Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
> ---
> drivers/mmc/host/sdhci-brcmstb.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
> index 0ef4d578ade8..bf55a9185eb6 100644
> --- a/drivers/mmc/host/sdhci-brcmstb.c
> +++ b/drivers/mmc/host/sdhci-brcmstb.c
> @@ -505,6 +505,12 @@ static int sdhci_brcmstb_suspend(struct device *dev)
> struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host);
Missing an int ret declaration here, otherwise that won't build.
>
> clk_disable_unprepare(priv->base_clk);
> + if (host->mmc->caps2 & MMC_CAP2_CQE) {
> + ret = cqhci_suspend(host->mmc);
> + if (ret)
> + return ret;
> + }
> +
> return sdhci_pltfm_suspend(dev);
> }
>
> @@ -529,6 +535,9 @@ static int sdhci_brcmstb_resume(struct device *dev)
> ret = clk_set_rate(priv->base_clk, priv->base_freq_hz);
> }
>
> + if (host->mmc->caps2 & MMC_CAP2_CQE)
> + ret = cqhci_resume(host->mmc);
> +
> return ret;
> }
> #endif
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops
2025-03-11 15:46 ` Florian Fainelli
@ 2025-03-11 16:06 ` Kamal Dasu
0 siblings, 0 replies; 3+ messages in thread
From: Kamal Dasu @ 2025-03-11 16:06 UTC (permalink / raw)
To: Florian Fainelli
Cc: Adrian Hunter, Al Cooper, Broadcom internal kernel review list,
Ulf Hansson, linux-mmc, linux-arm-kernel, linux-kernel, stable
[-- Attachment #1.1: Type: text/plain, Size: 1879 bytes --]
On Tue, Mar 11, 2025 at 11:46 AM Florian Fainelli <
florian.fainelli@broadcom.com> wrote:
> On 3/11/25 08:01, Kamal Dasu wrote:
> > cqhci timeouts observed on brcmstb platforms during suspend:
> > ...
> > [ 164.832853] mmc0: cqhci: timeout for tag 18
> > ...
> >
> > Adding cqhci_suspend()/resume() calls to disable cqe
> > in sdhci_brcmstb_suspend()/resume() respectively to fix
> > CQE timeouts seen on PM suspend.
> >
> > Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command
> Queuing (CQE)")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
> > ---
> > drivers/mmc/host/sdhci-brcmstb.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/mmc/host/sdhci-brcmstb.c
> b/drivers/mmc/host/sdhci-brcmstb.c
> > index 0ef4d578ade8..bf55a9185eb6 100644
> > --- a/drivers/mmc/host/sdhci-brcmstb.c
> > +++ b/drivers/mmc/host/sdhci-brcmstb.c
> > @@ -505,6 +505,12 @@ static int sdhci_brcmstb_suspend(struct device *dev)
> > struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host);
>
> Missing an int ret declaration here, otherwise that won't build.
>
> oops will fix it and send v2.
> >
> > clk_disable_unprepare(priv->base_clk);
> > + if (host->mmc->caps2 & MMC_CAP2_CQE) {
> > + ret = cqhci_suspend(host->mmc);
> > + if (ret)
> > + return ret;
> > + }
> > +
> > return sdhci_pltfm_suspend(dev);
> > }
> >
> > @@ -529,6 +535,9 @@ static int sdhci_brcmstb_resume(struct device *dev)
> > ret = clk_set_rate(priv->base_clk,
> priv->base_freq_hz);
> > }
> >
> > + if (host->mmc->caps2 & MMC_CAP2_CQE)
> > + ret = cqhci_resume(host->mmc);
> > +
> > return ret;
> > }
> > #endif
>
>
> --
> Florian
>
[-- Attachment #1.2: Type: text/html, Size: 2888 bytes --]
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4190 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-11 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 15:01 [PATCH] mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops Kamal Dasu
2025-03-11 15:46 ` Florian Fainelli
2025-03-11 16:06 ` Kamal Dasu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox