aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-11-03 18:39:18 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 12:36:57 -0500
commit8dc9c7911421d8e45901ffaf483b5dca99cbb055 (patch)
tree70de5dd4f12c46cb2406e8eeeee1fea3f3a6b986 /Documentation/power
parent2d92f691cd1a1be5cdefb10d559fdd7443d4df7a (diff)
PM / Runtime: Automatically retry failed autosuspends
commit 886486b792e4f6f96d4fbe8ec5bf20811cab7d6a upstream. Originally, the runtime PM core would send an idle notification whenever a suspend attempt failed. The idle callback routine could then schedule a delayed suspend for some time later. However this behavior was changed by commit f71648d73c1650b8b4aceb3856bebbde6daa3b86 (PM / Runtime: Remove idle notification after failing suspend). No notifications were sent, and there was no clear mechanism to retry failed suspends. This caused problems for the usbhid driver, because it fails autosuspend attempts as long as a key is being held down. Therefore this patch (as1492) adds a mechanism for retrying failed autosuspends. If the callback routine updates the last_busy field so that the next autosuspend expiration time is in the future, the autosuspend will automatically be rescheduled. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/runtime_pm.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index b24875b1ced..6ade987ecb6 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -708,6 +708,16 @@ will behave normally, not taking the autosuspend delay into account.
708Similarly, if the power.use_autosuspend field isn't set then the autosuspend 708Similarly, if the power.use_autosuspend field isn't set then the autosuspend
709helper functions will behave just like the non-autosuspend counterparts. 709helper functions will behave just like the non-autosuspend counterparts.
710 710
711Under some circumstances a driver or subsystem may want to prevent a device
712from autosuspending immediately, even though the usage counter is zero and the
713autosuspend delay time has expired. If the ->runtime_suspend() callback
714returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is
715in the future (as it normally would be if the callback invoked
716pm_runtime_mark_last_busy()), the PM core will automatically reschedule the
717autosuspend. The ->runtime_suspend() callback can't do this rescheduling
718itself because no suspend requests of any kind are accepted while the device is
719suspending (i.e., while the callback is running).
720
711The implementation is well suited for asynchronous use in interrupt contexts. 721The implementation is well suited for asynchronous use in interrupt contexts.
712However such use inevitably involves races, because the PM core can't 722However such use inevitably involves races, because the PM core can't
713synchronize ->runtime_suspend() callbacks with the arrival of I/O requests. 723synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.