diff options
author | Preeti U Murthy <preeti@linux.vnet.ibm.com> | 2014-02-07 03:06:32 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-02-07 09:34:29 -0500 |
commit | 5d1638acb9f62fa7eb0c07cb85318bbe1f13b227 (patch) | |
tree | e6f6bf80186f74b021b1a236bd583b8227e5b7e1 /include/linux/clockchips.h | |
parent | ba8f20c2eb4158a443e9d6a909aee5010efa0c69 (diff) |
tick: Introduce hrtimer based broadcast
On some architectures, in certain CPU deep idle states the local timers stop.
An external clock device is used to wakeup these CPUs. The kernel support for the
wakeup of these CPUs is provided by the tick broadcast framework by using the
external clock device as the wakeup source.
However not all implementations of architectures provide such an external
clock device. This patch includes support in the broadcast framework to handle
the wakeup of the CPUs in deep idle states on such systems by queuing a hrtimer
on one of the CPUs, which is meant to handle the wakeup of CPUs in deep idle states.
This patchset introduces a pseudo clock device which can be registered by the
archs as tick_broadcast_device in the absence of a real external clock
device. Once registered, the broadcast framework will work as is for these
architectures as long as the archs take care of the BROADCAST_ENTER
notification failing for one of the CPUs. This CPU is made the stand by CPU to
handle wakeup of the CPUs in deep idle and it *must not enter deep idle states*.
The CPU with the earliest wakeup is chosen to be this CPU. Hence this way the
stand by CPU dynamically moves around and so does the hrtimer which is queued
to trigger at the next earliest wakeup time. This is consistent with the case where
an external clock device is present. The smp affinity of this clock device is
set to the CPU with the earliest wakeup. This patchset handles the hotplug of
the stand by CPU as well by moving the hrtimer on to the CPU handling the CPU_DEAD
notification.
Originally-from: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: deepthi@linux.vnet.ibm.com
Cc: paulmck@linux.vnet.ibm.com
Cc: fweisbec@gmail.com
Cc: paulus@samba.org
Cc: srivatsa.bhat@linux.vnet.ibm.com
Cc: svaidy@linux.vnet.ibm.com
Cc: peterz@infradead.org
Cc: benh@kernel.crashing.org
Cc: rafael.j.wysocki@intel.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140207080632.17187.80532.stgit@preeti.in.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/clockchips.h')
-rw-r--r-- | include/linux/clockchips.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index e0c5a6c418de..dbe9e1457168 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -62,6 +62,11 @@ enum clock_event_mode { | |||
62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 | 62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 |
63 | #define CLOCK_EVT_FEAT_PERCPU 0x000040 | 63 | #define CLOCK_EVT_FEAT_PERCPU 0x000040 |
64 | 64 | ||
65 | /* | ||
66 | * Clockevent device is based on a hrtimer for broadcast | ||
67 | */ | ||
68 | #define CLOCK_EVT_FEAT_HRTIMER 0x000080 | ||
69 | |||
65 | /** | 70 | /** |
66 | * struct clock_event_device - clock event device descriptor | 71 | * struct clock_event_device - clock event device descriptor |
67 | * @event_handler: Assigned by the framework to be called by the low | 72 | * @event_handler: Assigned by the framework to be called by the low |
@@ -83,6 +88,7 @@ enum clock_event_mode { | |||
83 | * @name: ptr to clock event name | 88 | * @name: ptr to clock event name |
84 | * @rating: variable to rate clock event devices | 89 | * @rating: variable to rate clock event devices |
85 | * @irq: IRQ number (only for non CPU local devices) | 90 | * @irq: IRQ number (only for non CPU local devices) |
91 | * @bound_on: Bound on CPU | ||
86 | * @cpumask: cpumask to indicate for which CPUs this device works | 92 | * @cpumask: cpumask to indicate for which CPUs this device works |
87 | * @list: list head for the management code | 93 | * @list: list head for the management code |
88 | * @owner: module reference | 94 | * @owner: module reference |
@@ -113,6 +119,7 @@ struct clock_event_device { | |||
113 | const char *name; | 119 | const char *name; |
114 | int rating; | 120 | int rating; |
115 | int irq; | 121 | int irq; |
122 | int bound_on; | ||
116 | const struct cpumask *cpumask; | 123 | const struct cpumask *cpumask; |
117 | struct list_head list; | 124 | struct list_head list; |
118 | struct module *owner; | 125 | struct module *owner; |
@@ -180,9 +187,11 @@ extern int tick_receive_broadcast(void); | |||
180 | #endif | 187 | #endif |
181 | 188 | ||
182 | #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) | 189 | #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) |
190 | extern void tick_setup_hrtimer_broadcast(void); | ||
183 | extern int tick_check_broadcast_expired(void); | 191 | extern int tick_check_broadcast_expired(void); |
184 | #else | 192 | #else |
185 | static inline int tick_check_broadcast_expired(void) { return 0; } | 193 | static inline int tick_check_broadcast_expired(void) { return 0; } |
194 | static void tick_setup_hrtimer_broadcast(void) {}; | ||
186 | #endif | 195 | #endif |
187 | 196 | ||
188 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 197 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |