@@ -154,7 +154,7 @@ suspending the device are satisfied) and to queue up a suspend request for the
154154device in that case. If there is no idle callback, or if the callback returns
1551550, then the PM core will attempt to carry out a runtime suspend of the device,
156156also respecting devices configured for autosuspend. In essence this means a
157- call to pm_runtime_autosuspend () (do note that drivers needs to update the
157+ call to __pm_runtime_autosuspend () (do note that drivers needs to update the
158158device last busy mark, pm_runtime_mark_last_busy(), to control the delay under
159159this circumstance). To prevent this (for example, if the callback routine has
160160started a delayed suspend), the routine must return a non-zero value. Negative
@@ -396,10 +396,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
396396 nonzero, increment the counter and return 1; otherwise return 0 without
397397 changing the counter
398398
399- `int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count ); `
399+ `int pm_runtime_get_if_active(struct device *dev); `
400400 - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
401- runtime PM status is RPM_ACTIVE, and either ign_usage_count is true
402- or the device's usage_count is non-zero, increment the counter and
401+ runtime PM status is RPM_ACTIVE, increment the counter and
403402 return 1; otherwise return 0 without changing the counter
404403
405404 `void pm_runtime_put_noidle(struct device *dev); `
@@ -410,6 +409,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
410409 pm_request_idle(dev) and return its result
411410
412411 `int pm_runtime_put_autosuspend(struct device *dev); `
412+ - does the same as __pm_runtime_put_autosuspend() for now, but in the
413+ future, will also call pm_runtime_mark_last_busy() as well, DO NOT USE!
414+
415+ `int __pm_runtime_put_autosuspend(struct device *dev); `
413416 - decrement the device's usage counter; if the result is 0 then run
414417 pm_request_autosuspend(dev) and return its result
415418
@@ -540,6 +543,7 @@ It is safe to execute the following helper functions from interrupt context:
540543- pm_runtime_put_noidle()
541544- pm_runtime_put()
542545- pm_runtime_put_autosuspend()
546+ - __pm_runtime_put_autosuspend()
543547- pm_runtime_enable()
544548- pm_suspend_ignore_children()
545549- pm_runtime_set_active()
@@ -730,6 +734,7 @@ out the following operations:
730734 for it, respectively.
731735
7327367. Generic subsystem callbacks
737+ ==============================
733738
734739Subsystems may wish to conserve code space by using the set of generic power
735740management callbacks provided by the PM core, defined in
@@ -865,9 +870,9 @@ automatically be delayed until the desired period of inactivity has elapsed.
865870
866871Inactivity is determined based on the power.last_busy field. Drivers should
867872call pm_runtime_mark_last_busy() to update this field after carrying out I/O,
868- typically just before calling pm_runtime_put_autosuspend (). The desired length
869- of the inactivity period is a matter of policy. Subsystems can set this length
870- initially by calling pm_runtime_set_autosuspend_delay(), but after device
873+ typically just before calling __pm_runtime_put_autosuspend (). The desired
874+ length of the inactivity period is a matter of policy. Subsystems can set this
875+ length initially by calling pm_runtime_set_autosuspend_delay(), but after device
871876registration the length should be controlled by user space, using the
872877/sys/devices/.../power/autosuspend_delay_ms attribute.
873878
@@ -878,7 +883,7 @@ instead of the non-autosuspend counterparts::
878883
879884 Instead of: pm_runtime_suspend use: pm_runtime_autosuspend;
880885 Instead of: pm_schedule_suspend use: pm_request_autosuspend;
881- Instead of: pm_runtime_put use: pm_runtime_put_autosuspend ;
886+ Instead of: pm_runtime_put use: __pm_runtime_put_autosuspend ;
882887 Instead of: pm_runtime_put_sync use: pm_runtime_put_sync_autosuspend.
883888
884889Drivers may also continue to use the non-autosuspend helper functions; they
@@ -917,7 +922,7 @@ Here is a schematic pseudo-code example::
917922 lock(&foo->private_lock);
918923 if (--foo->num_pending_requests == 0) {
919924 pm_runtime_mark_last_busy(&foo->dev);
920- pm_runtime_put_autosuspend (&foo->dev);
925+ __pm_runtime_put_autosuspend (&foo->dev);
921926 } else {
922927 foo_process_next_request(foo);
923928 }
0 commit comments