Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host()
@ 2025-05-19 12:33 Wentao Liang
  2025-05-21  3:22 ` Baolin Wang
  2025-05-30 12:26 ` Adrian Hunter
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-05-19 12:33 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, Wentao Liang, stable

The dhci_sprd_runtime_suspend() calls sdhci_runtime_suspend_host() but
does not handle the return value. A proper implementation can be found
in sdhci_am654_runtime_suspend().

Add error handling for sdhci_runtime_suspend_host(). Return the error
code if the suspend fails.

Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
Cc: stable@vger.kernel.org # v4.20
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/mmc/host/sdhci-sprd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index db5e253b0f79..dd41427e973a 100644
--- a/drivers/mmc/host/sdhci-sprd.c
+++ b/drivers/mmc/host/sdhci-sprd.c
@@ -922,9 +922,12 @@ static int sdhci_sprd_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host);
+	int ret;
 
 	mmc_hsq_suspend(host->mmc);
-	sdhci_runtime_suspend_host(host);
+	ret = sdhci_runtime_suspend_host(host);
+	if (ret)
+		return ret;
 
 	clk_disable_unprepare(sprd_host->clk_sdio);
 	clk_disable_unprepare(sprd_host->clk_enable);
-- 
2.42.0.windows.2


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

* Re: [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host()
  2025-05-19 12:33 [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host() Wentao Liang
@ 2025-05-21  3:22 ` Baolin Wang
  2025-05-30 12:26 ` Adrian Hunter
  1 sibling, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2025-05-21  3:22 UTC (permalink / raw)
  To: Wentao Liang, adrian.hunter, ulf.hansson, orsonzhai, zhang.lyra
  Cc: linux-mmc, linux-kernel, stable



On 2025/5/19 20:33, Wentao Liang wrote:
> The dhci_sprd_runtime_suspend() calls sdhci_runtime_suspend_host() but
> does not handle the return value. A proper implementation can be found
> in sdhci_am654_runtime_suspend().
> 
> Add error handling for sdhci_runtime_suspend_host(). Return the error
> code if the suspend fails.
> 
> Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
> Cc: stable@vger.kernel.org # v4.20
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/mmc/host/sdhci-sprd.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index db5e253b0f79..dd41427e973a 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -922,9 +922,12 @@ static int sdhci_sprd_runtime_suspend(struct device *dev)
>   {
>   	struct sdhci_host *host = dev_get_drvdata(dev);
>   	struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host);
> +	int ret;
>   
>   	mmc_hsq_suspend(host->mmc);
> -	sdhci_runtime_suspend_host(host);
> +	ret = sdhci_runtime_suspend_host(host);
> +	if (ret)
> +		return ret;
>   
>   	clk_disable_unprepare(sprd_host->clk_sdio);
>   	clk_disable_unprepare(sprd_host->clk_enable);

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

* Re: [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host()
  2025-05-19 12:33 [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host() Wentao Liang
  2025-05-21  3:22 ` Baolin Wang
@ 2025-05-30 12:26 ` Adrian Hunter
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2025-05-30 12:26 UTC (permalink / raw)
  To: Wentao Liang, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, stable

On 19/05/2025 15:33, Wentao Liang wrote:
> The dhci_sprd_runtime_suspend() calls sdhci_runtime_suspend_host() but
> does not handle the return value. A proper implementation can be found
> in sdhci_am654_runtime_suspend().
> 
> Add error handling for sdhci_runtime_suspend_host(). Return the error
> code if the suspend fails.

I think it's better to remove the return value instead:

	https://lore.kernel.org/linux-mmc/20250530122018.37250-1-adrian.hunter@intel.com/T/#u

> 
> Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
> Cc: stable@vger.kernel.org # v4.20
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/mmc/host/sdhci-sprd.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index db5e253b0f79..dd41427e973a 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -922,9 +922,12 @@ static int sdhci_sprd_runtime_suspend(struct device *dev)
>  {
>  	struct sdhci_host *host = dev_get_drvdata(dev);
>  	struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host);
> +	int ret;
>  
>  	mmc_hsq_suspend(host->mmc);
> -	sdhci_runtime_suspend_host(host);
> +	ret = sdhci_runtime_suspend_host(host);
> +	if (ret)
> +		return ret;
>  
>  	clk_disable_unprepare(sprd_host->clk_sdio);
>  	clk_disable_unprepare(sprd_host->clk_enable);


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

end of thread, other threads:[~2025-05-30 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 12:33 [PATCH] mmc: sdhci-sprd: Add error handling for sdhci_runtime_suspend_host() Wentao Liang
2025-05-21  3:22 ` Baolin Wang
2025-05-30 12:26 ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox