fix(pm_psci_s2idle): Update and enhance s2idle docs#750
Conversation
| }; | ||
| }; | ||
|
|
||
| **Why Domain Grouping is Needed:** |
There was a problem hiding this comment.
The points were not very accurate. Explained the power-domain component here and how its used in a different section below
| their deepest idle state? | ||
| 2. **Which idle state can be entered?** — Of the states available for this domain, | ||
| which is the deepest one whose total latency (entry + exit) fits within the | ||
| current QoS constraint? |
There was a problem hiding this comment.
can we add some note about wakeup source also?
There was a problem hiding this comment.
Yes, I'll add a note on how enabling/disabling wakeup sources can affect the selection
| ``WKUP_PD`` is a sibling of ``MAIN_PD`` (not a child), ``MAIN_PD`` can still | ||
| enter DeepSleep. This is why the RTC+DDR section in :ref:`lpm_modes` requires | ||
| disabling USB wakeup sources — DeepSleep works regardless, but RTC+DDR requires | ||
| ``WKUP_PD`` to be idle too. |
There was a problem hiding this comment.
Something for no console suspend
There was a problem hiding this comment.
Where should we keep the warning regarding the no_console_suspend parameter. Should we only keep it here or mention in the main LPM page as well
There was a problem hiding this comment.
i think here is good enough as it is totally linked to mode selection
StaticRocket
left a comment
There was a problem hiding this comment.
There are other places where active voice should be used
| * **CLUSTER_PD** (Cluster Power Domain): Cluster-level power domain that groups multiple CPUs | ||
|
|
||
| These power domains inform CPUIdle about which non-critical domains can be disabled when all cores within them are idle. | ||
| These power domains tell CPUIdle which non-critical domains to disable when all cores within them are idle. |
There was a problem hiding this comment.
| These power domains tell CPUIdle which non-critical domains to disable when all cores within them are idle. | |
| These power domains tell CPUIdle what non-critical domains to disable when all cores within them are idle. |
|
|
||
|
|
||
| The idle state associated with each domain is the state that domain enters when all | ||
| of its children are powered off. This determines the deepest low power mode the |
There was a problem hiding this comment.
| of its children are powered off. This determines the deepest low power mode the | |
| of its children are off. This determines the deepest low power mode the |
| This mapping is what the kernel uses at runtime to determine whether a power domain | ||
| can be powered off. If any device assigned to a domain is still active, that domain |
There was a problem hiding this comment.
| This mapping is what the kernel uses at runtime to determine whether a power domain | |
| can be powered off. If any device assigned to a domain is still active, that domain | |
| This mapping lets the kernel determine at runtime when to turn off a power domain. | |
| If any device assigned to a domain is still active, that domain |
| ====================== | ||
| The Linux kernel's PM QoS (Quality of Service) framework allows drivers and applications to | ||
| specify maximum acceptable wakeup latency. These constraints directly influence what idle | ||
| state are elligible for entry during s2idle. |
| Here's how it would look like: (The testqos.c program is shown further below, which helps set the | ||
| `/dev/cpu_wakeup_latency` QoS constraint.) | ||
| When a wakeup source is enabled/disabled, and also depending on the wakeup source being in-band/out-of-band, | ||
| the genpd framework may choose to power off or keep on the the associated devices. |
There was a problem hiding this comment.
good update, can you add the exact behavior of genpd for these two cases (maybe add in 2 points) so that our documentation is complete on its own
| 500 ms constraint, so DeepSleep is the deepest permitted state. | ||
|
|
||
| **Example: Deep Sleep Mode Selection:** | ||
| **Example 2: Active USB blocks RTC+DDR but DeepSleep still possible** |
There was a problem hiding this comment.
For new changes, keep RTC + I/O + DDR (old ones are already taken care by kendall in her PR)
|
|
||
| .. warning:: | ||
|
|
||
| When disabling **serial UART** as a wakeup source, do not disable ``console_suspend`` in the kernel command line. |
There was a problem hiding this comment.
Add small line saying that MAIN UART has out of band wakeup.
kwillis01
left a comment
There was a problem hiding this comment.
I really like the changes to the content, I think it will make it easier for users to read and implement in their system.
One big thing to note is I think we should go step by step in explaining how to set the CPU wakeup latency constraints. We should first explain what they are, the program needed to set them, and then how it is used.
|
|
||
| On TI K3 platforms with OSI mode enabled, s2idle can dynamically enter deep power states | ||
| (standby, Deep Sleep, RTC+DDR) that power down the MAIN domain. This creates a hybrid scenario: | ||
| (standby, Deep Sleep, RTC+I/O+DDR) that power down the MAIN domain. This creates a hybrid scenario: |
There was a problem hiding this comment.
| (standby, Deep Sleep, RTC+I/O+DDR) that power down the MAIN domain. This creates a hybrid scenario: | |
| (standby, DeepSleep, RTC + I/O + DDR) that power down the MAIN domain. This creates a hybrid scenario: |
| ├──> Timers | ||
| ├──> SDHCI controllers | ||
| └──> USB controllers | ||
| SOC_PD [idle: RTC+I/O+DDR] |
There was a problem hiding this comment.
| SOC_PD [idle: RTC+I/O+DDR] | |
| SOC_PD [idle: RTC + I/O + DDR] |
| 4. The deepest eligible state is selected | ||
|
|
||
| * **cpu_sleep_1 (PowerDown)**: CPU is powered down with context loss | ||
| Writing a latency value (in microseconds) to ``/dev/cpu_wakeup_latency`` does the following: |
There was a problem hiding this comment.
I think instead of diving right into writing to /dev/cpu_wakeup_latency, instead this part should start by explaining that to create a global CPU wakeup latency constraint the device file of /dev/cpu_wakeup_latency needs to be held open for the constraint to be “active”. Then show the example program of how to do that (test_qos.c). Then after those are explained, show and explain the example of using test_qos.c to determine the low power mode.
| * Min residency: 500ms | ||
| * Use case: Short to moderate idle periods with faster resume requirements | ||
| The value ``0x7a120`` (500,000 μs = 500ms) allows all CPU-level idle states. At the system domain | ||
| level, Deep Sleep (350ms total: 250ms entry + 100ms exit) is allowed while RTC+I/O+DDR (900ms total: |
There was a problem hiding this comment.
| level, Deep Sleep (350ms total: 250ms entry + 100ms exit) is allowed while RTC+I/O+DDR (900ms total: | |
| level, DeepSleep (350ms total: 250ms entry + 100ms exit) is allowed while RTC + I/O + DDR (900ms total: |
| * Exit latency: 600ms | ||
| * Min residency: 1000ms | ||
| * Use case: Long idle periods requiring maximum power savings | ||
| The Device Tree defines multiple idle states at each level of the hierarchy, each with different |
There was a problem hiding this comment.
| The Device Tree defines multiple idle states at each level of the hierarchy, each with different | |
| The device tree defines multiple idle states at each level of the hierarchy, each with different |
| Examples | ||
| ======== | ||
|
|
||
| **Example 1: Latency constraint forces Deep Sleep instead of RTC+I/O+DDR** |
There was a problem hiding this comment.
| **Example 1: Latency constraint forces Deep Sleep instead of RTC+I/O+DDR** | |
| **Example 1: Latency constraint forces Deep Sleep instead of RTC + I/O + DDR** |
| during long idle periods. | ||
| Result: System enters DeepSleep | ||
|
|
||
| Even though RTC+I/O+DDR offers lower power, its 900 ms total latency exceeds the |
There was a problem hiding this comment.
| Even though RTC+I/O+DDR offers lower power, its 900 ms total latency exceeds the | |
| Even though RTC + I/O + DDR offers lower power, its 900 ms total latency exceeds the |
| 500 ms constraint, so DeepSleep is the deepest permitted state. | ||
|
|
||
| **Example: Deep Sleep Mode Selection:** | ||
| **Example 2: Active USB blocks RTC+I/O+DDR but DeepSleep still possible** |
There was a problem hiding this comment.
| **Example 2: Active USB blocks RTC+I/O+DDR but DeepSleep still possible** | |
| **Example 2: Active USB blocks RTC + I/O + DDR but DeepSleep still possible** |
| └─> main_sleep_deep (DeepSleep): SELECTED | ||
|
|
||
| SOC_PD: WKUP_PD cannot power off (USB0 active) | ||
| └─> main_sleep_rtcddr (RTC+I/O+DDR): REJECTED |
There was a problem hiding this comment.
| └─> main_sleep_rtcddr (RTC+I/O+DDR): REJECTED | |
| └─> main_sleep_rtcddr (RTC + I/O + DDR): REJECTED |
|
|
||
| The active USB device only blocks ``SOC_PD`` from powering off. Since | ||
| ``WKUP_PD`` is a sibling of ``MAIN_PD`` (not a child), ``MAIN_PD`` can still | ||
| enter DeepSleep. This is why the RTC+I/O+DDR section in :ref:`lpm_modes` requires |
There was a problem hiding this comment.
| enter DeepSleep. This is why the RTC+I/O+DDR section in :ref:`lpm_modes` requires | |
| enter DeepSleep. This is why the RTC + I/O + DDR section in :ref:`lpm_modes` requires |
| * Exit latency: 100ms | ||
| * Min residency: 500ms | ||
| * Use case: Short to moderate idle periods with faster resume requirements | ||
| The value ``0x7a120`` (500,000 μs = 500ms) allows all CPU-level idle states. At the system domain |
There was a problem hiding this comment.
Is CPU level idle states/ System level idle states defined somewhere?
There was a problem hiding this comment.
This is explained in '3.3.5.4.2. Standard Format' section made earlier.
|
New warnings found with rstcheck: |
e4e60a5 to
f642481
Compare
kwillis01
left a comment
There was a problem hiding this comment.
There are still some vale warnings for passive voice that need to be fixed if possible
| } | ||
|
|
||
| Alternatively, you can also set it with this command: | ||
| Alternatively, you can also set it with the following bash command: |
There was a problem hiding this comment.
| Alternatively, you can also set it with the following bash command: | |
| Alternatively, the CPU wakeup latency constraint can be set with the following bash command: |
| - Support for Wifi with M2 CC33xx cards - :ref:`How to Enable M.2-CC33xx in Linux <enable_m2cc3301>` | ||
| - Out-of-Box experience based on LVGL (Light and Versatile Graphics Library) - :ref:`TI LVGL Demo - User Guide <TI-LVGL-Demo-User-Guide-label>` | ||
| - Security: Post Quantum Cryptography using Module Lattice (ML) Key Encapsulation Mechanism (KEM) or ML-KEM, ML Digital Signature Algorithm (DSA) or ML-DSA, and Stateless Hash-Based (SLH) DSA or SLH-DSA - :ref:`Post Quantum Cryptography <post_quantum_cryptography>` | ||
| - Power Management: Runtime Low power mode selection using s2idle framework - :ref:`AM62L S2idle <pm_s2idle_psci>` |
There was a problem hiding this comment.
| - Power Management: Runtime Low power mode selection using s2idle framework - :ref:`AM62L S2idle <pm_s2idle_psci>` | |
| - Power Management: Runtime low power mode selection using s2idle framework - :ref:`AM62L S2idle <pm_s2idle_psci>` |
|
|
||
| **Cluster-Level Idle States:** | ||
| Here's how it would look like: (The set_qos.c program is shown in :ref:`setting-cpu-wakeup-latency`, which helps set the | ||
| `/dev/cpu_wakeup_latency` QoS constraint.) |
There was a problem hiding this comment.
| `/dev/cpu_wakeup_latency` QoS constraint.) | |
| ``/dev/cpu_wakeup_latency`` QoS constraint.) |
| **CPU-Level Idle States:** | ||
| #. Each device or CPU can register a latency constraint (in nanoseconds) | ||
| #. The cpuidle governor queries these constraints before selecting an idle state | ||
| #. Only idle states with ``exit-latency-us + entry-latency-us`` ≤ constraint are considered |
There was a problem hiding this comment.
The code only around the exit and entry latency looked a little weird imo, this change makes it so the constraint is included but its in italics. I also think it would be fine if it all was considered code or bolded, as long as the constraint is included.
| #. Only idle states with ``exit-latency-us + entry-latency-us`` ≤ constraint are considered | |
| #. Only idle states with `exit-latency-us + entry-latency-us ≤ constraint` are considered |
There was a problem hiding this comment.
The use of double grave accent marks is correct here. We don't want this to be interpreted as an inline literal. That being said, I agree that the entire conditional expression should be in that block.
| } | ||
|
|
||
| Alternatively, you can also set it with this command: | ||
| Alternatively, the CPU wakeup latency constraint can be set with the following bash command: |
Update the s2idle docs with the correct AM62L power domain hierarchy and idle states derived from the latest release. Rewrite the mode selection logic by including the components involved and how they are used. Signed-off-by: Scaria Kochidanadu <s-kochidanadu@ti.com>
Add S2idle feature to Key Release References section. This is a method that enables selection of low power mode at runtime. Signed-off-by: Scaria Kochidanadu <s-kochidanadu@ti.com>
Update the s2idle docs with the correct AM62L power domain hierarchy and idle states derived from the latest release.
Rewrite the mode selection explanation for clarity.