Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362183
b: refs/heads/master
c: 6f3d90e
h: refs/heads/master
i:
  362181: 13ddb6f
  362179: 047d674
  362175: a7c7ebf
v: v3
  • Loading branch information
Will Deacon authored and Russell King committed Apr 3, 2013
1 parent e4d8ef1 commit 87ea6f9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93dc68876b608da041fe40ed39424b0fcd5aa2fb
refs/heads/master: 6f3d90e55660ba42301b5e9c7eed332cc9f70fd7
2 changes: 1 addition & 1 deletion trunk/arch/arm/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern struct arm_delay_ops {
void (*delay)(unsigned long);
void (*const_udelay)(unsigned long);
void (*udelay)(unsigned long);
bool const_clock;
unsigned long ticks_per_jiffy;
} arm_delay_ops;

#define __delay(n) arm_delay_ops.delay(n)
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@ static int cpufreq_callback(struct notifier_block *nb,
if (freq->flags & CPUFREQ_CONST_LOOPS)
return NOTIFY_OK;

if (arm_delay_ops.const_clock)
return NOTIFY_OK;

if (!per_cpu(l_p_j_ref, cpu)) {
per_cpu(l_p_j_ref, cpu) =
per_cpu(cpu_data, cpu).loops_per_jiffy;
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/arm/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void __timer_delay(unsigned long cycles)
static void __timer_const_udelay(unsigned long xloops)
{
unsigned long long loops = xloops;
loops *= loops_per_jiffy;
loops *= arm_delay_ops.ticks_per_jiffy;
__timer_delay(loops >> UDELAY_SHIFT);
}

Expand All @@ -73,11 +73,13 @@ void __init register_current_timer_delay(const struct delay_timer *timer)
pr_info("Switching to timer-based delay loop\n");
delay_timer = timer;
lpj_fine = timer->freq / HZ;
loops_per_jiffy = lpj_fine;

/* cpufreq may scale loops_per_jiffy, so keep a private copy */
arm_delay_ops.ticks_per_jiffy = lpj_fine;
arm_delay_ops.delay = __timer_delay;
arm_delay_ops.const_udelay = __timer_const_udelay;
arm_delay_ops.udelay = __timer_udelay;
arm_delay_ops.const_clock = true;

delay_calibrated = true;
} else {
pr_info("Ignoring duplicate/late registration of read_current_timer delay\n");
Expand Down

0 comments on commit 87ea6f9

Please sign in to comment.