Skip to content

Commit d348c22

Browse files
committed
Merge tag 'pm-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "There are quite a few interesting things here, including new hardware support, new features, some bug fixes and documentation updates. In addition, there are a usual bunch of minor fixes and cleanups all over. In the new hardware support category, there are intel_pstate and intel_rapl driver updates to support new processors, Panther Lake, Wildcat Lake, Noval Lake, and Diamond Rapids in the OOB mode, OPP and bandwidth allocation support in the tegra186 cpufreq driver, and JH7110S SOC support in dt-platdev cpufreq. The new features are the PM QoS CPU latency limit for suspend-to-idle, the netlink support for the energy model management, support for terminating system suspend via a wakeup event during the sync of file systems, configurable number of hibernation compression threads, the runtime PM auto-cleanup macros, and the "poweroff" PM event that is expected to be used during system shutdown. Bugs are mostly fixed in cpuidle governors, but there are also fixes elsewhere, like in the amd-pstate cpufreq driver. Documentation updates include, but are not limited to, a new doc on debugging shutdown hangs, cross-referencing fixes and cleanups in the intel_pstate documentation, and updates of comments in the core hibernation code. Specifics: - Introduce and document a QoS limit on CPU exit latency during wakeup from suspend-to-idle (Ulf Hansson) - Add support for building libcpupower statically (Zuo An) - Add support for sending netlink notifications to user space on energy model updates (Changwoo Mini, Peng Fan) - Minor improvements to the Rust OPP interface (Tamir Duberstein) - Fixes to scope-based pointers in the OPP library (Viresh Kumar) - Use residency threshold in polling state override decisions in the menu cpuidle governor (Aboorva Devarajan) - Add sanity check for exit latency and target residency in the cpufreq core (Rafael Wysocki) - Use this_cpu_ptr() where possible in the teo governor (Christian Loehle) - Rework the handling of tick wakeups in the teo cpuidle governor to increase the likelihood of stopping the scheduler tick in the cases when tick wakeups can be counted as non-timer ones (Rafael Wysocki) - Fix a reverse condition in the teo cpuidle governor and drop a misguided target residency check from it (Rafael Wysocki) - Clean up multiple minor defects in the teo cpuidle governor (Rafael Wysocki) - Update header inclusion to make it follow the Include What You Use principle (Andy Shevchenko) - Enable MSR-based RAPL PMU support in the intel_rapl power capping driver and arrange for using it on the Panther Lake and Wildcat Lake processors (Kuppuswamy Sathyanarayanan) - Add support for Nova Lake and Wildcat Lake processors to the intel_rapl power capping driver (Kaushlendra Kumar, Srinivas Pandruvada) - Add OPP and bandwidth support for Tegra186 (Aaron Kling) - Optimizations for parameter array handling in the amd-pstate cpufreq driver (Mario Limonciello) - Fix for mode changes with offline CPUs in the amd-pstate cpufreq driver (Gautham Shenoy) - Preserve freq_table_sorted across suspend/hibernate in the cpufreq core (Zihuan Zhang) - Adjust energy model rules for Intel hybrid platforms in the intel_pstate cpufreq driver and improve printing of debug messages in it (Rafael Wysocki) - Replace deprecated strcpy() in cpufreq_unregister_governor() (Thorsten Blum) - Fix duplicate hyperlink target errors in the intel_pstate cpufreq driver documentation and use :ref: directive for internal linking in it (Swaraj Gaikwad, Bagas Sanjaya) - Add Diamond Rapids OOB mode support to the intel_pstate cpufreq driver (Kuppuswamy Sathyanarayanan) - Use mutex guard for driver locking in the intel_pstate driver and eliminate some code duplication from it (Rafael Wysocki) - Replace udelay() with usleep_range() in ACPI cpufreq (Kaushlendra Kumar) - Minor improvements to various cpufreq drivers (Christian Marangi, Hal Feng, Jie Zhan, Marco Crivellari, Miaoqian Lin, and Shuhao Fu) - Replace snprintf() with scnprintf() in show_trace_dev_match() (Kaushlendra Kumar) - Fix memory allocation error handling in pm_vt_switch_required() (Malaya Kumar Rout) - Introduce CALL_PM_OP() macro and use it to simplify code in generic PM operations (Kaushlendra Kumar) - Add module param to backtrace all CPUs in the device power management watchdog (Sergey Senozhatsky) - Rework message printing in swsusp_save() (Rafael Wysocki) - Make it possible to change the number of hibernation compression threads (Xueqin Luo) - Clarify that only cgroup1 freezer uses PM freezer (Tejun Heo) - Add document on debugging shutdown hangs to PM documentation and correct a mistaken configuration option in it (Mario Limonciello) - Shut down wakeup source timer before removing the wakeup source from the list (Kaushlendra Kumar, Rafael Wysocki) - Introduce new PMSG_POWEROFF event for system shutdown handling with the help of PM device callbacks (Mario Limonciello) - Make pm_test delay interruptible by wakeup events (Riwen Lu) - Clean up kernel-doc comment style usage in the core hibernation code and remove unuseful comments from it (Sunday Adelodun, Rafael Wysocki) - Add support for handling wakeup events and aborting the suspend process while it is syncing file systems (Samuel Wu, Rafael Wysocki) - Add WQ_UNBOUND to pm_wq workqueue (Marco Crivellari) - Add runtime PM wrapper macros for ACQUIRE()/ACQUIRE_ERR() and use them in the PCI core and the ACPI TAD driver (Rafael Wysocki) - Improve runtime PM in the ACPI TAD driver (Rafael Wysocki) - Update pm_runtime_allow/forbid() documentation (Rafael Wysocki) - Fix typos in runtime.c comments (Malaya Kumar Rout) - Move governor.h from devfreq under include/linux/ and rename to devfreq-governor.h to allow devfreq governor definitions in out of drivers/devfreq/ (Dmitry Baryshkov) - Use min() to improve readability in tegra30-devfreq.c (Thorsten Blum) - Fix potential use-after-free issue of OPP handling in hisi_uncore_freq.c (Pengjie Zhang) - Fix typo in DFSO_DOWNDIFFERENTIAL macro name in governor_simpleondemand.c in devfreq (Riwen Lu)" * tag 'pm-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (96 commits) PM / devfreq: Fix typo in DFSO_DOWNDIFFERENTIAL macro name cpuidle: Warn instead of bailing out if target residency check fails cpuidle: Update header inclusion Documentation: power/cpuidle: Document the CPU system wakeup latency QoS cpuidle: Respect the CPU system wakeup QoS limit for cpuidle sched: idle: Respect the CPU system wakeup QoS limit for s2idle pmdomain: Respect the CPU system wakeup QoS limit for cpuidle pmdomain: Respect the CPU system wakeup QoS limit for s2idle PM: QoS: Introduce a CPU system wakeup QoS limit cpuidle: governors: teo: Add missing space to the description PM: hibernate: Extra cleanup of comments in swap handling code PM / devfreq: tegra30: use min to simplify actmon_cpu_to_emc_rate PM / devfreq: hisi: Fix potential UAF in OPP handling PM / devfreq: Move governor.h to a public header location powercap: intel_rapl: Enable MSR-based RAPL PMU support powercap: intel_rapl: Prepare read_raw() interface for atomic-context callers cpufreq: qcom-nvmem: fix compilation warning for qcom_cpufreq_ipq806x_match_list PM: sleep: Call pm_sleep_fs_sync() instead of ksys_sync_helper() PM: sleep: Add support for wakeup during filesystem sync cpufreq: ACPI: Replace udelay() with usleep_range() ...
2 parents 959bfe4 + 7cede21 commit d348c22

