Skip to contentSkip to conversation

mmc: sdhci: Change timeout of loop for checking internal clock stable

PATCH Superseded Ben Chuang 2 participants 2 messages Aug 20, 2019 – Aug 21, 2019

Subsystems (2)

v5 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Ben Chuang

author
#0 lore raw

PATCH v5 1/4 mmc: sdhci: Change timeout of loop for checking internal clock stable

From: Ben Chuang <[email protected]>

According to section 3.2.1 internal clock setup in SD Host Controller Simplified Specifications 4.20, the timeout of loop for checking internal clock stable is defined as 150ms.

---
 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
index 59acf8e3331e..bed0760a6c2a 100644
@@ -1636,8 +1636,8 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk)
 	clk |= SDHCI_CLOCK_INT_EN;
 	sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
 
-	/* Wait max 20 ms */
-	timeout = ktime_add_ms(ktime_get(), 20);
+	/* Wait max 150 ms */
+	timeout = ktime_add_ms(ktime_get(), 150);
 	while (1) {
 		bool timedout = ktime_after(ktime_get(), timeout);
 
Signature · 1 line
2.22.1
maintainer Acked-by on v5 1/4
#1 lore raw
Quoted 9 lines · Ben Chuang

From: Ben Chuang <[email protected]>

According to section 3.2.1 internal clock setup in SD Host Controller Simplified Specifications 4.20, the timeout of loop for checking internal clock stable is defined as 150ms.

Quoted 20 lines
---
 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
index 59acf8e3331e..bed0760a6c2a 100644
@@ -1636,8 +1636,8 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk)
 	clk |= SDHCI_CLOCK_INT_EN;
 	sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
 
-	/* Wait max 20 ms */
-	timeout = ktime_add_ms(ktime_get(), 20);
+	/* Wait max 150 ms */
+	timeout = ktime_add_ms(ktime_get(), 150);
 	while (1) {
 		bool timedout = ktime_after(ktime_get(), timeout);