LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128
@ 2024-04-02  9:35 Maksim Kiselev
  2024-04-04  8:28 ` Adrian Hunter
  2024-04-04  9:31 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Maksim Kiselev @ 2024-04-02  9:35 UTC (permalink / raw
  Cc: Maksim Kiselev, Drew Fustini, Xi Ruoyao, Adrian Hunter,
	Ulf Hansson, linux-mmc, linux-kernel

Fix SD card tuning error by increasing tuning loop count
from 40(MAX_TUNING_LOOP) to 128.

For some reason the tuning algorithm requires to move through all the taps
of delay line even if the THRESHOLD_MODE (bit 2 in AT_CTRL_R) is used
instead of the LARGEST_WIN_MODE.

Tested-by: Drew Fustini <drew@pdp7.com>
Tested-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
Previous discussion was here:
https://lore.kernel.org/lkml/CALHCpMhc1F5Ue7U_gsDXREHUZRVQJNYRCJxYxoNqbN=-39jf7A@mail.gmail.com/

 drivers/mmc/host/sdhci-of-dwcmshc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index 8d6cfb648096..1001b6ea1a89 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -706,6 +706,7 @@ static int th1520_execute_tuning(struct sdhci_host *host, u32 opcode)
 
 	/* perform tuning */
 	sdhci_start_tuning(host);
+	host->tuning_loop_count = 128;
 	host->tuning_err = __sdhci_execute_tuning(host, opcode);
 	if (host->tuning_err) {
 		/* disable auto-tuning upon tuning error */
-- 
2.40.1


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

* Re: [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128
  2024-04-02  9:35 [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128 Maksim Kiselev
@ 2024-04-04  8:28 ` Adrian Hunter
  2024-04-04  9:31 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2024-04-04  8:28 UTC (permalink / raw
  To: Maksim Kiselev
  Cc: Drew Fustini, Xi Ruoyao, Ulf Hansson, linux-mmc, linux-kernel

On 2/04/24 12:35, Maksim Kiselev wrote:
> Fix SD card tuning error by increasing tuning loop count
> from 40(MAX_TUNING_LOOP) to 128.
> 
> For some reason the tuning algorithm requires to move through all the taps
> of delay line even if the THRESHOLD_MODE (bit 2 in AT_CTRL_R) is used
> instead of the LARGEST_WIN_MODE.
> 
> Tested-by: Drew Fustini <drew@pdp7.com>
> Tested-by: Xi Ruoyao <xry111@xry111.site>
> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> Previous discussion was here:
> https://lore.kernel.org/lkml/CALHCpMhc1F5Ue7U_gsDXREHUZRVQJNYRCJxYxoNqbN=-39jf7A@mail.gmail.com/
> 
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index 8d6cfb648096..1001b6ea1a89 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> @@ -706,6 +706,7 @@ static int th1520_execute_tuning(struct sdhci_host *host, u32 opcode)
>  
>  	/* perform tuning */
>  	sdhci_start_tuning(host);
> +	host->tuning_loop_count = 128;
>  	host->tuning_err = __sdhci_execute_tuning(host, opcode);
>  	if (host->tuning_err) {
>  		/* disable auto-tuning upon tuning error */


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

* Re: [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128
  2024-04-02  9:35 [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128 Maksim Kiselev
  2024-04-04  8:28 ` Adrian Hunter
@ 2024-04-04  9:31 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2024-04-04  9:31 UTC (permalink / raw
  To: Maksim Kiselev
  Cc: Drew Fustini, Xi Ruoyao, Adrian Hunter, linux-mmc, linux-kernel

On Tue, 2 Apr 2024 at 11:36, Maksim Kiselev <bigunclemax@gmail.com> wrote:
>
> Fix SD card tuning error by increasing tuning loop count
> from 40(MAX_TUNING_LOOP) to 128.
>
> For some reason the tuning algorithm requires to move through all the taps
> of delay line even if the THRESHOLD_MODE (bit 2 in AT_CTRL_R) is used
> instead of the LARGEST_WIN_MODE.
>
> Tested-by: Drew Fustini <drew@pdp7.com>
> Tested-by: Xi Ruoyao <xry111@xry111.site>
> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>

Applied for fixes and by adding a fixes+stable tag, thanks!

Kind regards
Uffe



> ---
> Previous discussion was here:
> https://lore.kernel.org/lkml/CALHCpMhc1F5Ue7U_gsDXREHUZRVQJNYRCJxYxoNqbN=-39jf7A@mail.gmail.com/
>
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index 8d6cfb648096..1001b6ea1a89 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> @@ -706,6 +706,7 @@ static int th1520_execute_tuning(struct sdhci_host *host, u32 opcode)
>
>         /* perform tuning */
>         sdhci_start_tuning(host);
> +       host->tuning_loop_count = 128;
>         host->tuning_err = __sdhci_execute_tuning(host, opcode);
>         if (host->tuning_err) {
>                 /* disable auto-tuning upon tuning error */
> --
> 2.40.1
>

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

end of thread, other threads:[~2024-04-04  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02  9:35 [PATCH v1] mmc: sdhci-of-dwcmshc: th1520: Increase tuning loop count to 128 Maksim Kiselev
2024-04-04  8:28 ` Adrian Hunter
2024-04-04  9:31 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).