From: Lucas Stach <l.stach@pengutronix.de>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Pavel Machek <pavel@ucw.cz>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
patchwork-lst@pengutronix.de
Subject: [PATCH 2/2] PM / Runtime: use deferrable timer for autosuspend
Date: Tue, 12 Jan 2016 18:17:20 +0100 [thread overview]
Message-ID: <1452619040-27137-2-git-send-email-l.stach@pengutronix.de> (raw)
In-Reply-To: <1452619040-27137-1-git-send-email-l.stach@pengutronix.de>
The timeouts used in PM autosuspend are relatively coarse (the shortest
I could find in a quick search through the kernel is 50ms). As they are
already handled relaxed by saving the overhead of always rearming the
timer by opportunistically suspending a device a bit early, it should
not matter if the the timeout is missed slightly.
By using a deferrable timer the CPU will not be woken just to handle
the autosuspend timeout, but handling will be batched with other
wakeups in the system.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
drivers/base/power/runtime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index e1a10a03df8e..975a282600ff 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1383,7 +1383,7 @@ void pm_runtime_init(struct device *dev)
INIT_WORK(&dev->power.work, pm_runtime_work);
dev->power.timer_expires = 0;
- setup_timer(&dev->power.suspend_timer, pm_suspend_timer_fn,
+ setup_deferrable_timer(&dev->power.suspend_timer, pm_suspend_timer_fn,
(unsigned long)dev);
init_waitqueue_head(&dev->power.wait_queue);
--
2.6.4
next prev parent reply other threads:[~2016-01-12 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 17:17 [PATCH 1/2] timer: add setup_deferrable_timer macro Lucas Stach
2016-01-12 17:17 ` Lucas Stach [this message]
2016-01-13 19:02 ` [PATCH 2/2] PM / Runtime: use deferrable timer for autosuspend Pavel Machek
2016-01-19 0:28 ` Rafael J. Wysocki
2016-01-26 17:23 ` [PATCH 1/2] timer: add setup_deferrable_timer macro Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452619040-27137-2-git-send-email-l.stach@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=patchwork-lst@pengutronix.de \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).