public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Antheas Kapenekakis <lkml@antheas.dev>
To: dmitry.osipenko@collabora.com
Cc: bob.beckett@collabora.com, bookeldor@gmail.com,
	hadess@hadess.net, jaap@haitsma.org, kernel@collabora.com,
	lennart@poettering.net, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, lkml@antheas.dev, mccann@jhu.edu,
	rafael@kernel.org, richard@hughsie.com,
	sebastian.reichel@collabora.com, superm1@kernel.org,
	systemd-devel@lists.freedesktop.org, xaver.hugl@gmail.com
Subject: [RFC v1 1/8] Documentation: PM: Add documentation for Runtime Standby States
Date: Fri, 26 Dec 2025 12:26:39 +0200	[thread overview]
Message-ID: <20251226102656.6296-2-lkml@antheas.dev> (raw)
In-Reply-To: <20251226102656.6296-1-lkml@antheas.dev>

Introduce the runtime standby state ABI, which allows for firing the
Modern Standby firmware notifications found in Windows during runtime.
These notifications allow to make systems that support them look
suspended.

Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
 Documentation/ABI/testing/sysfs-power         |  20 ++++
 .../admin-guide/pm/standby-states.rst         | 100 ++++++++++++++++++
 Documentation/admin-guide/pm/system-wide.rst  |   1 +
 3 files changed, 121 insertions(+)
 create mode 100644 Documentation/admin-guide/pm/standby-states.rst

diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power
index d38da077905a..16378be2dc13 100644
--- a/Documentation/ABI/testing/sysfs-power
+++ b/Documentation/ABI/testing/sysfs-power
@@ -39,6 +39,26 @@ Description:
 		See Documentation/admin-guide/pm/sleep-states.rst for more
 		information.
 
+What:		/sys/power/standby
+Date:		February 2026
+Contact:	Antheas Kapenekakis <lkml@antheas.dev>
+Description:
+		The /sys/power/standby file allows userspace to inform the
+		kernel of the current runtime standby mode depending on user
+		activity. The options are "active", "inactive", "sleep",
+		and "resume". Only the ones supported by the platform will be
+		available. Depending on the mode, the appearance of the device
+		will change (e.g., keyboard backlight will turn off as part of
+		"inactive"), and its thermal envelope might be affected.
+
+		Reading from this file returns the available standby modes,
+		with the current one enclosed in square brackets. Writing one
+		of the above strings to this file causes the kernel to
+		transition to it.
+
+		See Documentation/admin-guide/pm/standby-states.rst for more
+		information.
+
 What:		/sys/power/disk
 Date:		September 2006
 Contact:	Rafael J. Wysocki <rafael@kernel.org>
diff --git a/Documentation/admin-guide/pm/standby-states.rst b/Documentation/admin-guide/pm/standby-states.rst
new file mode 100644
index 000000000000..af7f32721d1c
--- /dev/null
+++ b/Documentation/admin-guide/pm/standby-states.rst
@@ -0,0 +1,100 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+=====================
+Runtime Standby States
+=====================
+
+:Copyright: |copy| 2026 Antheas Kapenekakis
+
+:Author: Antheas Kapenekakis <lkml@antheas.dev>
+
+This document describes the runtime standby states ABI available in the Linux
+kernel, which is designed as a generic superset of the s0ix/Modern Standby
+firmware notifications. Devices with these notifications support hardware states
+where they look like they are asleep, while still performing basic computation.
+Specifically, those are "Sleep", "Inactive", and "Active" states, with an
+additional state "Resume". Transitioning between these states follows the
+flowchart below.
+
+Runtime Standby States
+==================================
+The following runtime standby are supported::
+
+    <S2idle> ↔ <Sleep> ↔ <Inactive> ↔ <Active>
+        →       →  <Resume>  ↑
+
+.. _s2idle_drips:
+
+
+.. _s2idle_active:
+
+Active
+------
+
+The "Active" state is the default state of the system and the one it has when
+it is turned on. It is the state where the device is on, and the user is
+interacting with it.
+
+.. _s2idle_screen_off:
+
+Inactive
+----------
+
+The "Inactive" state is a state in which users have stopped interacting with
+the device, e.g., 5 seconds after the displays have turned off due to inactivity
+or due to the user pressing the power button. It is the responsibility of
+userspace to keep track of user interaction so it can inform the kernel to
+transition to this state. The response to this state for devices that support
+is to turn off their keyboard backlight, and some might pulse their power light.
+
+.. _s2idle_sleep:
+
+Sleep
+-----
+
+In the sleep state, certain devices will limit their thermal envelope so it is
+safe for them to be put into a bag and still perform basic computation such as
+fetching email. Then, some devices will pulse their power light. Userspace can
+use this state to perform basic tasks such as wake-up checks while maintaining
+the appearance the device is asleep.
+
+.. _s2idle_resume:
+
+Resume
+------
+
+The resume state is a transient state that may only be entered from the sleep
+state. It can be used to notify hardware that the device should boost its
+thermal envelope as preparation for the user interacting with it. As in, it
+undoes the thermal envelope effects of the "sleep" state while keeping its
+appearance.
+
+S2idle
+-----
+
+The "S2idle" state in the diagram corresponds to suspending normally by writing
+``mem`` to ``/sys/power/state``. Userspace is fully frozen, and the kernel parks
+the CPUs and turns off most devices. It is shown in the graph as a reference.
+If the runtime standby state is not "sleep" when entering s2idle, the kernel
+will first transition to "sleep" before entering s2idle.
+
+Basic ``sysfs`` Interface for runtime standby transitions
+=============================================================
+
+The file :file:`/sys/power/standby` can be used to transition the system between
+the different standby states. The file accepts the following values: ``active``,
+``inactive``, ``sleep``, and ``resume``. File writes will block until the
+transition completes. The system will cross all states shown in the flowchart
+above to reach the desired state. It will return ``-EINVAL`` when asking for an
+unsupported state or, e.g., requesting ``resume`` when not in the ``sleep``
+state. If there is an error during the transition, the transition will pause on
+the last error-free state and return an error.
+
+The file can be read to retrieve the current state (and potential ones) with the
+following format: ``[active] inactive sleep resume``. Only supported states
+will be shown.
+
+Userspace may transition between all supported states including s2idle
+arbitrarily, except for the ``resume`` state which may only be requested from
+the ``sleep`` state.
\ No newline at end of file
diff --git a/Documentation/admin-guide/pm/system-wide.rst b/Documentation/admin-guide/pm/system-wide.rst
index 1a1924d71006..411775fae4ac 100644
--- a/Documentation/admin-guide/pm/system-wide.rst
+++ b/Documentation/admin-guide/pm/system-wide.rst
@@ -8,4 +8,5 @@ System-Wide Power Management
    :maxdepth: 2
 
    sleep-states
