mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] clockevents: leave the broadcast device in shutdown mode when not needed
@ 2011-11-05  0:18 Suresh Siddha
  2012-02-15 19:36 ` [tip:timers/core] clockevents: Leave " tip-bot for Suresh Siddha
  0 siblings, 1 reply; 2+ messages in thread
From: Suresh Siddha @ 2011-11-05  0:18 UTC (permalink / raw)
  To: Thomas Gleixner, H Peter Anvin, Ingo Molnar, john stultz, venki
  Cc: linux-kernel

Platforms with Always Running APIC Timer doesn't use the broadcast timer
but the kernel is leaving the broadcast timer (HPET in this case)
in oneshot mode.

On these platforms, before the switch to oneshot mode, broadcast device is
actually in shutdown mode. Code checks for empty tick_broadcast_mask and
avoids going into the periodic mode.

During switch to oneshot mode, add the same tick_broadcast_mask checks in the
tick_broadcast_switch_to_oneshot() and avoid the broadcast device going into
the oneshot mode.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 kernel/time/tick-broadcast.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index f954282..73a0ade 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -575,11 +575,15 @@ void tick_broadcast_switch_to_oneshot(void)
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
+	if (cpumask_empty(tick_get_broadcast_mask()))
+		goto end;
 
 	tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
 	bc = tick_broadcast_device.evtdev;
 	if (bc)
 		tick_broadcast_setup_oneshot(bc);
+
+end:
 	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 }
 



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

* [tip:timers/core] clockevents: Leave the broadcast device in shutdown mode when not needed
  2011-11-05  0:18 [patch] clockevents: leave the broadcast device in shutdown mode when not needed Suresh Siddha
@ 2012-02-15 19:36 ` tip-bot for Suresh Siddha
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Suresh Siddha @ 2012-02-15 19:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, johnstul, suresh.b.siddha, tglx

Commit-ID:  77b0d60c5adf39c74039e2142a1d3cd1e4d53799
Gitweb:     http://git.kernel.org/tip/77b0d60c5adf39c74039e2142a1d3cd1e4d53799
Author:     Suresh Siddha <suresh.b.siddha@intel.com>
AuthorDate: Fri, 4 Nov 2011 17:18:21 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 15 Feb 2012 15:23:09 +0100

clockevents: Leave the broadcast device in shutdown mode when not needed

Platforms with Always Running APIC Timer doesn't use the broadcast timer
but the kernel is leaving the broadcast timer (HPET in this case)
in oneshot mode.

On these platforms, before the switch to oneshot mode, broadcast device is
actually in shutdown mode. Code checks for empty tick_broadcast_mask and
avoids going into the periodic mode.

During switch to oneshot mode, add the same tick_broadcast_mask checks in the
tick_broadcast_switch_to_oneshot() and avoid the broadcast device going into
the oneshot mode.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: john stultz <johnstul@us.ibm.com>
Cc: venki@google.com
Link: http://lkml.kernel.org/r/1320452301.15071.16.camel@sbsiddha-desk.sc.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/tick-broadcast.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index fd4a7b1..e883f57 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -575,11 +575,15 @@ void tick_broadcast_switch_to_oneshot(void)
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
+	if (cpumask_empty(tick_get_broadcast_mask()))
+		goto end;
 
 	tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
 	bc = tick_broadcast_device.evtdev;
 	if (bc)
 		tick_broadcast_setup_oneshot(bc);
+
+end:
 	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 }
 

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

end of thread, other threads:[~2012-02-15 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-05  0:18 [patch] clockevents: leave the broadcast device in shutdown mode when not needed Suresh Siddha
2012-02-15 19:36 ` [tip:timers/core] clockevents: Leave " tip-bot for Suresh Siddha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome