WSL2-Linux-Kernel/drivers/base
Douglas Anderson c7a0fa3a66 PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
[ Upstream commit b4060db925 ]

The PM Runtime docs say:

  Drivers in ->remove() callback should undo the runtime PM changes done
  in ->probe(). Usually this means calling pm_runtime_disable(),
  pm_runtime_dont_use_autosuspend() etc.

>From grepping code, it's clear that many people aren't aware of the
need to call pm_runtime_dont_use_autosuspend().

When brainstorming solutions, one idea that came up was to leverage
the new-ish devm_pm_runtime_enable() function. The idea here is that:

 * When the devm action is called we know that the driver is being
   removed. It's the perfect time to undo the use_autosuspend.

 * The code of pm_runtime_dont_use_autosuspend() already handles the
   case of being called when autosuspend wasn't enabled.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 3d07a411b4fa ("drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks")
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 08:55:15 +01:00
..
firmware_loader firmware_loader: use kernel credentials when reading firmware 2022-05-18 10:26:53 +02:00
power PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() 2024-02-23 08:55:15 +01:00
regmap regmap: fix bogus error on regcache_sync success 2023-12-13 18:36:44 +01:00
test driver core: test_async: fix an error code 2023-09-19 12:22:45 +02:00
Kconfig RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
Makefile devres: Enable trace events 2021-06-15 17:14:36 +02:00
arch_numa.c arm64: irq: set the correct node for VMAP stack 2024-02-23 08:54:36 +01:00
arch_topology.c arm64: topology: move store_cpu_topology() to shared code 2022-10-26 12:34:22 +02:00
attribute_container.c driver core: attribute_container: fix W=1 warnings 2021-05-14 13:37:10 +02:00
auxiliary.c Merge 5.14-rc3 into driver-core-next 2021-07-27 09:22:08 +02:00
base.h software nodes: Split software_node_notify() 2021-07-16 19:17:05 +02:00
bus.c driver: base: fix UAF when driver_attach failed 2022-06-14 18:36:09 +02:00
cacheinfo.c cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() 2021-07-21 17:29:40 +02:00
class.c class: fix possible memory leak in __class_register() 2022-12-31 13:14:27 +01:00
component.c drivers: base: component: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:38 +01:00
container.c
core.c driver core: fix resource leak in device_add() 2023-03-10 09:39:38 +01:00
cpu.c x86/srso: Add a Speculative RAS Overflow mitigation 2023-08-08 19:58:34 +02:00
dd.c driver core: Release all resources during unbind before updating device links 2023-11-28 16:56:36 +00:00
devcoredump.c devcoredump: Send uevent once devcd is ready 2023-12-13 18:36:50 +01:00
devres.c devres: Enable trace events 2021-06-15 17:14:36 +02:00
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:13:13 +01:00
driver.c driver: platform: Add helper for safer setting of driver_override 2023-11-08 17:26:43 +01:00
firmware.c
hypervisor.c
init.c init: Initialize noop_backing_dev_info early 2022-06-22 14:22:02 +02:00
isa.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
map.c driver: base: Prefer unsigned int to bare use of unsigned 2021-07-21 17:30:09 +02:00
memory.c mm/hwpoison: avoid the impact of hwpoison_filter() return value on mce handler 2022-07-12 16:35:05 +02:00
module.c
node.c drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist 2022-08-31 17:16:35 +02:00
pinctrl.c
platform-msi.c platform-msi: Add ABI to show msi_irqs of platform devices 2021-08-24 09:16:20 +02:00
platform.c driver: platform: Add helper for safer setting of driver_override 2023-11-08 17:26:43 +01:00
property.c device property: Allow const parameter to dev_fwnode() 2024-01-05 15:13:40 +01:00
soc.c soc: fix comment for freeing soc_dev_attr 2020-12-09 19:46:31 +01:00
swnode.c software node: Let args be NULL in software_node_get_reference_args 2024-01-25 14:52:51 -08:00
syscore.c
topology.c drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist 2022-08-31 17:16:35 +02:00
trace.c devres: Enable trace events 2021-06-15 17:14:36 +02:00
trace.h devres: Enable trace events 2021-06-15 17:14:36 +02:00
transport_class.c drivers: base: transport_class: fix resource leak when transport_add_device() fails 2023-03-10 09:39:39 +01:00