Patchwork mmc: sdhci-pltfm: Fix timeout on t4240's sdhci controller

login
register
mail settings
Submitter Chunhe Lan
Date March 7, 2013, 8:05 a.m.
Message ID <1362643535-2377-1-git-send-email-Chunhe.Lan@freescale.com>
Download mbox | patch
Permalink /patch/225756/
State Not Applicable
Headers show

Comments

Chunhe Lan - March 7, 2013, 8:05 a.m.
This patch fixes timeout problems on t4240's sdhci controller:

	mmc0: Too large timeout requested for CMD25!
	mmc0: Too large timeout requested for CMD25!
	mmc0: Too large timeout requested for CMD25!

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
---
 drivers/mmc/host/sdhci-pltfm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Gala Kumar-B11780 - March 7, 2013, 4:30 p.m.
On Mar 7, 2013, at 2:05 AM, Chunhe Lan wrote:

> This patch fixes timeout problems on t4240's sdhci controller:
> 
> 	mmc0: Too large timeout requested for CMD25!
> 	mmc0: Too large timeout requested for CMD25!
> 	mmc0: Too large timeout requested for CMD25!
> 
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> ---
> drivers/mmc/host/sdhci-pltfm.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index 3145a78..9db7b12 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -94,6 +94,7 @@ void sdhci_get_of_property(struct platform_device *pdev)
> 
> 		if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
> 		    of_device_is_compatible(np, "fsl,p1010-esdhc") ||
> +		    of_device_is_compatible(np, "fsl,t4240-esdhc") ||
> 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
> 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
> 
> -- 
> 1.7.6.5
> 


Why does this occur?  Is it a board issue?  Is it a silicon issue?  Is it due to some erratum?  Why T4 only?

- k
Lan Chunhe-B25806 - March 8, 2013, 2:57 a.m.
On 03/08/2013 12:30 AM, Gala Kumar-B11780 wrote:
> On Mar 7, 2013, at 2:05 AM, Chunhe Lan wrote:
>
>> This patch fixes timeout problems on t4240's sdhci controller:
>>
>> 	mmc0: Too large timeout requested for CMD25!
>> 	mmc0: Too large timeout requested for CMD25!
>> 	mmc0: Too large timeout requested for CMD25!
>>
>> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
>> ---
>> drivers/mmc/host/sdhci-pltfm.c |    1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
>> index 3145a78..9db7b12 100644
>> --- a/drivers/mmc/host/sdhci-pltfm.c
>> +++ b/drivers/mmc/host/sdhci-pltfm.c
>> @@ -94,6 +94,7 @@ void sdhci_get_of_property(struct platform_device *pdev)
>>
>> 		if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
>> 		    of_device_is_compatible(np, "fsl,p1010-esdhc") ||
>> +		    of_device_is_compatible(np, "fsl,t4240-esdhc") ||
>> 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
>> 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>>
>> -- 
>> 1.7.6.5
>>
>
> Why does this occur?  Is it a board issue?  Is it a silicon issue?  Is it due to some erratum?  Why T4 only?
      It would be the property of T4 hardware, and please see below the 
patch which locates
      the mail list of freescale:

eSDHC: mmc:host host need long time to generate command complete interrupt

According to Spec 2.0, command complete interrupt will generate within 
150 SD-CLK.
But this was not enough on T4240 board. So give it sufficient time to 
detect command
timeout. 1000 * HZ will be enough, this value was test on all T4 board, 
all worked well.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>

Thanks,
Chunhe
>
> - k
Gala Kumar-B11780 - March 8, 2013, 8:43 p.m.
On Mar 7, 2013, at 8:57 PM, Chunhe Lan wrote:

> On 03/08/2013 12:30 AM, Gala Kumar-B11780 wrote:
>> On Mar 7, 2013, at 2:05 AM, Chunhe Lan wrote:
>> 
>>> This patch fixes timeout problems on t4240's sdhci controller:
>>> 
>>> 	mmc0: Too large timeout requested for CMD25!
>>> 	mmc0: Too large timeout requested for CMD25!
>>> 	mmc0: Too large timeout requested for CMD25!
>>> 
>>> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
>>> ---
>>> drivers/mmc/host/sdhci-pltfm.c |    1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>> 
>>> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
>>> index 3145a78..9db7b12 100644
>>> --- a/drivers/mmc/host/sdhci-pltfm.c
>>> +++ b/drivers/mmc/host/sdhci-pltfm.c
>>> @@ -94,6 +94,7 @@ void sdhci_get_of_property(struct platform_device *pdev)
>>> 
>>> 		if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
>>> 		    of_device_is_compatible(np, "fsl,p1010-esdhc") ||
>>> +		    of_device_is_compatible(np, "fsl,t4240-esdhc") ||
>>> 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
>>> 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>>> 
>>> -- 
>>> 1.7.6.5
>>> 
>> 
>> Why does this occur?  Is it a board issue?  Is it a silicon issue?  Is it due to some erratum?  Why T4 only?
>     It would be the property of T4 hardware, and please see below the patch which locates
>     the mail list of freescale:
> 
> eSDHC: mmc:host host need long time to generate command complete interrupt
> 
> According to Spec 2.0, command complete interrupt will generate within 150 SD-CLK.
> But this was not enough on T4240 board. So give it sufficient time to detect command
> timeout. 1000 * HZ will be enough, this value was test on all T4 board, all worked well.
> 
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>

I still don't understand the explanation of the issue on T4.  Why doesn't P4080, P5020, etc suffer from the issue?

- k

Patch

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 3145a78..9db7b12 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -94,6 +94,7 @@  void sdhci_get_of_property(struct platform_device *pdev)
 
 		if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
 		    of_device_is_compatible(np, "fsl,p1010-esdhc") ||
+		    of_device_is_compatible(np, "fsl,t4240-esdhc") ||
 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;