diff options
-rw-r--r-- | arch/arm/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/arm/kernel/time.c | 10 | ||||
-rw-r--r-- | include/asm-arm/mach/time.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 8f146a4b4752..bbea636ff687 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
33 | #include <asm/processor.h> | 33 | #include <asm/processor.h> |
34 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
35 | #include <asm/mach/time.h> | ||
35 | 36 | ||
36 | extern const char *processor_modes[]; | 37 | extern const char *processor_modes[]; |
37 | extern void setup_mm_for_reboot(char mode); | 38 | extern void setup_mm_for_reboot(char mode); |
@@ -85,8 +86,10 @@ EXPORT_SYMBOL(pm_power_off); | |||
85 | void default_idle(void) | 86 | void default_idle(void) |
86 | { | 87 | { |
87 | local_irq_disable(); | 88 | local_irq_disable(); |
88 | if (!need_resched() && !hlt_counter) | 89 | if (!need_resched() && !hlt_counter) { |
90 | timer_dyn_reprogram(); | ||
89 | arch_idle(); | 91 | arch_idle(); |
92 | } | ||
90 | local_irq_enable(); | 93 | local_irq_enable(); |
91 | } | 94 | } |
92 | 95 | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 06054c9ba074..1b7fcd50c3e2 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -424,15 +424,19 @@ static int timer_dyn_tick_disable(void) | |||
424 | return ret; | 424 | return ret; |
425 | } | 425 | } |
426 | 426 | ||
427 | /* | ||
428 | * Reprogram the system timer for at least the calculated time interval. | ||
429 | * This function should be called from the idle thread with IRQs disabled, | ||
430 | * immediately before sleeping. | ||
431 | */ | ||
427 | void timer_dyn_reprogram(void) | 432 | void timer_dyn_reprogram(void) |
428 | { | 433 | { |
429 | struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; | 434 | struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; |
430 | unsigned long flags; | ||
431 | 435 | ||
432 | write_seqlock_irqsave(&xtime_lock, flags); | 436 | write_seqlock(&xtime_lock); |
433 | if (dyn_tick->state & DYN_TICK_ENABLED) | 437 | if (dyn_tick->state & DYN_TICK_ENABLED) |
434 | dyn_tick->reprogram(next_timer_interrupt() - jiffies); | 438 | dyn_tick->reprogram(next_timer_interrupt() - jiffies); |
435 | write_sequnlock_irqrestore(&xtime_lock, flags); | 439 | write_sequnlock(&xtime_lock); |
436 | } | 440 | } |
437 | 441 | ||
438 | static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) | 442 | static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) |
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h index 047980ad18d1..2cf279a44017 100644 --- a/include/asm-arm/mach/time.h +++ b/include/asm-arm/mach/time.h | |||
@@ -60,6 +60,8 @@ struct dyn_tick_timer { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | void timer_dyn_reprogram(void); | 62 | void timer_dyn_reprogram(void); |
63 | #else | ||
64 | #define timer_dyn_reprogram() do { } while (0) | ||
63 | #endif | 65 | #endif |
64 | 66 | ||
65 | extern struct sys_timer *system_timer; | 67 | extern struct sys_timer *system_timer; |