linux-stable/kernel/power
Dan Williams 9ea4dcf498 PM: CXL: Disable suspend
The CXL specification claims S3 support at a hardware level, but at a
system software level there are some missing pieces. Section 9.4 (CXL
2.0) rightly claims that "CXL mem adapters may need aux power to retain
memory context across S3", but there is no enumeration mechanism for the
OS to determine if a given adapter has that support. Moreover the save
state and resume image for the system may inadvertantly end up in a CXL
device that needs to be restored before the save state is recoverable.
I.e. a circular dependency that is not resolvable without a third party
save-area.

Arrange for the cxl_mem driver to fail S3 attempts. This still nominaly
allows for suspend, but requires unbinding all CXL memory devices before
the suspend to ensure the typical DRAM flow is taken. The cxl_mem unbind
flow is intended to also tear down all CXL memory regions associated
with a given cxl_memdev.

It is reasonable to assume that any device participating in a System RAM
range published in the EFI memory map is covered by aux power and
save-area outside the device itself. So this restriction can be
minimized in the future once pre-existing region enumeration support
arrives, and perhaps a spec update to clarify if the EFI memory map is
sufficent for determining the range of devices managed by
platform-firmware for S3 support.

Per Rafael, if the CXL configuration prevents suspend then it should
fail early before tasks are frozen, and mem_sleep should stop showing
'mem' as an option [1]. Effectively CXL augments the platform suspend
->valid() op since, for example, the ACPI ops are not aware of the CXL /
PCI dependencies. Given the split role of platform firmware vs OS
provisioned CXL memory it is up to the cxl_mem driver to determine if
the CXL configuration has elements that platform firmware may not be
prepared to restore.

Link: https://lore.kernel.org/r/CAJZ5v0hGVN_=3iU8OLpHY3Ak35T5+JcBM-qs8SbojKrpd0VXsA@mail.gmail.com [1]
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <len.brown@intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/165066828317.3907920.5690432272182042556.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2022-04-22 16:09:42 -07:00
..
autosleep.c PM: sleep: fix typos in comments 2021-04-08 19:37:21 +02:00
console.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
energy_model.c PM: EM: Mark inefficiencies in CPUFreq 2021-10-05 16:33:05 +02:00
hibernate.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00
Kconfig PM: sleep: remove trailing spaces and tabs 2021-06-11 18:49:09 +02:00
main.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00
Makefile PM: hibernate: Split off snapshot dev option 2020-05-19 17:48:08 +02:00
power.h PM: hibernate: Allow ACPI hardware signature to be honoured 2021-12-08 16:06:10 +01:00
poweroff.c kernel/power: constify sysrq_key_op 2020-05-15 14:53:20 +02:00
process.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-07 21:02:31 +01:00
qos.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
snapshot.c PM: hibernate: Remove register_nosave_region_late() 2022-01-25 18:34:08 +01:00
suspend.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00
suspend_test.c PM: suspend: fix return value of __setup handler 2022-03-01 18:55:07 +01:00
swap.c for-5.18/block-2022-03-18 2022-03-21 16:48:55 -07:00
user.c PM: hibernate: Fix snapshot partial write lengths 2021-11-24 13:50:18 +01:00
wakelock.c PM: wakeup: simplify the output logic of pm_show_wakelocks() 2022-01-25 18:27:02 +01:00