86 files changed

Lines changed: 2139 additions & 825 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-power

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,19 @@ Description:
454454
disables it. Reads from the file return the current value.
455455
The default is "1" if the build-time "SUSPEND_SKIP_SYNC" config
456456
flag is unset, or "0" otherwise.
457+
458+
What: /sys/power/hibernate_compression_threads
459+
Date: October 2025
460+
Contact: <luoxueqin@kylinos.cn>
461+
Description:
462+
Controls the number of threads used for compression
463+
and decompression of hibernation images.
464+
465+
The value can be adjusted at runtime to balance
466+
performance and CPU utilization.
467+
468+
The change takes effect on the next hibernation or
469+
resume operation.
470+
471+
Minimum value: 1
472+
Default value: 3

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,16 @@
19071907
/sys/power/pm_test). Only available when CONFIG_PM_DEBUG
19081908
is set. Default value is 5.
19091909

1910+
hibernate_compression_threads=
1911+
[HIBERNATION]
1912+
Set the number of threads used for compressing or decompressing
1913+
hibernation images.
1914+
1915+
Format: <integer>
1916+
Default: 3
1917+
Minimum: 1
1918+
Example: hibernate_compression_threads=4
1919+
19101920
highmem=nn[KMG] [KNL,BOOT,EARLY] forces the highmem zone to have an exact
19111921
size of <nn>. This works even on boxes that have no
19121922
highmem otherwise. This also works to reduce highmem

