msm: timer: compensate for timer shift in msm_read_timer_count
Subsystems (3)
PATCH 1/1 msm: timer: compensate for timer shift in msm_read_timer_count
Some msm targets have timers whose lower bits are unreliable. So, we present our timers as lower frequency than they actually are, and ignore the bottom 5 bits on such targets. This compensation was erroneously removed from the msm_read_timer_count function, so restore it.
This was broken by 94790ec25 "msm: timer: SMP timer support for msm".
--- arch/arm/mach-msm/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-msm/timer.c +1 -1
@@ -100,7 +100,7 @@ static cycle_t msm_read_timer_count(struct clocksource *cs) { struct msm_clock *clk = container_of(cs, struct msm_clock, clocksource); -return readl (clk->global_counter); +return readl (clk->global_counter) >> clk->shift; }static struct msm_clock *clockevent_to_clock (struct clock_event_device *evt)
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Quoted 8 lines · Jeff Ohlstein
Some msm targets have timers whose lower bits are unreliable. So, we present our timers as lower frequency than they actually are, and ignore the bottom 5 bits on such targets. This compensation was erroneously removed from the
msm_read_timer_countfunction, so restore it.This was broken by
94790ec25"msm: timer: SMP timer support for msm".Change-Id: I8c56bdf82629638748ccf352118ea664f967b87d
Drop this Change-ID ..
Quoted 10 lines
Signed-off-by Jeff Ohlstein <[email protected]>--- arch/arm/mach-msm/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-msm/timer.c +0
-0
arch/arm/mach-msm/timer.c static cycle_t msm_read_timer_count(struct clocksource *cs) · line 104
Quoted 6 lines
arch/arm/mach-msm/timer.c +1
-1@@ -100,7 +100,7 @@ static cycle_t msm_read_timer_count(struct clocksource *cs) { struct msm_clock *clk = container_of(cs, struct msm_clock, clocksource); -return readl (clk->global_counter); +return readl (clk->global_counter) >> clk->shift; }
Could you comment in the code with something explaining what the shift is doing.
Daniel
Quoted 8 lines · Daniel Walker
Quoted 8 lines
arch/arm/mach-msm/timer.c +0
-0@@ -100,7 +100,7 @@ static cycle_t msm_read_timer_count(struct clocksource *cs) { struct msm_clock *clk = container_of(cs, struct msm_clock, clocksource);
Quoted 6 lines
arch/arm/mach-msm/timer.c static cycle_t msm_read_timer_count(struct clocksource *cs) · line 104
Quoted 3 lines
arch/arm/mach-msm/timer.c +1
-1-return readl (clk->global_counter); +return readl (clk->global_counter) >> clk->shift; }Could you comment in the code with something explaining what the shift is doing.
Probably best to describe this near msm_clock's definition (or MSM_DGT_SHIFT), since it is a bit unclear what these values are. A good (but short) description of how the shifts and even why.
The comment shouldn't be in the function body (CodingStyle, chapter 8).
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.