mirror-linux/drivers/base/power
Mario Limonciello 12ffc3b151 PM: Restrict swap use to later in the suspend sequence
Currently swap is restricted before drivers have had a chance to do
their prepare() PM callbacks. Restricting swap this early means that if
a driver needs to evict some content from memory into sawp in it's
prepare callback, it won't be able to.

On AMD dGPUs this can lead to failed suspends under memory pressure
situations as all VRAM must be evicted to system memory or swap.

Move the swap restriction to right after all devices have had a chance
to do the prepare() callback.  If there is any problem with the sequence,
restore swap in the appropriate dpm resume callbacks or error handling
paths.

Closes: https://github.com/ROCm/ROCK-Kernel-Driver/issues/174
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: Nat Wittstock <nat@fardog.io>
Tested-by: Lucian Langa <lucilanga@7pot.org>
Link: https://patch.msgid.link/20250613214413.4127087-1-superm1@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-06-26 20:39:34 +02:00
..
Makefile PM: domains: Move genpd and its governor to the pmdomain subsystem 2023-12-18 12:49:48 +01:00
clock_ops.c PM: clk: Remove unused pm_clk_remove() 2025-03-12 21:28:48 +01:00
common.c PM: domains: Support required OPPs in dev_pm_domain_attach_list() 2024-10-10 14:13:49 +02:00
generic_ops.c PM: sleep: Remove unused pm_generic_ wrappers 2025-03-12 21:02:50 +01:00
main.c PM: Restrict swap use to later in the suspend sequence 2025-06-26 20:39:34 +02:00
power.h PM: sleep: wakeirq: fix wake irq arming 2023-07-24 09:51:51 +02:00
qos-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
qos.c PM: QoS: Export dev_pm_qos_read_value 2024-10-25 10:17:37 -05:00
runtime.c PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn() 2025-05-16 22:05:43 +02:00
sysfs.c PM: sysfs: Move debug runtime PM attributes to runtime_attrs[] 2025-05-09 15:59:27 +02:00
trace.c rtc: Extend timeout for waiting for UIP to clear to 1s 2023-12-17 22:33:55 +01:00
wakeirq.c PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq() 2025-01-17 20:27:46 +01:00
wakeup.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
wakeup_stats.c PM: wakeup: Add missing wakeup source attribute relax_count 2025-05-09 15:41:34 +02:00