All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait
@ 2021-04-24  8:16 Daniel Beer
  2021-04-26  7:32 ` Ben Chuang
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Beer @ 2021-04-24  8:16 UTC (permalink / raw)
  To: ulf.hansson
  Cc: linux-mmc, linux-kernel, Adrian Hunter, Ben Chuang, Daniel Beer

Inserting an SD-card on an Intel NUC10i3FNK4 (which contains a GL9755)
results in the message:

    mmc0: 1.8V regulator output did not become stable

Following this message, some cards work (sometimes), but most cards fail
with EILSEQ. This behaviour is observed on Debian 10 running kernel
4.19.188, but also with 5.8.18 and 5.11.15.

The driver currently waits 5ms after switching on the 1.8V regulator for
it to become stable. Increasing this to 10ms gets rid of the warning
about stability, but most cards still fail. Increasing it to 20ms gets
some cards working (a 32GB Samsung micro SD works, a 128GB ADATA
doesn't). At 50ms, the ADATA works most of the time, and at 100ms both
cards work reliably.

Signed-off-by: Daniel Beer <dlbeer@gmail.com>
---
 drivers/mmc/host/sdhci-pci-gli.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
index 592d79082f58..061618aa247f 100644
--- a/drivers/mmc/host/sdhci-pci-gli.c
+++ b/drivers/mmc/host/sdhci-pci-gli.c
@@ -627,8 +627,13 @@ static void sdhci_gli_voltage_switch(struct sdhci_host *host)
 	 *
 	 * Wait 5ms after set 1.8V signal enable in Host Control 2 register
 	 * to ensure 1.8V signal enable bit is set by GL9750/GL9755.
+	 *
+	 * ...however, the controller in the NUC10i3FNK4 (a 9755) requires
+	 * slightly longer than 5ms before the control register reports that
+	 * 1.8V is ready, and far longer still before the card will actually
+	 * work reliably.
 	 */
-	usleep_range(5000, 5500);
+	usleep_range(100000, 110000);
 }
 
 static void sdhci_gl9750_reset(struct sdhci_host *host, u8 mask)
-- 
2.20.1


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

* Re: [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait
  2021-04-24  8:16 [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait Daniel Beer
@ 2021-04-26  7:32 ` Ben Chuang
  2021-04-26  8:25   ` Daniel Beer
  2021-05-11 10:56   ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Chuang @ 2021-04-26  7:32 UTC (permalink / raw)
  To: dlbeer
  Cc: adrian.hunter, ben.chuang, linux-kernel, linux-mmc, ulf.hansson,
	benchuanggli

Hi Daniel,

> Inserting an SD-card on an Intel NUC10i3FNK4 (which contains a GL9755)
> results in the message:
> 
>     mmc0: 1.8V regulator output did not become stable
> 
> Following this message, some cards work (sometimes), but most cards fail
> with EILSEQ. This behaviour is observed on Debian 10 running kernel
> 4.19.188, but also with 5.8.18 and 5.11.15.

Glad to receive your report. Thanks.

> 
> The driver currently waits 5ms after switching on the 1.8V regulator for
> it to become stable. Increasing this to 10ms gets rid of the warning
> about stability, but most cards still fail. Increasing it to 20ms gets
> some cards working (a 32GB Samsung micro SD works, a 128GB ADATA
> doesn't). At 50ms, the ADATA works most of the time, and at 100ms both
> cards work reliably.

If it is convenient, can you provide the appearance pictures and product
links of these two cards? We want to buy them.

> 
> Signed-off-by: Daniel Beer <dlbeer@gmail.com>
> ---
>  drivers/mmc/host/sdhci-pci-gli.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
> index 592d79082f58..061618aa247f 100644
> --- a/drivers/mmc/host/sdhci-pci-gli.c
> +++ b/drivers/mmc/host/sdhci-pci-gli.c
> @@ -627,8 +627,13 @@ static void sdhci_gli_voltage_switch(struct sdhci_host *host)
>  	 *
>  	 * Wait 5ms after set 1.8V signal enable in Host Control 2 register
>  	 * to ensure 1.8V signal enable bit is set by GL9750/GL9755.
> +	 *
> +	 * ...however, the controller in the NUC10i3FNK4 (a 9755) requires
> +	 * slightly longer than 5ms before the control register reports that
> +	 * 1.8V is ready, and far longer still before the card will actually
> +	 * work reliably.
>  	 */
> -	usleep_range(5000, 5500);
> +	usleep_range(100000, 110000);

Looks good for me.

>  }
>  
>  static void sdhci_gl9750_reset(struct sdhci_host *host, u8 mask)
> -- 
> 2.20.1
> 
> 

Best regards,
Ben

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

* Re: [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait
  2021-04-26  7:32 ` Ben Chuang
