···480480 `bool pm_runtime_status_suspended(struct device *dev);`481481 - return true if the device's runtime PM status is 'suspended'482482483483- `void pm_runtime_allow(struct device *dev);`484484- - set the power.runtime_auto flag for the device and decrease its usage485485- counter (used by the /sys/devices/.../power/control interface to486486- effectively allow the device to be power managed at run time)487487-488488- `void pm_runtime_forbid(struct device *dev);`489489- - unset the power.runtime_auto flag for the device and increase its usage490490- counter (used by the /sys/devices/.../power/control interface to491491- effectively prevent the device from being power managed at run time)492492-493483 `void pm_runtime_no_callbacks(struct device *dev);`494484 - set the power.no_callbacks flag for the device and remove the runtime495485 PM attributes from /sys/devices/.../power (or prevent them from being
+16-7
drivers/base/power/runtime.c
···9090 /*9191 * Because ktime_get_mono_fast_ns() is not monotonic during9292 * timekeeping updates, ensure that 'now' is after the last saved9393- * timesptamp.9393+ * timestamp.9494 */9595 if (now < last)9696 return;···217217 * resume/suspend callback of any one of its ancestors(or the218218 * block device itself), the deadlock may be triggered inside the219219 * memory allocation since it might not complete until the block220220- * device becomes active and the involed page I/O finishes. The220220+ * device becomes active and the involved page I/O finishes. The221221 * situation is pointed out first by Alan Stern. Network device222222 * are involved in iSCSI kind of situation.223223 *···12101210 *12111211 * Otherwise, if its runtime PM status is %RPM_ACTIVE and (1) @ign_usage_count12121212 * is set, or (2) @dev is not ignoring children and its active child count is12131213- * nonero, or (3) the runtime PM usage counter of @dev is not zero, increment12131213+ * nonzero, or (3) the runtime PM usage counter of @dev is not zero, increment12141214 * the usage counter of @dev and return 1.12151215 *12161216 * Otherwise, return 0 without changing the usage counter.···16641664 * pm_runtime_forbid - Block runtime PM of a device.16651665 * @dev: Device to handle.16661666 *16671667- * Increase the device's usage count and clear its power.runtime_auto flag,16681668- * so that it cannot be suspended at run time until pm_runtime_allow() is called16691669- * for it.16671667+ * Resume @dev if already suspended and block runtime suspend of @dev in such16681668+ * a way that it can be unblocked via the /sys/devices/.../power/control16691669+ * interface, or otherwise by calling pm_runtime_allow().16701670+ *16711671+ * Calling this function many times in a row has the same effect as calling it16721672+ * once.16701673 */16711674void pm_runtime_forbid(struct device *dev)16721675{···16901687 * pm_runtime_allow - Unblock runtime PM of a device.16911688 * @dev: Device to handle.16921689 *16931693- * Decrease the device's usage count and set its power.runtime_auto flag.16901690+ * Unblock runtime suspend of @dev after it has been blocked by16911691+ * pm_runtime_forbid() (for instance, if it has been blocked via the16921692+ * /sys/devices/.../power/control interface), check if @dev can be16931693+ * suspended and suspend it in that case.16941694+ *16951695+ * Calling this function many times in a row has the same effect as calling it16961696+ * once.16941697 */16951698void pm_runtime_allow(struct device *dev)16961699{