mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
PM: runtime: Update runtime_pm.rst for non-fatal resume errors
Since commiteef1d74bf8("PM: runtime: Only set runtime_error on suspend callback failures"), rpm_callback() no longer sets dev->power.runtime_error when ->runtime_resume() returns an error. However, Documentation/power/runtime_pm.rst still states in both the resume callback rules and the ->runtime_idle() comparison that the PM core treats ->runtime_resume() errors as fatal device errors and blocks runtime PM helper functions until the status is manually reset. Update the resume callback semantics bullet to state that on error the PM core resets the runtime PM status to 'suspended', returns the error code from synchronous resume helpers, and unlike with the suspend callback never treats resume failures as fatal, leaving the Section 4 runtime PM helpers unblocked so a subsequent resume request can run ->runtime_resume() again. Also drop ->runtime_resume() from the ->runtime_idle() fatal-error comparison. Fixes:eef1d74bf8("PM: runtime: Only set runtime_error on suspend callback failures") Fixes:aedc51762a("PM: runtime: Clarify ->runtime_idle() callback return value handling") Signed-off-by: Stanley Jhu <[email protected]> Reviewed-by: Brian Norris <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> [ rjw: Adjustment of the resume callback errors bullet point ] Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
bd56424ce8
commit
7a93f7e30a
@@ -222,11 +222,12 @@ what to do to handle the device).
|
||||
I/O operations as needed. The runtime PM status of the device is then
|
||||
'active'.
|
||||
|
||||
* If the resume callback returns an error code, the PM core regards this as a
|
||||
fatal error and will refuse to run the helper functions described in
|
||||
`Section 4`_ for the device, until its status is directly set to either
|
||||
'active', or 'suspended' (by means of special helper functions provided by
|
||||
the PM core for this purpose).
|
||||
* If the resume callback returns an error code, the PM core sets the
|
||||
device's runtime PM status back to 'suspended' and returns the error
|
||||
code from synchronous resume helpers. Unlike most suspend callback
|
||||
errors, failures in the resume callback are never considered fatal,
|
||||
so the helper functions described in `Section 4`_ are not blocked and
|
||||
a subsequent resume request can run the resume callback again.
|
||||
|
||||
The idle callback (a subsystem-level one, if present, or the driver one) is
|
||||
executed by the PM core whenever the device appears to be idle, which is
|
||||
@@ -250,9 +251,9 @@ call to pm_runtime_autosuspend().
|
||||
To prevent this suspension (for example, if the callback routine has scheduled
|
||||
a delayed suspend or determined the device cannot be idle), the routine must
|
||||
return a non-zero value (typically -EBUSY or -EAGAIN). Unlike
|
||||
->runtime_suspend() and ->runtime_resume(), the PM core does not treat negative
|
||||
return codes from ->runtime_idle() as a fatal device error; any non-zero value
|
||||
simply stops the PM core from suspending the device.
|
||||
->runtime_suspend(), the PM core does not treat negative return codes from
|
||||
->runtime_idle() as a fatal device error, and any non-zero value simply stops
|
||||
the PM core from suspending the device.
|
||||
|
||||
Core Guarantees and Synchronization Rules
|
||||
-----------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user