linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: TWD: fix the clock calculation for TWD
@ 2011-01-20  6:33 Chao Xie
  2011-01-20 14:08 ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Chao Xie @ 2011-01-20  6:33 UTC (permalink / raw)
  To: linux-arm-kernel

The original code will do count * (HZ /5). It will make the twd
timer rate decreased if HZ can not be excatly divided. For
example HZ=128.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
 arch/arm/kernel/smp_twd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..ca6405b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -111,7 +111,8 @@ static void __cpuinit twd_calibrate_rate(void)
 
 		count = __raw_readl(twd_base + TWD_TIMER_COUNTER);
 
-		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
+		twd_timer_rate = ((unsigned long)(0xFFFFFFFFU - count))
+			* HZ / 5;
 
 		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
 			(twd_timer_rate / 100000) % 100);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-24  1:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20  6:33 [PATCH] ARM: TWD: fix the clock calculation for TWD Chao Xie
2011-01-20 14:08 ` Russell King - ARM Linux
2011-01-20 14:44   ` Jamie Iles
2011-01-20 16:38     ` Russell King - ARM Linux
2011-01-20 18:10       ` Jamie Iles
2011-01-24  1:35         ` Chao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).