mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clockevents: don't suspend/resume if unused
@ 2015-01-16  9:05 Alexandre Belloni
  2015-01-16  9:20 ` Sylvain Rochet
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Alexandre Belloni @ 2015-01-16  9:05 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Daniel Lezcano, Nicolas Ferre, Boris Brezillon, Maxime Ripard,
	sylvain.rochet, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

There is no point in calling suspend/resume for unused
clockevents as they are already stopped and disabled.

Furthermore, it can take some time to wait for some IPs to stop counting.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reported-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
---
 kernel/time/clockevents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 55449909f114..0eff982c1c11 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -525,7 +525,7 @@ void clockevents_suspend(void)
 	struct clock_event_device *dev;
 
 	list_for_each_entry_reverse(dev, &clockevent_devices, list)
-		if (dev->suspend)
+		if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED)
 			dev->suspend(dev);
 }
 
@@ -537,7 +537,7 @@ void clockevents_resume(void)
 	struct clock_event_device *dev;
 
 	list_for_each_entry(dev, &clockevent_devices, list)
-		if (dev->resume)
+		if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED)
 			dev->resume(dev);
 }
 
-- 
2.1.0


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

end of thread, other threads:[~2015-05-26 23:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16  9:05 [PATCH] clockevents: don't suspend/resume if unused Alexandre Belloni
2015-01-16  9:20 ` Sylvain Rochet
2015-01-16 11:17   ` Russell King - ARM Linux
2015-01-16 11:20     ` Russell King - ARM Linux
2015-01-16 16:59   ` Alexandre Belloni
2015-03-06 12:54     ` Alexandre Belloni
2015-05-25 16:19     ` Alexandre Belloni
2015-05-25 16:56     ` Thomas Gleixner
2015-05-25 18:48 ` Thomas Gleixner
2015-05-25 19:06   ` Sylvain Rochet
2015-05-25 20:11     ` Thomas Gleixner
2015-05-25 20:53       ` Sylvain Rochet
2015-05-26 23:07 ` [tip:timers/core] clockevents: Do not " tip-bot for Alexandre Belloni

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