summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2021-03-26 12:56:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 14:47:42 +0200
commit07b19a118d2fa32958b4439be3eb4425776e823d (patch)
tree41b458d9ec092d0e75c14416d9766c98d6b34ebb /drivers/base
parent72a667681cc4b0dafc248f5c0730a7e2ce3bc679 (diff)
PM: runtime: Fix ordering in pm_runtime_get_suppliers()
commit c0c33442f7203704aef345647e14c2fb86071001 upstream. rpm_active indicates how many times the supplier usage_count has been incremented. Consequently it must be updated after pm_runtime_get_sync() of the supplier, not before. Fixes: 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter imbalance") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: 5.1+ <stable@vger.kernel.org> # 5.1+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/runtime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index bbee25de7a08..94785083c018 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1663,8 +1663,8 @@ void pm_runtime_get_suppliers(struct device *dev)
device_links_read_lock_held())
if (link->flags & DL_FLAG_PM_RUNTIME) {
link->supplier_preactivated = true;
- refcount_inc(&link->rpm_active);
pm_runtime_get_sync(link->supplier);
+ refcount_inc(&link->rpm_active);
}
device_links_read_unlock(idx);