diff options
author | Haijun.Zhang <haijun.zhang@freescale.com> | 2013-03-22 06:40:58 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-03-27 23:29:39 (GMT) |
commit | 5ec0b35b09e7e5748d473fbba6169ab5bc92e61d (patch) | |
tree | 9a746af2b9b3c91e36ca7bd572fad37f2f4f8916 /drivers | |
parent | 7b49dde0fbf317a40d33b6baddfa59b06911a769 (diff) | |
download | linux-fsl-qoriq-5ec0b35b09e7e5748d473fbba6169ab5bc92e61d.tar.xz |
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>
Change-Id: I29dea7f334214894e8486d574770328c94ae3b16
Reviewed-on: http://git.am.freescale.net:8181/570
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci-pltfm.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 22b2e02..2eaf7a4 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -90,8 +90,10 @@ void sdhci_get_of_property(struct platform_device *pdev) of_device_is_compatible(np, "fsl,mpc8536-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; - if (of_device_is_compatible(np, "fsl,t4240-esdhc")) + if (of_device_is_compatible(np, "fsl,t4240-esdhc")) { host->quirks2 |= SDHCI_QUIRK2_BROKEN_RESET_ALL; + host->quirks2 |= SDHCI_QUIRK2_LONG_TIME_CMD_COMPLETE_IRQ; + } if (of_device_is_compatible(np, "fsl,p4860-rev1-esdhc") || of_device_is_compatible(np, "fsl,p1010-esdhc") || diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0ca30b4..170eee3 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -973,6 +973,7 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) int flags; u32 mask; unsigned long timeout; + int timer = 10; WARN_ON(host->cmd); @@ -1001,7 +1002,13 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) mdelay(1); } - mod_timer(&host->timer, jiffies + 10 * HZ); + /* In case some controller need long time to generate command + * interrupt, 1000 * HZ will be enough. + */ + if (host->quirks2 & SDHCI_QUIRK2_LONG_TIME_CMD_COMPLETE_IRQ) + timer = 1000; + + mod_timer(&host->timer, jiffies + timer * HZ); host->cmd = cmd; |