+   standby-states
    suspend-flows
-- 
2.52.0



  reply	other threads:[~2025-12-26 10:36 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26 10:26 [RFC v1 0/8] acpi/x86: s2idle: Introduce and implement runtime standby ABI for ACPI s0ix platforms Antheas Kapenekakis
2025-12-26 10:26 ` Antheas Kapenekakis [this message]
2026-03-13 20:07   ` [RFC v1 1/8] Documentation: PM: Add documentation for Runtime Standby States Rafael J. Wysocki
2026-03-16 19:54     ` Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 2/8] acpi/x86: s2idle: Rename LPS0 constants so they mirror their function Antheas Kapenekakis
2026-03-13 20:12   ` Rafael J. Wysocki
2026-03-16 20:01     ` Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 3/8] acpi/x86: s2idle: add runtime standby transition function Antheas Kapenekakis
2026-03-13 20:29   ` Rafael J. Wysocki
2026-03-16 20:06     ` Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 4/8] acpi/x86: s2idle: add support for querying runtime standby state support Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 5/8] acpi/x86: s2idle: move DSM notifications to do_notification callback Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 6/8] acpi/x86: s2idle: implement turn on display DSM as resume notification Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 7/8] PM: hibernate: Enter s2idle sleep state before hibernation Antheas Kapenekakis
2026-03-13 20:33   ` Rafael J. Wysocki
2026-03-16 20:09     ` Antheas Kapenekakis
2025-12-26 10:26 ` [RFC v1 8/8] PM: standby: Add sysfs attribute for runtime standby transitions Antheas Kapenekakis
2026-01-12 20:33 ` [RFC v1 0/8] acpi/x86: s2idle: Introduce and implement runtime standby ABI for ACPI s0ix platforms Antheas Kapenekakis
2026-01-13  9:48   ` Dmitry Osipenko
2026-01-13 10:11     ` Antheas Kapenekakis
2026-01-14 23:07       ` Dmitry Osipenko
2026-01-15  7:49         ` Antheas Kapenekakis
2026-03-16 19:02           ` Dmitry Osipenko
2026-03-16 19:33             ` Antheas Kapenekakis
2026-03-16 19:36               ` Antheas Kapenekakis
2026-03-17 11:04                 ` Dmitry Osipenko
2026-02-27 14:59 ` Antheas Kapenekakis
2026-02-27 18:42   ` Rafael J. Wysocki
2026-03-13 19:36 ` Rafael J. Wysocki
2026-03-16 19:52   ` Antheas Kapenekakis
2026-03-17 11:56     ` Dmitry Osipenko
2026-03-17 12:09       ` Rafael J. Wysocki
2026-03-17 15:13         ` Mario Limonciello
2026-03-19 12:35           ` Antheas Kapenekakis
2026-03-20 20:41             ` Mario Limonciello (AMD) (kernel.org)
2026-03-21 13:46               ` Antheas Kapenekakis
2026-03-21 13:52                 ` Antheas Kapenekakis
2026-03-21 18:43                   ` Mario Limonciello
2026-03-21 22:33                     ` Antheas Kapenekakis
2026-03-23  4:36                       ` Mario Limonciello
2026-03-23  9:26                         ` Antheas Kapenekakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251226102656.6296-2-lkml@antheas.dev \
    --to=lkml@antheas.dev \
    --cc=bob.beckett@collabora.com \
    --cc=bookeldor@gmail.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=hadess@hadess.net \
    --cc=jaap@haitsma.org \
    --cc=kernel@collabora.com \
    --cc=lennart@poettering.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mccann@jhu.edu \
    --cc=rafael@kernel.org \
    --cc=richard@hughsie.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=superm1@kernel.org \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=xaver.hugl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox