Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [RFC PATCH] mmc: sdhci: return generic tuning failures
@ 2026-06-23 14:02 Pengpeng Hou
  2026-07-03 15:22 ` Adrian Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-23 14:02 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson; +Cc: Pengpeng Hou, linux-mmc, linux-kernel

__sdhci_execute_tuning() returns tuning errors such as -ETIMEDOUT and
-EAGAIN. The generic sdhci_execute_tuning() path stores that value in
host->tuning_err, but keeps its public return variable at zero, so
callers see success even when generic tuning failed.

Return the generic tuning result while still preserving
host->tuning_err. This is intended as an RFC patch because some users
may rely on the historical fixed-clock fallback behavior.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/mmc/host/sdhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e3bf901b1..a90e48383 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2967,7 +2967,8 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 
 	sdhci_start_tuning(host);
 
-	host->tuning_err = __sdhci_execute_tuning(host, opcode);
+	err = __sdhci_execute_tuning(host, opcode);
+	host->tuning_err = err;
 
 	sdhci_end_tuning(host);
 out:
-- 
2.50.1 (Apple Git-155)


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

* Re: [RFC PATCH] mmc: sdhci: return generic tuning failures
  2026-06-23 14:02 [RFC PATCH] mmc: sdhci: return generic tuning failures Pengpeng Hou
@ 2026-07-03 15:22 ` Adrian Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Hunter @ 2026-07-03 15:22 UTC (permalink / raw)
  To: Pengpeng Hou, Ulf Hansson; +Cc: linux-mmc, linux-kernel

On 23/06/2026 17:02, Pengpeng Hou wrote:
> __sdhci_execute_tuning() returns tuning errors such as -ETIMEDOUT and
> -EAGAIN. The generic sdhci_execute_tuning() path stores that value in
> host->tuning_err, but keeps its public return variable at zero, so
> callers see success even when generic tuning failed.

Callers that need to, check tuning_err

> 
> Return the generic tuning result while still preserving
> host->tuning_err. This is intended as an RFC patch because some users
> may rely on the historical fixed-clock fallback behavior.
> 
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
>  drivers/mmc/host/sdhci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index e3bf901b1..a90e48383 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2967,7 +2967,8 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  
>  	sdhci_start_tuning(host);
>  
> -	host->tuning_err = __sdhci_execute_tuning(host, opcode);
> +	err = __sdhci_execute_tuning(host, opcode);
> +	host->tuning_err = err;

No, the code is meant to be the way it is.

>  
>  	sdhci_end_tuning(host);
>  out:


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

end of thread, other threads:[~2026-07-03 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 14:02 [RFC PATCH] mmc: sdhci: return generic tuning failures Pengpeng Hou
2026-07-03 15:22 ` Adrian Hunter

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