Files
Linux/include/linux
Douglas Anderson b4060db925 PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
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 <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2022-03-04 18:26:54 +01:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-22 08:33:34 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-15 08:47:31 -08:00
…
…
2022-01-09 10:36:51 -07:00
…
…
…
…
…
…
…
…
2021-11-12 10:19:09 -08:00
…
…
…
…
…
…
…
2021-11-17 10:36:15 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-12-10 17:10:55 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-12-10 12:51:28 +01:00
…
…
…
…
…
2021-12-01 00:06:43 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-15 08:47:31 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-20 08:52:54 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-04 13:15:33 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-12-17 09:06:15 +01:00
…
…
…
2021-12-20 09:03:05 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-12-16 22:22:20 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
2022-02-09 09:24:40 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-12 10:14:09 -06:00
…
…
…
…
…
…
…
…
2021-11-16 19:07:53 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-22 08:33:37 +02:00
…
2022-01-08 12:43:57 -06:00
…
…
…
…
…
…
…
…
…
2021-11-18 09:36:39 +01:00
…
2022-01-24 14:45:02 +01:00
…
…
…
…
…
2021-11-30 17:25:20 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-01-22 08:33:37 +02:00
…
…
…
…
…
…
…
…
…
2022-01-22 08:33:38 +02:00
…
…
2021-11-16 13:10:34 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-11-25 18:35:23 +01:00
…
…
…
…
…
…
…
…
…
…
2021-12-30 12:13:04 +01:00
…
…
…
…
…
…
…
…
…
2022-01-14 18:50:52 -05:00
…
…
…
…
…
…
…
…
…
2021-12-09 10:49:56 -08:00
…
…
2022-01-08 00:28:41 -05:00
…
…
…
…
…
…
…
…
…