* [PATCH] sdhci: Increase timeout for internal clock stabilization.
@ 2009-09-18 22:15 Chris Ball
2009-09-19 20:41 ` Pierre Ossman
0 siblings, 1 reply; 2+ messages in thread
From: Chris Ball @ 2009-09-18 22:15 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mmc, HaraldWelte, Pierre Ossman, Deepak Saxena
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.
Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Harald Welte <HaraldWelte@viatech.com>
---
drivers/mmc/host/sdhci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fc96f8c..00ab7b3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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) {
--
1.6.4
--
Chris Ball <cjb@laptop.org>
One Laptop Per Child
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] sdhci: Increase timeout for internal clock stabilization.
2009-09-18 22:15 [PATCH] sdhci: Increase timeout for internal clock stabilization Chris Ball
@ 2009-09-19 20:41 ` Pierre Ossman
0 siblings, 0 replies; 2+ messages in thread
From: Pierre Ossman @ 2009-09-19 20:41 UTC (permalink / raw)
To: Chris Ball; +Cc: Andrew Morton, linux-mmc, HaraldWelte, Deepak Saxena
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
On Fri, 18 Sep 2009 18:15:56 -0400
Chris Ball <cjb@laptop.org> 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.
>
> Signed-off-by: Chris Ball <cjb@laptop.org>
> Cc: Harald Welte <HaraldWelte@viatech.com>
> ---
Seems reasonable enough to me. The initial limit was completely
arbitrary anyway.
Acked-by: Pierre Ossman <pierre@ossman.eu>
Rgds
--
-- 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-19 20:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18 22:15 [PATCH] sdhci: Increase timeout for internal clock stabilization Chris Ball
2009-09-19 20:41 ` Pierre Ossman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox