Skip to content

feat(linux): s2idle: Document the mode selection logic#641

Open
DhruvaG2000 wants to merge 3 commits into
TexasInstruments:masterfrom
DhruvaG2000:s2idle_mode_sel_v1
Open

feat(linux): s2idle: Document the mode selection logic#641
DhruvaG2000 wants to merge 3 commits into
TexasInstruments:masterfrom
DhruvaG2000:s2idle_mode_sel_v1

Conversation

@DhruvaG2000
Copy link
Copy Markdown
Collaborator

Document the mode selection logic using the s2idle flow

Copy link
Copy Markdown
Contributor

@kwillis01 kwillis01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to see if there are other places in the previous parts of the doc that can be updated or that the new info can loop into and consolidate.

Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Copy link
Copy Markdown
Contributor

@kwillis01 kwillis01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, I think that the QoS Latency Constraints and Mode Selection section needs to be fixed up to flow better and be a little more condensed.

Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
@kwillis01
Copy link
Copy Markdown
Contributor

Additionally, could you update the RTC + DDR section in pm_am62lx_low_power_modes.rst with the updated commands needed to enter RTC + DDR? Then you can point to this page from there if the user wants an indepth explanation on s2idle

@github-actions
Copy link
Copy Markdown

New warnings found with rstcheck:

source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst:537: (ERROR/3) Content block expected for the "note" directive; none found.
source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst:538: (WARNING/2) Explicit markup ends without a blank line; unexpected unindent.

Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
@github-actions
Copy link
Copy Markdown

New warnings found with rstcheck:

source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst:505: (ERROR/3) Content block expected for the "note" directive; none found.
source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst:506: (WARNING/2) Explicit markup ends without a blank line; unexpected unindent.

@DhruvaG2000 DhruvaG2000 changed the title [RFC] feat(linux): s2idle: Document the mode selection logic feat(linux): s2idle: Document the mode selection logic Apr 24, 2026
@DhruvaG2000 DhruvaG2000 marked this pull request as ready for review April 24, 2026 12:39
Copy link
Copy Markdown
Contributor

@kwillis01 kwillis01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to put explicit instructions on how to enter RTC + DDR via s2idle (besides the constraint setting) in pm_am62lx_low_power_modes. It would give users a quick way to grab the instructions and go.

If regular [mem] interface is selected in `/sys/power/mem_sleep`, the RTC Only + DDR low power mode requires special steps
to enter. The steps are documented in :ref:`am62l_suspend_workarounds`.

RTC Only Plus DDR
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved? The note added should be in the RTC + DDR section not before it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it be only in the RTC +DDR section? The note applies to low power mode selection in general. I feel it should belong at the top and hence this was done intentionally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but now it is in the "RTC Only" section so it looks like it only applies to that mode. If anything, it should be put in the top of this page during the "Overview" section. If it is moved to the overview section, it should be noted s2idle only applies to DeepSleep and RTC + DDR for now.

However, in this release, DeepSleep is unstable using s2idle, so it might be good to move the note to inside RTC + DDR for now, then we can move it later when the bugs are fixed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.

3. Only idle states with ``exit-latency-us + entry-latency-us`` ≤ constraint are considered
4. The deepest eligible state is selected

**Selecting Specific Low-Power Modes:**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make an explicit mention of /dev/cpu_wakeup_latency here? I think it would be confusing to someone reading this section where QoS constraint is set, but which one?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay will add that


Execute this in a subshell to avoid accidentally keeping it open indefinitely.

**How It Sets QoS Constraints:**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanation in this section would make more sense under the How QoS Constraints Work section. Explaining this constraint AFTER giving an example with it doesn't make much sense. This explanation would help set the stage for the examples given in this section.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done

- ``syscore_suspend/resume()`` **called** (saves critical platform state)

* - **Driver Suspend**
- Same device PM callbacks as deep sleep
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we can have both deep sleep and RTC+DDR using s2idle, mentioning specifically deep sleep might create confusion

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this entirely, since it's not a difference

- **cpuidle**: Uses the standard CPUidle framework. Additionally, each driver is made idle by calling respective runtime suspend hooks.
- **suspend_ops**: Uses driver specific suspend operations before ``PSCI_SYSTEM_SUSPEND`` is called.
No governors exist to make any decisions.
.. list-table:: S2Idle vs Deep Sleep Comparison
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this table for the deep(mem) path or deep sleep mode specifically

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deep(mem)


.. code-block:: bash

exec 4<>/dev/cpu_wakeup_latency; echo 0x3e8 >&4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to keep the value same as in the above example

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@cshilwant
Copy link
Copy Markdown
Member

@DhruvaG2000 can you re-spin after checking comments from @kwillis01 @ti-scaria

@DhruvaG2000 DhruvaG2000 force-pushed the s2idle_mode_sel_v1 branch from f4ad757 to 2c5e7bd Compare May 12, 2026 10:08
If regular [mem] interface is selected in `/sys/power/mem_sleep`, the RTC Only + DDR low power mode requires special steps
to enter. The steps are documented in :ref:`am62l_suspend_workarounds`.

RTC Only Plus DDR
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but now it is in the "RTC Only" section so it looks like it only applies to that mode. If anything, it should be put in the top of this page during the "Overview" section. If it is moved to the overview section, it should be noted s2idle only applies to DeepSleep and RTC + DDR for now.

However, in this release, DeepSleep is unstable using s2idle, so it might be good to move the note to inside RTC + DDR for now, then we can move it later when the bugs are fixed.

Comment on lines +277 to +280
This is a generic, pure software, light-weight variant of system suspend (also referred to as S2I or S2Idle).
It allows more energy to be saved relative to runtime idle by freezing user space, suspending the timekeeping
and putting all I/O devices into low-power states (possibly lower-power than available in the working state),
such that the processors can spend time in their deepest idle states while the system is suspended.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repeats a lot of the overview plus I don't think it gets what you want it to get across. Maybe focus on how the difference between the design principles is that CPUIdle takes the reigns in deciding the system state for s2idle while for DeepSleep it is pretty much all based on the firmware choosing the LPM based off of QoS constraints.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated
Comment thread source/linux/Foundational_Components/Power_Management/pm_psci_s2idle.rst Outdated

.. code-block:: console

root@am62lxx-evm:~# gcc testqos.c -o testqos
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note above the testqos.c sets the /dev/cpu_wakeup_latency QoS constraint and an example program is shown later.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Document the mode selection logic using the s2idle flow

Signed-off-by: Dhruva Gole <d-gole@ti.com>
Add mention of the s2idle based mode selection being part of
low power mode support as of this release

Signed-off-by: Dhruva Gole <d-gole@ti.com>
Also removes myself from AM62X device owner. Add Scaria as another
PM component owner

Signed-off-by: Dhruva Gole <d-gole@ti.com>
@DhruvaG2000 DhruvaG2000 force-pushed the s2idle_mode_sel_v1 branch from 19bd7c0 to 34ae59d Compare May 13, 2026 11:47
@StaticRocket StaticRocket self-requested a review May 13, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.