PM: runtime: Drop runtime PM references to supplier on link removal
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 21 Oct 2020 19:12:15 +0000 (21:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Nov 2020 17:14:07 +0000 (18:14 +0100)
commite0e398e204634db8fb71bd89cf2f6e3e5bd09b51
tree249a53f4da79da8a867bcbf33f71df644e9e72c1
parent3cea11cd5e3b00d91caf0b4730194039b45c5891
PM: runtime: Drop runtime PM references to supplier on link removal

While removing a device link, drop the supplier device's runtime PM
usage counter as many times as needed to drop all of the runtime PM
references to it from the consumer in addition to dropping the
consumer's link count.

Fixes: baa8809f6097 ("PM / runtime: Optimize the use of device links")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 5.1+ <stable@vger.kernel.org> # 5.1+
Tested-by: Xiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c
drivers/base/power/runtime.c
include/linux/pm_runtime.h