Skip to content

PM / Sleep: Simplify generic system suspend callbacks

Rafael J. Wysocki lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v11 patch 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2PM / Sleep: Simplify generic system suspend callbacksdrivers/base/power/generic_ops.c+6 -180 replies
2/2PM / Sleep: Merge internal functions in generic_ops.cdrivers/base/power/generic_ops.c+11 -370 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH 0/2 v2] PM / Sleep: Simplify generic system suspend callbacks

Hi Everyone,

One more udate here.

I forgot about the comments in this patch:

Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

The pm_runtime_suspended() check in __pm_generic_call() doesn't really help and may cause problems to happen, because in some cases the system suspend callbacks need to be called even if the given device has been suspended by runtime PM. For example, if the device generally supports remote wakeup and is not enabled to wake up the system from sleep, it should be prevented from generating wakeup signals during system suspend and that has to be done by the suspend callbacks that the pm_runtime_suspended() check prevents from being executed.

Similarly, it may not be a good idea to unconditionally change the runtime PM status of the device to 'active' in __pm_generic_resume(), because the driver may want to leave the device in the 'suspended' state, depending on what happened to it before the system suspend and whether or not it is enabled to wake up the system.

Quoted 5 lines
Quoted 5 lines

For the above reasons, remove the pm_runtime_suspended() check from __pm_generic_call() and remove the code changing the device's runtime PM status from __pm_generic_resume().

so the updated one becomes [1/2] in the new series.

In addition to that I noticed that __pm_generic_call() and __pm_generic_resume() may be merged after [1/2], which is done by [2/2].

I regard these patches as 3.3 material, if there are no objections.

Thanks,
Rafael