All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST
@ 2015-06-25 10:27 Sudeep Holla
  2015-06-25 13:55 ` Thomas Gleixner
  0 siblings, 1 reply; 15+ messages in thread
From: Sudeep Holla @ 2015-06-25 10:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sudeep Holla, Suzuki Poulose, Lorenzo Pieralisi, Catalin Marinas,
	Rafael J. Wysocki, Thomas Gleixner, Preeti U Murthy

tick_broadcast_enter returns 0 when CPU can switch to broadcast
timer and non-zero otherwise. However when GENERIC_CLOCKEVENTS_BROADCAST
and TICK_ONESHOT are disabled, tick_broadcast_oneshot_control returns 0
which indicates to the CPUIdle framework that the CPU can enter deeper
idle states even when the CPU local timer will be shutdown. If the
target state needs broadcast but not broadcast timer is available, then
the CPU can not resume back from that idle state.

This patch returns error when there's no broadcast timer support
available so that CPUIdle framework prevents the CPU from entering any
idle states losing the local timer.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-and-Tested-by: Suzuki Poulose <Suzuki.Poulose@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 include/linux/tick.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 3741ba1a652c..0624968a0bcc 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -70,7 +70,10 @@ static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { }
 #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
 extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state);
 #else
-static inline int tick_broadcast_oneshot_control(enum tick_broadcast_state state) { return 0; }
+static inline int tick_broadcast_oneshot_control(enum tick_broadcast_state state)
+{
+	return -ENODEV;
+}
 #endif
 
 static inline void tick_broadcast_enable(void)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-07-01  9:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 10:27 [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST Sudeep Holla
2015-06-25 13:55 ` Thomas Gleixner
2015-06-25 15:30   ` Sudeep Holla
2015-06-26  5:08     ` Preeti U Murthy
2015-06-26  7:47       ` Thomas Gleixner
2015-06-26 11:25         ` Preeti U Murthy
2015-06-26 11:50           ` Thomas Gleixner
2015-06-26 12:37             ` Preeti U Murthy
2015-06-26 12:34         ` Preeti U Murthy
2015-06-26 12:38           ` Thomas Gleixner
2015-06-26 12:46             ` Preeti U Murthy
2015-07-01  9:08             ` Thomas Gleixner
2015-06-26 12:58           ` Sudeep Holla
2015-06-26  8:38       ` Sudeep Holla
2015-06-26  4:59   ` Preeti U Murthy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.