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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
From: Russell King - ARM Linux <hidden> Date: 2011-01-20 14:08:11
On Thu, Jan 20, 2011 at 02:33:57PM +0800, Chao Xie wrote:
quoted hunk
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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
On Thu, Jan 20, 2011 at 02:08:11PM +0000, Russell King - ARM Linux wrote:
On Thu, Jan 20, 2011 at 02:33:57PM +0800, Chao Xie wrote:
quoted
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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
I don't think this patch has any effect what so ever, so I just tried:
#define HZ 128
unsigned long twd_timer_rate;
void calc1(unsigned long count)
{
twd_timer_rate = (0xffffffffU - count) * (HZ / 5);
}
void calc2(unsigned long count)
{
twd_timer_rate = ((unsigned long)(0xffffffffU - count)) * (HZ / 5);
}
Hi Russell,
In Chao's patch the parentheses around (HZ / 5) have been removed so its
now dowing the multiplication before the division (if I remember the
precedences correctly!). I don't think the cast to unsigned long is
needed though.
Jamie
From: Russell King - ARM Linux <hidden> Date: 2011-01-20 16:38:36
On Thu, Jan 20, 2011 at 02:44:09PM +0000, Jamie Iles wrote:
On Thu, Jan 20, 2011 at 02:08:11PM +0000, Russell King - ARM Linux wrote:
quoted
On Thu, Jan 20, 2011 at 02:33:57PM +0800, Chao Xie wrote:
quoted
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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
I don't think this patch has any effect what so ever, so I just tried:
#define HZ 128
unsigned long twd_timer_rate;
void calc1(unsigned long count)
{
twd_timer_rate = (0xffffffffU - count) * (HZ / 5);
}
void calc2(unsigned long count)
{
twd_timer_rate = ((unsigned long)(0xffffffffU - count)) * (HZ / 5);
}
Hi Russell,
In Chao's patch the parentheses around (HZ / 5) have been removed so its
now dowing the multiplication before the division (if I remember the
precedences correctly!). I don't think the cast to unsigned long is
needed though.
Hmm. That means the maximum twd timer rate we can support is about
860MHz. Is that enough?
On Thu, Jan 20, 2011 at 04:38:36PM +0000, Russell King - ARM Linux wrote:
On Thu, Jan 20, 2011 at 02:44:09PM +0000, Jamie Iles wrote:
quoted
On Thu, Jan 20, 2011 at 02:08:11PM +0000, Russell King - ARM Linux wrote:
quoted
On Thu, Jan 20, 2011 at 02:33:57PM +0800, Chao Xie wrote:
quoted
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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
I don't think this patch has any effect what so ever, so I just tried:
#define HZ 128
unsigned long twd_timer_rate;
void calc1(unsigned long count)
{
twd_timer_rate = (0xffffffffU - count) * (HZ / 5);
}
void calc2(unsigned long count)
{
twd_timer_rate = ((unsigned long)(0xffffffffU - count)) * (HZ / 5);
}
Hi Russell,
In Chao's patch the parentheses around (HZ / 5) have been removed so its
now dowing the multiplication before the division (if I remember the
precedences correctly!). I don't think the cast to unsigned long is
needed though.
Hmm. That means the maximum twd timer rate we can support is about
860MHz. Is that enough?
I'm not familiar with any ARM SMP systems so I wouldn't like to commit
to that! If the answer is no, then I guess could we do something like
the (untested in a kernel) patch below to get a few more bits and we
should then be able to support rates of up to ~4294MHz.
Jamie
8<----
@@ -89,6 +89,8 @@ static void __cpuinit twd_calibrate_rate(void)*thetimerticks*/if(twd_timer_rate==0){+u64rate64;+printk(KERN_INFO"Calibrating local timer... ");/* Wait for a tick to start */
Your patch is better. 64bit is enough, I think.
-----Original Message-----
From: Jamie Iles [mailto:jamie at jamieiles.com]
Sent: Friday, January 21, 2011 2:11 AM
To: Russell King - ARM Linux
Cc: Jamie Iles; Chao Xie; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] ARM: TWD: fix the clock calculation for TWD
On Thu, Jan 20, 2011 at 04:38:36PM +0000, Russell King - ARM Linux wrote:
On Thu, Jan 20, 2011 at 02:44:09PM +0000, Jamie Iles wrote:
quoted
On Thu, Jan 20, 2011 at 02:08:11PM +0000, Russell King - ARM Linux wrote:
quoted
On Thu, Jan 20, 2011 at 02:33:57PM +0800, Chao Xie wrote:
quoted
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 <redacted>
---
arch/arm/kernel/smp_twd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
I don't think this patch has any effect what so ever, so I just tried:
#define HZ 128
unsigned long twd_timer_rate;
void calc1(unsigned long count)
{
twd_timer_rate = (0xffffffffU - count) * (HZ / 5);
}
void calc2(unsigned long count)
{
twd_timer_rate = ((unsigned long)(0xffffffffU - count)) * (HZ / 5);
}
Hi Russell,
In Chao's patch the parentheses around (HZ / 5) have been removed so its
now dowing the multiplication before the division (if I remember the
precedences correctly!). I don't think the cast to unsigned long is
needed though.
Hmm. That means the maximum twd timer rate we can support is about
860MHz. Is that enough?
I'm not familiar with any ARM SMP systems so I wouldn't like to commit
to that! If the answer is no, then I guess could we do something like
the (untested in a kernel) patch below to get a few more bits and we
should then be able to support rates of up to ~4294MHz.
Jamie
8<----
@@ -89,6 +89,8 @@ static void __cpuinit twd_calibrate_rate(void)*thetimerticks*/if(twd_timer_rate==0){+u64rate64;+printk(KERN_INFO"Calibrating local timer... ");/* Wait for a tick to start */