sdhci: Increase timeout for internal clock stabilization.
PATCH 1/1 sdhci: Increase timeout for internal clock stabilization.
On an OLPC XO-1.5 development board with Via VX855 chipset, the sdhci controller can take up to 12ms to stabilize its clock, but the current timeout at which we give up on the controller is 10ms.
The patch increases the timeout delay rather than using a device-specific quirk -- since we exit the loop when the clock comes up, increasing the timeout value will only make us mdelay() longer in the errant case of a device with a clock that is not stabilizing, which it seems worth waiting a little longer for in general.
--- drivers/mmc/host/sdhci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
@@ -991,8 +991,8 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) clk |=SDHCI_CLOCK_INT_EN ;sdhci_writew (host, clk,SDHCI_CLOCK_CONTROL ); -/* Wait max 10 ms */ - timeout =10 ; +/* Wait max 20 ms */ + timeout =20 ;while (!((clk =sdhci_readw (host,SDHCI_CLOCK_CONTROL )) &SDHCI_CLOCK_INT_STABLE )) {if (timeout ==0 ) {
Signature · 5 lines
1.6.4 -- Chris Ball <[email protected]> One Laptop Per Child
Quoted 10 lines · On Fri, 18 Sep 2009 18:15:56 -0400 Chris Ball <[email protected]> wrote:
On an OLPC XO-1.5 development board with Via VX855 chipset, the sdhci controller can take up to 12ms to stabilize its clock, but the current timeout at which we give up on the controller is 10ms.
The patch increases the timeout delay rather than using a device-specific quirk -- since we exit the loop when the clock comes up, increasing the timeout value will only make us
mdelay()longer in the errant case of a device with a clock that is not stabilizing, which it seems worth waiting a little longer for in general.
Quoted 3 lines
Signed-off-by Chris Ball <[email protected]>Cc Harald Welte <[email protected]>---
Seems reasonable enough to me. The initial limit was completely arbitrary anyway.
Rgds
Signature · 6 lines
-- Pierre Ossman WARNING: This correspondence is being monitored by the Swedish government. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption.