Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2 0/7] cpufreq: amd-pstate: Fix a batch of correctness bugs
@ 2026-11-18  3:27 Mario Limonciello
  2026-11-18  3:27 ` [PATCH v2 1/7] cpufreq: amd-pstate: Fix NULL dereference in amd_prefcore_param() Mario Limonciello
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Mario Limonciello @ 2026-11-18  3:27 UTC (permalink / raw)
  To: K Prateek Nayak
  Cc: linux-pm, Mario Limonciello, Sashiko, Mario Limonciello (AMD)

This series fixes six independent bugs in the amd-pstate cpufreq driver
and its unit test module. They were reported by automated code review
and each is fixed in its own patch:

 - amd_prefcore_param() dereferenced a NULL string when "amd_prefcore"
   was passed on the kernel command line without a value, panicking
   early in boot.
 - shmem_get_epp() applied the bits 31:24 mask to the unshifted 8-bit
   value returned by cppc_get_epp_perf(), so it always returned 0 on
   shared-memory CPPC systems and the firmware default EPP was lost.
 - amd_pstate_init_freq() passed the quirk lowest_freq (MHz) to
   freq_to_perf() together with a nominal_freq in kHz, which produced a
   bogus lowest_perf.
 - get_mode_idx_from_str() matched any prefix of a mode name, so writing
   e.g. "undefi" to the status sysfs file was silently accepted instead
   of returning -EINVAL.
 - amd_pstate_ut_epp() leaked a platform profile device and left the
   EPP state modified when dynamic EPP was originally disabled.
 - amd_pstate_update_min_max_limit() read policy->min/max multiple times
   without holding policy->rwsem, so the programmed perf limits could
   disagree with the cached limit frequencies.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
Changes in v2:
- Fold in suggestions for string handling into 5/6 (Prateek)
- Pull in changes from EPP aliasing in
  https://lore.kernel.org/linux-pm/20261012205559.3421297-1-mario.limonciello@amd.com/
- Link to v1: https://patch.msgid.link/20261116-superm1-linux-fabc6bcb-984e-4ba7-bb57-02cc3af08fa7-v1-0-682aefd4fed6@amd.com

---
Mario Limonciello (7):
      cpufreq: amd-pstate: Fix NULL dereference in amd_prefcore_param()
      cpufreq/amd-pstate: Fix EPP extraction in shmem_get_epp()
      cpufreq/amd-pstate: Fix unit mismatch in amd_pstate_init_freq()
      cpufreq: amd-pstate: Require exact mode string match
      cpufreq/amd-pstate-ut: Restore EPP state at end of amd_pstate_ut_epp()
      cpufreq/amd-pstate: Snapshot policy limits in amd_pstate_update_min_max_limit()
      cpufreq: amd-pstate: Preserve names for aliased EPP values

 drivers/cpufreq/amd-pstate-ut.c | 63 +++++++++++++++++++++--------------------
 drivers/cpufreq/amd-pstate.c    | 55 +++++++++++++++++++++++------------
 drivers/cpufreq/amd-pstate.h    |  4 +--
 3 files changed, 71 insertions(+), 51 deletions(-)
---
base-commit: 141b164bbe186423e295b139e40e8e2d11cf1341
change-id: 20261116-superm1-linux-fabc6bcb-984e-4ba7-bb57-02cc3af08fa7-9d324aa04dd5

Best regards,
--  
Mario Limonciello <mario.limonciello@amd.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-30 14:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  3:27 [PATCH v2 0/7] cpufreq: amd-pstate: Fix a batch of correctness bugs Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 1/7] cpufreq: amd-pstate: Fix NULL dereference in amd_prefcore_param() Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 2/7] cpufreq/amd-pstate: Fix EPP extraction in shmem_get_epp() Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 3/7] cpufreq/amd-pstate: Fix unit mismatch in amd_pstate_init_freq() Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 4/7] cpufreq: amd-pstate: Require exact mode string match Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 5/7] cpufreq/amd-pstate-ut: Restore EPP state at end of amd_pstate_ut_epp() Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 6/7] cpufreq/amd-pstate: Snapshot policy limits in amd_pstate_update_min_max_limit() Mario Limonciello
2026-11-18  3:27 ` [PATCH v2 7/7] cpufreq: amd-pstate: Preserve names for aliased EPP values Mario Limonciello
2026-11-30  3:56 ` [PATCH v2 0/7] cpufreq: amd-pstate: Fix a batch of correctness bugs K Prateek Nayak
2026-11-30  4:21 ` K Prateek Nayak
2026-11-30 14:04   ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox