Patchwork [4/4,V2] mmc: esdhc: Add broken timeout quirk for p4/p5 board

login
register
mail settings
Submitter Haijun.Zhang
Date July 17, 2013, 10:11 a.m.
Message ID <1374055891-20703-3-git-send-email-Haijun.Zhang@freescale.com>
Download mbox | patch
Permalink /patch/259686/
State Not Applicable
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Haijun.Zhang - July 17, 2013, 10:11 a.m.
Sometimes command can't be completed within the time give
in eSDHC_SYSCTL[DTOCV]. So just give the max value 0x14 to
avoid this issue.

Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
changes for v2:
	- Rebuild patch of eSDHC host need long time to generate
	 command interrupt

 drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
 1 file changed, 6 insertions(+)
Scott Wood - July 17, 2013, 5:13 p.m.
On 07/17/2013 05:11:31 AM, Haijun Zhang wrote:
> Sometimes command can't be completed within the time give
> in eSDHC_SYSCTL[DTOCV]. So just give the max value 0x14 to
> avoid this issue.
> 
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> 	- Rebuild patch of eSDHC host need long time to generate
> 	 command interrupt
> 
>  drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c  
> b/drivers/mmc/host/sdhci-of-esdhc.c
> index 570bca8..30bfb5c 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -325,6 +325,12 @@ static void esdhc_of_platform_init(struct  
> sdhci_host *host)
> 
>  	if (vvn > VENDOR_V_22)
>  		host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
> +
> +	if ((SVR_SOC_VER(svr) == SVR_B4860) ||
> +		(SVR_SOC_VER(svr) == SVR_P5020) ||
> +		(SVR_SOC_VER(svr) == SVR_P5040) ||
> +		(SVR_SOC_VER(svr) == SVR_P4080))
> +		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>  }

Please don't line up the continuation lines of the if-condition with  
the if-body.

Please check variant SoCs as well.  If the bug exists on p4080, then it  
exists on p4040.  Likewise with p5040/p5021, and p5020/p5010.

Is it present on all revisions of these SoCs?  How about p3041, which  
is usually pretty similar to p5020?  p2040/p2041?  Is there an erratum  
number for this problem?

-Scott
Scott Wood - July 19, 2013, 5:24 p.m.
On 07/18/2013 09:19:59 PM, Zhang Haijun-B42677 wrote:
> 
> 
> Thanks.
> 
> Regards
> Haijun.
> 
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, July 18, 2013 1:14 AM
> > To: Zhang Haijun-B42677
> > Cc: linux-mmc@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> > cbouatmailru@gmail.com; cjb@laptop.org; Fleming Andy-AFLEMING; Zhang
> > Haijun-B42677; Zhang Haijun-B42677
> > Subject: Re: [PATCH 4/4 V2] mmc: esdhc: Add broken timeout quirk for
> > p4/p5 board
> >
> > On 07/17/2013 05:11:31 AM, Haijun Zhang wrote:
> > > Sometimes command can't be completed within the time give in
> > > eSDHC_SYSCTL[DTOCV]. So just give the max value 0x14 to avoid this
> > > issue.
> > >
> > > Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> > > ---
> > > changes for v2:
> > > 	- Rebuild patch of eSDHC host need long time to generate
> > > 	 command interrupt
> > >
> > >  drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
> > > b/drivers/mmc/host/sdhci-of-esdhc.c
> > > index 570bca8..30bfb5c 100644
> > > --- a/drivers/mmc/host/sdhci-of-esdhc.c
> > > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> > > @@ -325,6 +325,12 @@ static void esdhc_of_platform_init(struct
> > > sdhci_host *host)
> > >
> > >  	if (vvn > VENDOR_V_22)
> > >  		host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
> > > +
> > > +	if ((SVR_SOC_VER(svr) == SVR_B4860) ||
> > > +		(SVR_SOC_VER(svr) == SVR_P5020) ||
> > > +		(SVR_SOC_VER(svr) == SVR_P5040) ||
> > > +		(SVR_SOC_VER(svr) == SVR_P4080))
> > > +		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
> > >  }
> >
> > Please don't line up the continuation lines of the if-condition  
> with the
> > if-body.
> [Haijun Wrote:] I'll correct it.
> >
> > Please check variant SoCs as well.  If the bug exists on p4080,  
> then it
> > exists on p4040.  Likewise with p5040/p5021, and p5020/p5010.
> >
> > Is it present on all revisions of these SoCs?  How about p3041,  
> which is
> > usually pretty similar to p5020?  p2040/p2041?  Is there an erratum
> > number for this problem?
> >
> [Haijun Wrote:] I only checked this on these boards.

These aren't boards; they're chips.

Please find out for sure which chips are affected, or else we'll have  
support issues later when someone is using a chip you didn't test  
with.  And always include the fewer-core variants -- if p4080 is  
affected, then p4040 is affected, and so on as described above.

> No errata number yet,

Will one be coming?

> This quirk only give the host max detecting time value to check  
> card's response. No
> impact on performance or other functions.

Does this affect boot time if a card is not present?

-Scott

Patch

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 570bca8..30bfb5c 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -325,6 +325,12 @@  static void esdhc_of_platform_init(struct sdhci_host *host)
 
 	if (vvn > VENDOR_V_22)
 		host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
+
+	if ((SVR_SOC_VER(svr) == SVR_B4860) ||
+		(SVR_SOC_VER(svr) == SVR_P5020) ||
+		(SVR_SOC_VER(svr) == SVR_P5040) ||
+		(SVR_SOC_VER(svr) == SVR_P4080))
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 }
 
 static int esdhc_pltfm_bus_width(struct sdhci_host *host, int width)