Documentation/admin-guide/pm/cpuidle.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,15 @@ the given CPU as the upper limit for the exit latency of the idle states that
580580
they are allowed to select for that CPU. They should never select any idle
581581
states with exit latency beyond that limit.
582582

583+
While the above CPU QoS constraints apply to CPU idle time management, user
584+
space may also request a CPU system wakeup latency QoS limit, via the
585+
`cpu_wakeup_latency` file. This QoS constraint is respected when selecting a
586+
suitable idle state for the CPUs, while entering the system-wide suspend-to-idle
587+
sleep state, but also to the regular CPU idle time management.
588+
589+
Note that, the management of the `cpu_wakeup_latency` file works according to
590+
the 'cpu_dma_latency' file from user space point of view. Moreover, the unit
591+
is also microseconds.
583592

584593
Idle States Control Via Kernel Command Line
585594
===========================================

Documentation/admin-guide/pm/intel_pstate.rst

Lines changed: 74 additions & 59 deletions
Large diffs are not rendered by default.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2+
3+
name: em
4+
5+
doc: |
6+
Energy model netlink interface to notify its changes.
7+
8+
protocol: genetlink
9+
10+
uapi-header: linux/energy_model.h
11+
12+
attribute-sets:
13+
-
14+
name: pds
15+
attributes:
16+
-
17+
name: pd
18+
type: nest
19+
nested-attributes: pd
20+
multi-attr: true
21+
-
22+
name: pd
23+
attributes:
24+
-
25+
name: pad
26+
type: pad
27+
-
28+
name: pd-id
29+
type: u32
30+
-
31+
name: flags
32+
type: u64
33+
-
34+
name: cpus
35+
type: string
36+
-
37+
name: pd-table
38+
attributes:
39+
-
40+
name: pd-id
41+
type: u32
42+
-
43+
name: ps
44+
type: nest
45+
nested-attributes: ps
46+
multi-attr: true
47+
-
48+
name: ps
49+
attributes:
50+
-
51+
name: pad
52+
type: pad
53+
-
54+
name: performance
55+
type: u64
56+
-
57+
name: frequency
58+
type: u64
59+
-
60+
name: power
61+
type: u64
62+
-
63+
name: cost
64+
type: u64
65+
-
66+
name: flags
67+
type: u64
68+
69+
operations:
70+
list:
71+
-
72+
name: get-pds
73+
attribute-set: pds
74+
doc: Get the list of information for all performance domains.
75+
do:
76+
reply:
77+
attributes:
78+
- pd
79+
-
80+
name: get-pd-table
81+
attribute-set: pd-table
82+
doc: Get the energy model table of a performance domain.
83+
do:
84+
request:
85+
attributes:
86+
- pd-id
87+
reply:
88+
attributes:
89+
- pd-id
90+
- ps
91+
-
92+
name: pd-created
93+
doc: A performance domain is created.
94+
notify: get-pd-table
95+
mcgrp: event
96+
-
97+
name: pd-updated
98+
doc: A performance domain is updated.
99+
notify: get-pd-table
100+
mcgrp: event
101+
-
102+
name: pd-deleted
103+
doc: A performance domain is deleted.
104+
attribute-set: pd-table
105+
event:
106+
attributes:
107+
- pd-id
108+
mcgrp: event
109+
110+
mcast-groups:
111+
list:
112+
-
113+
name: event

Documentation/power/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Power Management
1919
power_supply_class
2020
runtime_pm
2121
s2ram
22+
shutdown-debugging
2223
suspend-and-cpuhotplug
2324
suspend-and-interrupts
2425
swsusp-and-swap-files

Documentation/power/pm_qos_interface.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,24 @@ int cpu_latency_qos_request_active(handle):
5555

5656
From user space:
5757

58-
The infrastructure exposes one device node, /dev/cpu_dma_latency, for the CPU
58+
The infrastructure exposes two separate device nodes, /dev/cpu_dma_latency for
59+
the CPU latency QoS and /dev/cpu_wakeup_latency for the CPU system wakeup
5960
latency QoS.
6061