@ 2021-04-26  8:25   ` Daniel Beer
  2021-05-11 10:56   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Beer @ 2021-04-26  8:25 UTC (permalink / raw)
  To: Ben Chuang
  Cc: adrian.hunter, ben.chuang, linux-kernel, linux-mmc, ulf.hansson

On Mon, Apr 26, 2021 at 03:32:51PM +0800, Ben Chuang wrote:
> > The driver currently waits 5ms after switching on the 1.8V regulator for
> > it to become stable. Increasing this to 10ms gets rid of the warning
> > about stability, but most cards still fail. Increasing it to 20ms gets
> > some cards working (a 32GB Samsung micro SD works, a 128GB ADATA
> > doesn't). At 50ms, the ADATA works most of the time, and at 100ms both
> > cards work reliably.
> 
> If it is convenient, can you provide the appearance pictures and product
> links of these two cards? We want to buy them.

Hi Ben,

The first is a Samsung EVO microSDXC 32GB:

    https://www.samsung.com/nz/memory-storage/memory-card/evo-plus-microsd-card-95-mbs-sd-adapter-32gb-mb-mc32ga-apc/

The second is an ADATA Premier Pro SDXC UHS-I U3 Class 10 (V30S) 128GB:

    https://www.adata.com/us/consumer/289

The images on those two pages match what I have in front of me here.

Cheers,
Daniel

-- 
Daniel Beer <dlbeer@gmail.com> http://dlbeer.co.nz/
PGP: BA6E 0B26 1F89 246C E3F3  C910 1E58 C43A 160A 553B

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

* Re: [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait
  2021-04-26  7:32 ` Ben Chuang
  2021-04-26  8:25   ` Daniel Beer
@ 2021-05-11 10:56   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2021-05-11 10:56 UTC (permalink / raw)
  To: Ben Chuang, dlbeer
  Cc: Adrian Hunter, Ben Chuang, Linux Kernel Mailing List, linux-mmc

On Mon, 26 Apr 2021 at 09:30, Ben Chuang <benchuanggli@gmail.com> wrote:
>
> Hi Daniel,
>
> > Inserting an SD-card on an Intel NUC10i3FNK4 (which contains a GL9755)
> > results in the message:
> >
> >     mmc0: 1.8V regulator output did not become stable
> >
> > Following this message, some cards work (sometimes), but most cards fail
> > with EILSEQ. This behaviour is observed on Debian 10 running kernel
> > 4.19.188, but also with 5.8.18 and 5.11.15.
>
> Glad to receive your report. Thanks.
>
> >
> > The driver currently waits 5ms after switching on the 1.8V regulator for
> > it to become stable. Increasing this to 10ms gets rid of the warning
> > about stability, but most cards still fail. Increasing it to 20ms gets
> > some cards working (a 32GB Samsung micro SD works, a 128GB ADATA
> > doesn't). At 50ms, the ADATA works most of the time, and at 100ms both
> > cards work reliably.
>
> If it is convenient, can you provide the appearance pictures and product
> links of these two cards? We want to buy them.
>
> >
> > Signed-off-by: Daniel Beer <dlbeer@gmail.com>
> > ---
> >  drivers/mmc/host/sdhci-pci-gli.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
> > index 592d79082f58..061618aa247f 100644
> > --- a/drivers/mmc/host/sdhci-pci-gli.c
> > +++ b/drivers/mmc/host/sdhci-pci-gli.c
> > @@ -627,8 +627,13 @@ static void sdhci_gli_voltage_switch(struct sdhci_host *host)
> >        *
> >        * Wait 5ms after set 1.8V signal enable in Host Control 2 register
> >        * to ensure 1.8V signal enable bit is set by GL9750/GL9755.
> > +      *
> > +      * ...however, the controller in the NUC10i3FNK4 (a 9755) requires
> > +      * slightly longer than 5ms before the control register reports that
> > +      * 1.8V is ready, and far longer still before the card will actually
> > +      * work reliably.
> >        */
> > -     usleep_range(5000, 5500);
> > +     usleep_range(100000, 110000);
>
> Looks good for me.

I consider this as an ack and will add you tag to the commit. Please
tell me if I should change.

[...]

Applied for fixes and by adding the below tags, thanks!

Acked-by: Ben Chuang <benchuanggli@gmail.com>
Fixes: e51df6ce668a ("mmc: host: sdhci-pci: Add Genesys Logic GL975x support")
Cc: stable@vger.kernel.org

Kind regards
Uffe

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

end of thread, other threads:[~2021-05-11 10:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24  8:16 [PATCH] mmc: sdhci-pci-gli: increase 1.8V regulator wait Daniel Beer
2021-04-26  7:32 ` Ben Chuang
2021-04-26  8:25   ` Daniel Beer
2021-05-11 10:56   ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.