Thread (10 messages) flat view 10 messages, 1 author, 2012-12-10
STALE5016d

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v1 [diff vs current]
  3. v2 [diff vs current]

[PATCH 1/9] memory: emif: Correct the lpmode timeout calculation

From: Lokesh Vutla <hidden>
Date: 2012-12-10 07:09:10
Also in: linux-omap
Subsystem: arm/texas instrument aemif/emif drivers, memory controller drivers, the rest · Maintainers: Santosh Shilimkar, Krzysztof Kozlowski, Linus Torvalds

The driver tries to round up the specified timeout cycles to
next power of 2 value. But this is done wrongly.
Correcting this here.

Signed-off-by: Lokesh Vutla <redacted>
---
 drivers/memory/emif.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 06d31c9..8589aba 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -731,9 +731,9 @@ static u32 get_pwr_mgmt_ctrl(u32 freq, struct emif_data *emif, u32 ip_rev)
 	if (timeout < 16) {
 		timeout = 0;
 	} else {
-		timeout = __fls(timeout) - 3;
 		if (timeout & (timeout - 1))
-			timeout++;
+			timeout <<= 1;
+		timeout = __fls(timeout) - 3;
 	}
 
 	switch (lpmode) {
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help