Skip to content

Commit

Permalink
PM / Runtime: Merge synchronous and async runtime routines
Browse files Browse the repository at this point in the history
This patch (as1423) merges the asynchronous routines
__pm_request_idle(), __pm_request_suspend(), and __pm_request_resume()
with their synchronous counterparts.  The RPM_ASYNC bitflag argument
serves to indicate what sort of operation to perform.

In the course of performing this merger, it became apparent that the
various functions don't all behave consistenly with regard to error
reporting and cancellation of outstanding requests.  A new routine,
rpm_check_suspend_allowed(), was written to centralize much of the
testing, and the other functions were revised to follow a simple
algorithm:

	If the operation is disallowed because of the device's
	settings or current state, return an error.

	Cancel pending or scheduled requests of lower priority.

	Schedule, queue, or perform the desired operation.

A few special cases and exceptions are noted in comments.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Alan Stern authored and Rafael J. Wysocki committed Oct 16, 2010
1 parent 3f9af05 commit 1bfee5b
Showing 1 changed file with 140 additions and 235 deletions.
Loading

0 comments on commit 1bfee5b

Please sign in to comment.