PM: runtime: Fix ordering in pm_runtime_get_suppliers()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 26 Mar 2021 10:56:18 +0000 (12:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 13:00:10 +0000 (15:00 +0200)
commitcc038ab785a836677bfae8756e24e1e9ace00632
tree52ed5e6e9bd8cdf5463daa59531d4558a9b812bf
parentda2976cd711b2e895ddc44f6975290762d7d08c9
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>
drivers/base/power/runtime.c