summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-30 13:22:02 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-30 13:22:02 -1000
commit7306ea08c00efaf6406281bd113f7d657be2e6c8 (patch)
treec2a2a24ed420f2e380ae542628fbfba185eca543 /kernel
parente3e15872e77f3feecd831eccfb753b9af916f387 (diff)
parent018f42c9ac5fa9701fc09514ed0739ab72708331 (diff)
downloadlinux-7306ea08c00efaf6406281bd113f7d657be2e6c8.tar.gz
linux-7306ea08c00efaf6406281bd113f7d657be2e6c8.zip
Merge tag 'pm-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These address assorted issues in the power management code and update documentation: - Fix potential out-of-bounds access in deferred reset in the cpufreq statistics code (Zhongqiu Han) - Cancel HWP notify work in the intel_pstate driver cleanup to prevent possible use-after-free from occurring (Tristan Madani) - Adjust state names and descriptions for ACPI _LPI idle states in the intel_idle driver to make them follow the driver's idle state naming convention (Rafael Wysocki) - Document the new pm_runtime_use_autosuspend() undo mechanism that triggers automatically on driver exit (Joshua Crofts) - Do not call suspend_ops->begin()/end() for suspend-to-idle to avoid driver confusion (Ovidiu Panait) - Make the energy model management code allocate the cpumask for non-CPU perf domains to prevent out-of-bounds reads from occurring in the EM netlink interface (Karl Mehltretter)" * tag 'pm-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: runtime: clarify pm_runtime_use_autosuspend() undo mechanism cpufreq: stats: Fix potential out-of-bounds access in deferred reset PM: suspend: Do not call suspend_ops->begin()/end() for s2idle intel_idle: Adjust state names and descriptions for _LPI states PM: EM: allocate the cpumask for every perf domain cpufreq: intel_pstate: cancel HWP notify work in driver cleanup
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/energy_model.c4
-rw-r--r--kernel/power/suspend.c20
2 files changed, 15 insertions, 9 deletions
diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index a76089e2ce8c..d19a65461ae8 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -439,7 +439,9 @@ static int em_create_pd(struct device *dev, int nr_states,
cpumask_copy(em_span_cpus(pd), cpus);
} else {
- pd = kzalloc_obj(*pd);
+ /* Readers expect pd->cpus to exist and remain empty. */
+ pd = kzalloc_flex(*pd, cpus,
+ BITS_TO_LONGS(large_cpumask_bits));
if (!pd)
return -ENOMEM;
}
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 57c44268698f..32c055df02da 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -306,20 +306,24 @@ static void platform_resume_finish(suspend_state_t state)
static int platform_suspend_begin(suspend_state_t state)
{
- if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->begin)
- return s2idle_ops->begin();
- else if (suspend_ops && suspend_ops->begin)
+ if (state == PM_SUSPEND_TO_IDLE) {
+ if (s2idle_ops && s2idle_ops->begin)
+ return s2idle_ops->begin();
+ } else if (suspend_ops && suspend_ops->begin) {
return suspend_ops->begin(state);
- else
- return 0;
+ }
+
+ return 0;
}
static void platform_resume_end(suspend_state_t state)
{
- if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->end)
- s2idle_ops->end();
- else if (suspend_ops && suspend_ops->end)
+ if (state == PM_SUSPEND_TO_IDLE) {
+ if (s2idle_ops && s2idle_ops->end)
+ s2idle_ops->end();
+ } else if (suspend_ops && suspend_ops->end) {
suspend_ops->end();
+ }
}
static void platform_recover(suspend_state_t state)