kernel_samsung_a53x/drivers/base/power
Douglas Anderson fd3d89c364 PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
[ Upstream commit b4060db9251f919506e4d672737c6b8ab9a84701 ]

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-11-18 12:13:40 +01:00
..
clock_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
domain.c pmdomain: core: Move the unused cleanup to a _sync initcall 2024-11-18 12:13:33 +01:00
domain_governor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
generic_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.c PM: sleep: Fix error handling in dpm_prepare() 2024-11-18 12:13:23 +01:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
power.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qos-test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
runtime.c PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() 2024-11-18 12:13:40 +01:00
sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wakeirq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wakeup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wakeup_stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00