blob: db6b933095f5eeb276759409c1b0d92654c9a875 [file] [log] [blame]
From 9875e01a633d878cb016cff8a349da2a090b4720 Mon Sep 17 00:00:00 2001
From: Simon Horman <horms@verge.net.au>
Date: Sat, 21 Apr 2012 02:09:00 +0900
Subject: Revert "PM / Runtime: Automatically retry failed autosuspends"
This reverts commit 8dc9c7911421d8e45901ffaf483b5dca99cbb055.
The origin of this change, 886486b792e4f6f96d4fbe8ec5bf20811cab7d6a,
will be included in a fuller backport of PM which follows.
The reason for reverting this is to avoid conflicts when
backporting other PM fixes to the same file.
---
Documentation/power/runtime_pm.txt | 10 ----------
drivers/base/power/runtime.c | 18 ++----------------
2 files changed, 2 insertions(+), 26 deletions(-)
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -708,16 +708,6 @@ will behave normally, not taking the aut
Similarly, if the power.use_autosuspend field isn't set then the autosuspend
helper functions will behave just like the non-autosuspend counterparts.
-Under some circumstances a driver or subsystem may want to prevent a device
-from autosuspending immediately, even though the usage counter is zero and the
-autosuspend delay time has expired. If the ->runtime_suspend() callback
-returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is
-in the future (as it normally would be if the callback invoked
-pm_runtime_mark_last_busy()), the PM core will automatically reschedule the
-autosuspend. The ->runtime_suspend() callback can't do this rescheduling
-itself because no suspend requests of any kind are accepted while the device is
-suspending (i.e., while the callback is running).
-
The implementation is well suited for asynchronous use in interrupt contexts.
However such use inevitably involves races, because the PM core can't
synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -278,9 +278,6 @@ static int rpm_callback(int (*cb)(struct
* If a deferred resume was requested while the callback was running then carry
* it out; otherwise send an idle notification for the device (if the suspend
* failed) or for its parent (if the suspend succeeded).
- * If ->runtime_suspend failed with -EAGAIN or -EBUSY, and if the RPM_AUTO
- * flag is set and the next autosuspend-delay expiration time is in the
- * future, schedule another autosuspend attempt.
*
* This function must be called under dev->power.lock with interrupts disabled.
*/
@@ -391,21 +388,10 @@ static int rpm_suspend(struct device *de
if (retval) {
__update_runtime_status(dev, RPM_ACTIVE);
dev->power.deferred_resume = 0;
- if (retval == -EAGAIN || retval == -EBUSY) {
+ if (retval == -EAGAIN || retval == -EBUSY)
dev->power.runtime_error = 0;
-
- /*
- * If the callback routine failed an autosuspend, and
- * if the last_busy time has been updated so that there
- * is a new autosuspend expiration time, automatically
- * reschedule another autosuspend.
- */
- if ((rpmflags & RPM_AUTO) &&
- pm_runtime_autosuspend_expiration(dev) != 0)
- goto repeat;
- } else {
+ else
pm_runtime_cancel_pending(dev);
- }
} else {
no_callback:
__update_runtime_status(dev, RPM_SUSPENDED);