Skip to content

Commit a0504ae

Browse files
storulfrafaeljw
authored andcommitted
PM / runtime: Drop usage count for suppliers at device link removal
In the case consumer device is runtime resumed, while the link to the supplier is removed, the earlier call to pm_runtime_get_sync() made from rpm_get_suppliers() does not get properly balanced with a corresponding call to pm_runtime_put(). This leads to that suppliers remains to be runtime resumed forever, while they don't need to. Let's fix the behaviour by calling rpm_put_suppliers() when dropping a device link. Not that, since rpm_put_suppliers() checks the link->rpm_active flag, we can correctly avoid to call pm_runtime_put() in cases when we shouldn't. Reported-by: Todor Tomov <[email protected]> Fixes: 21d5c57 (PM / runtime: Use device links) Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1e83786 commit a0504ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/base/power/runtime.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,8 @@ void pm_runtime_new_link(struct device *dev)
15861586

15871587
void pm_runtime_drop_link(struct device *dev)
15881588
{
1589+
rpm_put_suppliers(dev);
1590+
15891591
spin_lock_irq(&dev->power.lock);
15901592
WARN_ON(dev->power.links_count == 0);
15911593
dev->power.links_count--;

0 commit comments

Comments
 (0)