[PATCH] PM: runtime: Use pmruntime sync variant to put suppliers

From: Stanimir Varbanov
Date: Tue Oct 06 2020 - 20:20:13 EST


Calling pm_runtime_put_sync over a device with suppliers with device
link flags PM_RUNTIME | RPM_ACTIVE it is observed that the supplier
is not put (turned off) at the end, but instead put asynchronously.
In some case This could lead to issues for the callers which expects
that the pmruntime sync variants should also put the suppliers
synchronously.

Also the opposite rpm_get_suppliers is already using pmruntime _sync
variant of the API.

Correct this by changing pmruntime_put to pmruntime_put_sync in
rpm_put_suppliers.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@xxxxxxxxxx>
---
drivers/base/power/runtime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 6f605f7820bb..8dab4fcab4e8 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -313,7 +313,7 @@ static void rpm_put_suppliers(struct device *dev)
device_links_read_lock_held()) {

while (refcount_dec_not_one(&link->rpm_active))
- pm_runtime_put(link->supplier);
+ pm_runtime_put_sync(link->supplier);
}
}

--
2.17.1