Re: [RFC PATCH] mmc: sdhci: return generic tuning failures

Adrian Hunter <[email protected]>
Newsgroups org.kernel.vger.linux-mmc,org.kernel.vger.linux-kernel
Organization Intel Finland Oy, Registered Address: c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo, Business Identity Code: 0357606 - 4, Domiciled in Helsinki
Message-ID <[email protected]>
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 <[email protected]>
> ---
>  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:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.