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
-- 
2.52.0


Reply via email to