Skip to content

RFC acpi/x86: s2idle: Introduce and implement runtime standby ABI for ACPI s0ix platforms

Antheas Kapenekakis linux-acpi lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 38 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8Documentation: PM: Add documentation for Runtime Standby StatesDocumentation/ABI/testing/sysfs-power Documentation/admin-guide/pm/standby-states.rst Documentation/admin-guide/pm/system-wide.rst+121 -02 replies
2/8acpi/x86: s2idle: Rename LPS0 constants so they mirror their functiondrivers/acpi/x86/s2idle.c+27 -272 replies
3/8acpi/x86: s2idle: add runtime standby transition functioninclude/linux/suspend.h kernel/power/suspend.c+179 -02 replies
4/8acpi/x86: s2idle: add support for querying runtime standby state supportdrivers/acpi/x86/s2idle.c+35 -00 replies
5/8acpi/x86: s2idle: move DSM notifications to do_notification callbackdrivers/acpi/x86/s2idle.c+52 -350 replies
6/8acpi/x86: s2idle: implement turn on display DSM as resume notificationdrivers/acpi/x86/s2idle.c+18 -60 replies
7/8PM: hibernate: Enter s2idle sleep state before hibernationkernel/power/hibernate.c+27 -22 replies
8/8PM: standby: Add sysfs attribute for runtime standby transitionskernel/power/main.c kernel/power/power.h+85 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC v1 0/8] acpi/x86: s2idle: Introduce and implement runtime standby ABI for ACPI s0ix platforms

This series introduces a new runtime standby ABI to allow firing Modern Standby firmware notifications that modify hardware appearance from userspace without suspending the kernel. This allows userspace to set the inactivity state of the device so that it looks like it is asleep (e.g., flashing the power button) while still being able to perform basic computations.

It is a more fleshed out implementation of [1] and a rewritten version of [2]

The first part of this series implements the plumbing that moves the existing DSMs from being called at the end of the suspend sequence to the beginning, where they are called through a transition function. Then, the last patch exposes this transition function through /sys/power/standby to allow userspace to interact with it.

In this way, the core series can be tested while not exposing the new ABI to userspace until ensured to be stable.

For more information, see the first patch in this series with documentation.

Because this series is a major rewrite, I have not tested it much and there might be minor logic issues. In addition, due to confusion with the "screen off" terminology, I opted to rename the "screen off" state to "inactive". This way, it is applicable to devices that do not have screens.

To test this series, it is recommended to enable logs with:

sudo bash -c "cat > /sys/kernel/debug/dynamic_debug/control" << EOF file drivers/acpi/x86/s2idle.c +p
file kernel/power/suspend.c +p
EOF
echo 1 | sudo tee /sys/power/pm_debug_messages

Here are some commands afterwards:

echo "active" | sudo tee /sys/power/standby; cat /sys/power/standby echo "inactive" | sudo tee /sys/power/standby; cat /sys/power/standby echo "sleep" | sudo tee /sys/power/standby; cat /sys/power/standby

Merry Christmas

PS. this series is made on v6.19-rc2, but you should probably test it on 6.18. My Wifi does not work, and neither does booting with a dock connected. Do not test it on an ROG Ally, let's get the basics first right :) The shims in asus-wmi/hid-asus should be removed once this series is merged otherwise they will conflict.

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Antheas Kapenekakis (8):
Documentation: PM: Add documentation for Runtime Standby States acpi/x86: s2idle: Rename LPS0 constants so they mirror their function acpi/x86: s2idle: add runtime standby transition function acpi/x86: s2idle: add support for querying runtime standby state
support
acpi/x86: s2idle: move DSM notifications to do_notification callback acpi/x86: s2idle: implement turn on display DSM as resume notification
PM: hibernate: Enter s2idle sleep state before hibernation
PM: standby: Add sysfs attribute for runtime standby transitions

 Documentation/ABI/testing/sysfs-power         |  20 ++
 .../admin-guide/pm/standby-states.rst         | 100 ++++++++++
 Documentation/admin-guide/pm/system-wide.rst  |   1 +
 drivers/acpi/x86/s2idle.c                     | 176 ++++++++++++------
 include/linux/suspend.h                       |  26 +++
 kernel/power/hibernate.c                      |  29 ++-
 kernel/power/main.c                           |  84 +++++++++
 kernel/power/power.h                          |   1 +
 kernel/power/suspend.c                        | 153 +++++++++++++++
 9 files changed, 532 insertions(+), 58 deletions(-)
 create mode 100644 Documentation/admin-guide/pm/standby-states.rst

base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578

Signature · 1 line
2.52.0