6162
Only processes can register a PM QoS request. To provide for automatic
6263
cleanup of a process, the interface requires the process to register its
6364
parameter requests as follows.
6465

6566
To register the default PM QoS target for the CPU latency QoS, the process must
66-
open /dev/cpu_dma_latency.
67+
open /dev/cpu_dma_latency. To register a CPU system wakeup QoS limit, the
68+
process must open /dev/cpu_wakeup_latency.
6769

6870
As long as the device node is held open that process has a registered
6971
request on the parameter.
7072

7173
To change the requested target value, the process needs to write an s32 value to
7274
the open device node. Alternatively, it can write a hex string for the value
73-
using the 10 char long format e.g. "0x12345678". This translates to a
74-
cpu_latency_qos_update_request() call.
75+
using the 10 char long format e.g. "0x12345678".
7576

7677
To remove the user mode request for a target value simply close the device
7778
node.

Documentation/power/runtime_pm.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,6 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
480480
`bool pm_runtime_status_suspended(struct device *dev);`
481481
- return true if the device's runtime PM status is 'suspended'
482482

483-
`void pm_runtime_allow(struct device *dev);`
484-
- set the power.runtime_auto flag for the device and decrease its usage
485-
counter (used by the /sys/devices/.../power/control interface to
486-
effectively allow the device to be power managed at run time)
487-
488-
`void pm_runtime_forbid(struct device *dev);`
489-
- unset the power.runtime_auto flag for the device and increase its usage
490-
counter (used by the /sys/devices/.../power/control interface to
491-
effectively prevent the device from being power managed at run time)
492-
493483
`void pm_runtime_no_callbacks(struct device *dev);`
494484
- set the power.no_callbacks flag for the device and remove the runtime
495485
PM attributes from /sys/devices/.../power (or prevent them from being
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Debugging Kernel Shutdown Hangs with pstore
4+
+++++++++++++++++++++++++++++++++++++++++++
5+
6+
Overview
7+
========
8+
If the system hangs while shutting down, the kernel logs may need to be
9+
retrieved to debug the issue.
10+
11+
On systems that have a UART available, it is best to configure the kernel to use
12+
this UART for kernel console output.
13+
14+
If a UART isn't available, the ``pstore`` subsystem provides a mechanism to
15+
persist this data across a system reset, allowing it to be retrieved on the next
16+
boot.
17+
18+
Kernel Configuration
19+
====================
20+
To enable ``pstore`` and enable saving kernel ring buffer logs, set the
21+
following kernel configuration options:
22+
23+
* ``CONFIG_PSTORE=y``
24+
* ``CONFIG_PSTORE_CONSOLE=y``
25+
26+
Additionally, enable a backend to store the data. Depending upon your platform
27+
some potential options include:
28+
29+
* ``CONFIG_EFI_VARS_PSTORE=y``
30+
* ``CONFIG_PSTORE_RAM=y``
31+
* ``CONFIG_CHROMEOS_PSTORE=y``
32+
* ``CONFIG_PSTORE_BLK=y``
33+
34+
Kernel Command-line Parameters
35+
==============================
36+
Add these parameters to your kernel command line:
37+
38+
* ``printk.always_kmsg_dump=Y``
39+
* Forces the kernel to dump the entire message buffer to pstore during
40+
shutdown
41+
* ``efi_pstore.pstore_disable=N``
42+
* For EFI-based systems, ensures the EFI backend is active
43+
44+
Userspace Interaction and Log Retrieval
45+
=======================================
46+
On the next boot after a hang, pstore logs will be available in the pstore
47+
filesystem (``/sys/fs/pstore``) and can be retrieved by userspace.
48+
49+
On systemd systems, the ``systemd-pstore`` service will help do the following:
50+
51+
#. Locate pstore data in ``/sys/fs/pstore``
52+
#. Read and save it to ``/var/lib/systemd/pstore``
53+
#. Clear pstore data for the next event

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9188,6 +9188,9 @@ S: Maintained
91889188
F: kernel/power/energy_model.c
91899189
F: include/linux/energy_model.h
91909190
F: Documentation/power/energy-model.rst
9191+
F: Documentation/netlink/specs/em.yaml
9192+
F: include/uapi/linux/energy_model.h
9193+
F: kernel/power/em_netlink*.*
91919194

91929195
EPAPR HYPERVISOR BYTE CHANNEL DEVICE DRIVER
91939196
M: Laurentiu Tudor <laurentiu.tudor@nxp.com>

0 commit comments

Comments
 (0)