linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / Runtime: honor device autosuspend in pm_generic_runtime_idle()
@ 2013-05-13 11:05 Mika Westerberg
  2013-05-13 11:50 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2013-05-13 11:05 UTC (permalink / raw)
  To: linux-pm
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Mika Westerberg, linux-kernel

If the device is using autosuspend we should honor that and call
pm_runtime_autosuspend() instead of pm_runtime_suspend(). Failing to do so
causes the device to be suspended immediately even though it expects to be
suspended only when the autosuspend delay is expired.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/base/power/generic_ops.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index bfd898b..19786ca 100644
--- a/drivers/base/power/generic_ops.c
+++ b/drivers/base/power/generic_ops.c
@@ -29,7 +29,10 @@ int pm_generic_runtime_idle(struct device *dev)
 			return ret;
 	}
 
-	pm_runtime_suspend(dev);
+	if (dev->power.use_autosuspend)
+		pm_runtime_autosuspend(dev);
+	else
+		pm_runtime_suspend(dev);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(pm_generic_runtime_idle);
-- 
1.7.10.4


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

end of thread, other threads:[~2013-05-29  8:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13 11:05 [PATCH] PM / Runtime: honor device autosuspend in pm_generic_runtime_idle() Mika Westerberg
2013-05-13 11:50 ` Rafael J. Wysocki
2013-05-28 12:53   ` Rafael J. Wysocki
2013-05-28 14:13     ` Alan Stern
2013-05-28 20:59       ` Rafael J. Wysocki
2013-05-29  8:23     ` Mika Westerberg

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).