Commit Graph

1676 Commits

Author SHA1 Message Date
Linus Torvalds
cbbddb6b08 power utilities 2026.10.31
turbostat 2026.10.31
 
 	Fix --cpu option to work more than once.
 	Fix --Joules option to work with --show power.
 	Remove hard-coded 8192-CPU limit.
 	Decode Uncore Frequency Agent Types.
 	Dump RDT (Resource Director Technology) config.
 	Dump RP (Resource Priority) config.
 	Recognize Rugged Panther Lake.
 	Fix PMT mmap size, bounds check, and mask computation.
 	Misc cleanups and minor fixes.
 
 x86_energy_perf_policy 2026.10.31
 
 	Harden input parsing and bounds checks.
 	Fix optarg keyword matching.
 	Rewrite MSR device path discovery.
 	Misc cleanups and minor fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE67dNfPFP+XUaA73mB9BFOha3NhcFAmrmJyQUHGxlbi5icm93
 bkBpbnRlbC5jb20ACgkQB9BFOha3Nhfugg//QCJbYp/aOZ1k9siqw1pE/z9HJlIr
 2T6vgEadOEqY1Z/ObCeH/E/pgAnrSxbCkX8AOlhdqVBysD6JVn/rvsOo6yLfpI5V
 A7QcYzZfOi9tOP4m6hHC3gmAjkYC8b1vCHMiq+F4QOW1sq7zFIZ5SHPJFUZNrHvK
 54UrRCJ6BfJGw1W/cGozgwYVCJW7yXVHd2845nEhj8SGrkeZZVilkbrDiwFTxvWJ
 PC6QpsScLLq0lKFkr7fIFb/QGr1Zz0dwqCsDzO5z4wHqvvAZ+yAGSYLw3MG/6LBL
 PzFRivNETn7jwNcaQOp0H7teThC3s+WDioFLQjIrp2VNv5/yQeG1FZjh/EnlRBOi
 WcelJfwzWMrkmXfHE1UGrn9Y6HLFddRSxjdpyEQ+QGpH2NAyUxwFDauz9JZl3Tdd
 E/3T6F+BRvDOm/sHg3zMOCewUsbEdbxwLs+g6RNH7QkapcofOtUwzuNGUfD3ETF5
 qbTN+4P1T3FDxeI9GK6yLUZD6DsgIFwGEWOrD2VIp0XZaTNGGLHSwU0vQFEN3Tlq
 sKMkGdtnThTp4nRnWwbDqAQpWVEX+62HsUlOuPYL25CDAyyPfFIBGnCGDqyPLUEp
 Mlp/CMg8jA1VsFzzNX4aMGSjvszfJG+wVtHd/yluid4aqJFofl6Uza3FA5brCAF4
 hp0PVFWnJF907Z4=
 =fZ/K
 -----END PGP SIGNATURE-----

Merge tag 'power-utilities-2026.10.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull x86 power utilities updates from Len Brown:
 "Turbostat:
   - Fix --cpu option to work more than once
   - Fix --Joules option to work with --show power
   - Remove hard-coded 8192-CPU limit
   - Decode Uncore Frequency Agent Types
   - Dump RDT (Resource Director Technology) config
   - Dump RP (Resource Priority) config
   - Recognize Rugged Panther Lake
   - Fix PMT mmap size, bounds check, and mask computation
   - Misc cleanups and minor fixes

  x86_energy_perf_policy:
   - Harden input parsing and bounds checks
   - Fix optarg keyword matching
   - Rewrite MSR device path discovery
   - Misc cleanups and minor fixes"

* tag 'power-utilities-2026.10.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (42 commits)
  tools/power x86_energy_perf_policy: Version 2026.10.31
  tools/power turbostat: Version 2026.10.31
  tools/power turbostat: Fix PMT mmap size and bounds check
  tools/power turbostat: Fix undefined behavior in pmt_gen_value_mask()
  tools/power turbostat: Fix --Joules when used with --show power
  MAINTAINERS: Add x86_energy_perf_policy
  x86_energy_perf_policy: Simplify write_sysfs() return type
  x86_energy_perf_policy: Use calloc to initialize string buffer
  x86_energy_perf_policy: Cleanup: Constify read only parameters
  x86_energy_perf_policy: Cleanup: Drop unused signal.h
  x86_energy_perf_policy: Document MSRHEADER
  x86_energy_perf_policy: Cleanup: Check fseek() in VM path
  x86_energy_perf_policy: Cleanup: Define BCLK_MHZ
  x86_energy_perf_policy: Cleanup: Define HWP_WINDOW_MAX_USEC
  x86_energy_perf_policy: Bound package iteration
  x86_energy_perf_policy: Harden against potential ratio overflow
  x86_energy_perf_policy: Fix optarg keyword matching
  x86_energy_perf_policy: Cleanup: Use snprintf() for platform-profile
  x86_energy_perf_policy: Harden with strtol()
  x86_energy_perf_policy: Harden update_cpufreq_scaling_freq()
  ...
2026-10-31 15:05:17 -07:00
Len Brown
8969e647d0 Merge branches 'turbostat' and 'x86_energy_perf_policy' into utilities 2026-10-31 14:29:22 -03:00
Len Brown
ed9324befb tools/power x86_energy_perf_policy: Version 2026.10.31
Since 2026.04.25:

Harden input parsing and bounds checks.
Fix optarg keyword matching.
Rewrite MSR device path discovery.
Misc cleanups and minor fixes.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-31 14:23:24 -03:00
Len Brown
a8d65a89a3 tools/power turbostat: Version 2026.10.31
Since version 2026.09.28:

Fix --cpu option to work more than once.
Fix --Joules option to work with --show power.
Remove hard-coded 8192-CPU limit.
Decode Uncore Frequency Agent Types.
Dump RDT (Resource Director Technology) config.
Dump RP (Resource Priority) config.
Recognize Rugged Panther Lake.
Fix PMT mmap size, bounds check, and mask computation.
Misc cleanups and minor fixes.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-31 14:21:38 -03:00
Kaushlendra Kumar
cfdb43387f tools/power turbostat: Fix PMT mmap size and bounds check
Remove assert(offset == 0), to allow non-zero PMT offsets.

Fix the pmt_mmio_open() mapping to round-up (offset + size).

Fix the offset bounds check to disallow running past the end of the region.

[lenb: commit message re-write]
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-31 13:46:33 -03:00
Kaushlendra Kumar
3d6fc92be1 tools/power turbostat: Fix undefined behavior in pmt_gen_value_mask()
The function uses plain int literal '1' for bit shifting, which causes
undefined behavior when msb >= 31. This is because shifting a 32-bit int
by 32 or more bits is undefined behavior in C. Fix by using 1ULL
(unsigned long long) instead of 1 to ensure 64-bit arithmetic on all
platforms.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-31 13:46:33 -03:00
Len Brown
ab6e94fb4a tools/power turbostat: Fix --Joules when used with --show power
The "--Joules" option displays energy in Joules,
replacing the same metrics displayed as power in Watts.

But when used with --show power, it deletes the power
metrics without replacing them with their energy counterparts:

$ sudo ./turbostat -q --list --show power --Joules
CoreTmp,PkgTmp,RAM_J,PKG_%,RAM_%

Fix it thus:

$ sudo ./turbostat -q --list --show power --Joules
CoreTmp,PkgTmp,Pkg_J,Cor_J,GFX_J,RAM_J,PKG_%,RAM_%,Sys_J

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-31 13:46:06 -03:00
Linus Torvalds
c339f4010d platform-drivers-x86 for v7.4-1
Highlights:
 
 - acer-wmi:
   - Add HWMON support for Aspire A315-58G
   - Add platform profile, HWMON, and fan control support for Nitro
     ANV15-51
   - Add support for mode key on some models (e.g. Nitro AN16-41)
 
 - acer-wmi-battery: Add battery control driver
 
 - ACPI: video: Remove CONFIG_X86 dependency as WMI now supports non-X86
                archs
 
 - alienware-wmi-wmax: Add support for Alienware Area-51 AAT2250
 
 - amd/hsmp: Add support for Family 1Ah client platforms
 
 - amd/pmc:
   - Do not rely on intermediate cycle counting in the wakeup delay logic
   - Make HP Laptop 14-fq1xxxx and Thinkpad L14 Gen3 (21C5) use s2idle
     quirk
   - Make Asus ROG Flow Z13 use spurious_8042 quirk
   - Add support for AMD 1Ah Family DCh SoC
 
 - amd/pmf:
   - Add support for AMDI0112
   - Fix compat ioctl handling
 
 - arm64: asus-glymur-ec: Add support
 
 - arm64: lenovo-yoga-slim7x-gen11-ec: Add support
 
 - arm64: qcom-hamoa-ec: Disable SCI IRQ during suspend
 
 - arm64: thinkpad-t14s-ec: Do not send KEY_KBDILLUMTOGGLE on FN + Space
                            as EC already steps keyboard backlight
 
 - asus-armoury:
   - Add discrete GPU power state attribute
   - Add support for discrete GPU disable on ProArt H7606
   - Support tunables with more models
 
 - asus-nw-wmi: Make ROG Flow X13 GV302X use the tablet-mode switch quirk
 
 - asus-wmi:
   - Make ASUS ProArt PX13 use the tablet-mode switch quirk
   - Add support for mute LED
   - Fix screenpad backlight problems
   - Correct kbd_rgb_state_index description (keyboard -> shutdown)
 
 - ayaneo-ec: Add support for AYANEO 2S
 
 - bitland-mifs-wmi: Correct interpretation of WMI call output
 
 - dell-dw5826e: Add support for _DSM with revision 0 (Slate PTL CS 14,
                 Yukon PTL CSLW 14, Yukon PTL 360 14)
 
 - hp-bioscfg: Many fixes
 
 - hp-wmi:
   - Add change control support for HP Spectre x360 16-aa0xxx
   - Do not show any fan attribute when no fans are available
   - Add support for OMEN 16-am0xxx, OMEN 16-am2xxx, OMEN 17-ck1xxx, OMEN
     MAX 16-ah0xxx, OMEN Slim 16t-an000, OMEN Transcend 14-fb1xxx
   - Add HP Laptop 15-fd1xxx support
   - Add Victus 15-fb3xxx, Victus 16-d1xxx (8A26), Victus 16-e0xxx support
 
 - huawei-wmi: Add support for Honor MagicBook camera privacy toggle key
 
 - ideapad-laptop:
   - Add support for Mode key and Phone Link key found on some Yoga Pro
     7 models
   - Add support for camera switch on some Yoga Pro 7 and Legion Pro 7
     models
 
 - intel/hid: Support 5-button array on HP EliteBook x360 1030 G2
 
 - intel/pmc:
   - Add rugged Panther Lake support
   - Fix Nova Lake PCD-S telemetry constants
 
 - intel/pmt:
   - Block mmap when read_telem() callback is present
   - Fix PCI device to device generalization
 
 - intel/speed-select-if: Always enumerate on recent server CPUs
                          (Family 19, i.e., Diamond Rapids and onwards)
 
 - intel/tpmi: Prepare for enumerating non-PCI devices
 
 - intel-uncore-freq:
   - Restore limits properly also on sparse setups
   - Add rugged Panther Lake support
 
 - intel/vsec:
   - Reset state properly before re-enumeration
   - Fix inverted logic in get features function
 
 - lenovo-wmi-capdata: Support non-supported, stubbed WMI query method
                       for capdata device
 
 - msi-ec:
   - Prevent out of bounds charge thresholds
   - Add support for MSI Creator Z16 A11UE, MSI GL65 Leopard 9SCXK,
     MSI Katana 15 B13VFK
 
 - msi-wmi: Ignore key events for keys already handled by atkbd
 
 - oxpec:
   - Add support for charge limit on OneXPlayer Apex
   - Add OneXPlayer 3 support
 
 - panasonic-laptop:
   - Add support for FN key
 
 - surface: aggregator_registry:
   - Remove non-existing sensors device and fix tablet-mode detection on
     Surface Pro 11
   - Add performance profile and fan support for Surface Pro 11
 
 - thinkpad_acpi:
   - Add keyboard attachment detection and reporting found on Thinkpad
     X1 Fold
   - Add support for Thinkpad L440 fan speed reporting
 
 - tools/power/x86/intel-speed-select:
   - Correct make clean
   - Increase wait time after SST PP level switch to prevent stale
     capability readings
 
 - tuxedo:
   - Fix keyboard LED map ordering
   - Correct interpreting intensity vs RGB levels
 
 - uniwill-laptop:
   - Correct brightness handling for 3 level keyboard
   - Add keyboard backlight support for TUXEDO devices
   - Add support for PCSpecialist Recoil 16 AMD
   - Add support for screen rotation key found on PCSpecialist Recoil 16
     AMD and TUXEDO Stellaris 16 Gen7
   - Implement rainbow animation as trigger
   - Correct led labels to match LED subsystem conventions
   - Add support for LAPKC71E Intel NUC x15
 
 - wmi:
   - Remove X86 dependency to allow supporting arm64 laptops in future
   - wmi-bmof: Move under drivers/platform/wmi/
 
 - Miscellaneous cleanups / refactoring / improvements
 
 The following is an automated shortlog grouped by driver:
 
 acer-wmi:
  -  Add support for Acer Nitro AN16-41
  -  Add support for Acer Nitro ANV15-51
  -  Cycle platform profile on mode key 0x4
  -  enable hwmon on Aspire A315-58G
  -  Remove unused platform_profile_support variable
  -  split hwmon from platform profile quirk
  -  use bool for boolean quirk fields
 
 ACPI: video:
  -  Remove CONFIG_X86 handling from nvidia_wmi_ec_supported()
 
 add Acer battery control driver:
  - add Acer battery control driver
 
 Add ACPI_COMPANION() NULL check in topstar_acpi_probe:
  - Add ACPI_COMPANION() NULL check in topstar_acpi_probe
 
 amd: hfi:
  -  Fix a use-after-free when unloading the driver
  -  Fix out-of-bounds reads when parsing ranking data
  -  Rely on ACPI enumeration instead of a dummy device
 
 amd/hsmp:
  -  Add HSMP client support for Family 1Ah
  -  Document and expose client telemetry table in UAPI
  -  Recognize Family 1Ah client platforms and hide server-only paths
  -  Route metric table through the client messages
 
 amd/pmc:
  -  Add HP Laptop 14-fq1xxx to s2idle quirk list
  -  Add PMC driver support for AMD 1Ah Family DCh SoC
  -  Add spurious_8042 to ASUS ROG Flow Z13 GZ302EA
  -  Add Thinkpad L14 Gen3 (21C5) to quirk_s2idle_bug
  -  clear devm-managed pointers on remove to prevent stale reuse
 
 amd: pmc:
  -  Drop scratch_reg from amd_1ah_m80_cpu_info
  -  Only create amd_pmc_idlemask if scratch defined
 
 amd/pmf:
  -  Add AMDI0112 ACPI ID
  -  fix compat ioctl handling
  -  Fix power_supply refcount leak in amd_pmf_get_battery_prop()
  -  Inline !AMD_PMF_DEBUG stub
  -  Inline simple helper function of Smart PC TA interfaces
  -  Inline simple helper function of SPS Layer
  -  Inline simple helper functions of Core Layer
  -  Inline wrappers of ap{mf,ts}_if_call_store_buffer()
  -  Validate the APTS state index
 
 amd:
  -  Stop counting intermediate cycles with metrics table
 
 arm64:
  -  Add a driver for the EC found on ASUS Glymur machines
  -  add Lenovo Yoga Slim 7x Gen 11 EC driver
 
 arm64: qcom-hamoa-ec:
  -  Disable the SCI IRQ during suspend
 
 arm64:
  -  Remove redundant dev_err_probe()
 
 arm64: thinkpad-t14s-ec:
  -  don't send KEY_KBDILLUMTOGGLE on Fn+Space
 
 asus-armoury:
  -  add dGPU disable fallback DEVID for ProArt H7606 series
  -  Add dgpu_power_state attribute
  -  add power limits quirk for FA608PM
  -  add power limits quirk for FA608UH
  -  add power limits quirk for FA608UP
  -  add power limits quirk for G533QS
  -  add power limits quirk for G614FM
  -  add power limits quirk for G713QR
  -  Add power limits quirk for GA401IHR
  -  add power limits quirk for GA402NV
  -  add power limits quirk for GU605CM
  -  add support for GX651AR
  -  Add XBOX ROG Ally X 20 Tunables
  -  let attribute groups decide their own visibility
  -  move has_valid_limit() above the attribute declarations
  -  Prevent disabling dGPU when in use
  -  use sysfs_create_groups() and sysfs_remove_groups()
 
 asus-laptop:
  -  Fix typo in infos_show() comment
 
 asus-nb-wmi:
  -  add tablet mode quirk for ROG Flow X13 GV302X
  -  Fix typo in asus_nb_wmi_quirks() comment
 
 asus-wmi:
  -  Add ASUS_WMI_DEVID_DGPU_POWER_STATE define
  -  Add mute LED support
  -  add tablet-mode switch quirk for ASUS ProArt PX13
  -  don't warn when LPS0 is unavailable
  -  fix screenpad power state detection
  -  fix TUF keyboard power state shutdown naming
  -  fix unclear usage of bd->props.power
  -  fix use-after-free unregistering kbd_led led
  -  name the TUF keyboard RGB state and speed codes
  -  Remove redundant per-device wmi_lock and duplicate rfkill ops
  -  Remove unused platform_profile_support member
  -  remove unused screenpad_brightness
  -  rename TUF RGB state DEVID to _CMD
  -  Serialize WMI method evaluations with a mutex
  -  use backlight_is_blank() for screenpad power
  -  validate custom fan curves on enable
 
 ayaneo-ec:
  -  Add AYANEO 2S charge control
 
 bitland-mifs-wmi:
  -  Detect failed function calls
  -  Treat WMI_FN_SYSTEM_AC_TYPE as optional
 
 dell: alienware-wmi-wmax:
  -  add Alienware Area-51 AAT2250
 
 dell-dw5826e:
  -  Extend _DSM support to revision 0
 
 dell-wmi-aio:
  -  Convert to use the bus-based WMI API
  -  Use named defines for event types
 
 docs: TPMI:
  -  use literal block for commands
 
 gpd pocket fan:
  -  Cancel work before releasing GPIOs
 
 hp_accel:
  -  Fix typo in lis3lv02d_acpi_write() comment
 
 hp-bioscfg:
  -  allow clearing current_password
  -  consolidate common package-element parsing
  -  fix 16-byte heap overflow for empty auth token
  -  fix non-ASCII truncation in hp_get_string_from_buffer()
  -  fix off-by-one in password length check
  -  fix OOB reads in hp_get_string_from_buffer()
  -  fix oops on short integer attribute buffer
  -  fix slab-out-of-bounds write in hp_convert_hexstr_to_str()
  -  NUL-terminate the SPM auth token
  -  remove dead bounds check in audit_log_entries_show
  -  return -E2BIG from validate_password_input()
  -  Support allocating large number of BIOS vars
  -  validate SPM state returned by firmware
  -  zero the hex-string decode buffer in hp_convert_hexstr_to_str()
 
 hp-wmi:
  -  Add board 8E41 (OMEN Transcend 14) to feature board list
  -  add charge_behaviour support for Spectre 8C15/8C17
  -  Add OMEN board 8A17 thermal profile support
  -  Add OMEN board 8A18 thermal profile support
  -  Add OMEN board 8D40 thermal profile support
  -  Add OMEN board 8D42 thermal profile support
  -  Add support for HP Laptop 15-fd1xxx (board 8DE1)
  -  Add support for Omen 16-am0xxx (8D3F)
  -  add support for OMEN 16-am2xxx boards
  -  Add Victus 15-fb3xxx support
  -  Add Victus 16-d1xxx board 8A26 support
  -  Add Victus 16-e0xxx board 88EE support
  -  Disable hwmon attributes when no fans are usable
  -  fix heap OOB read and memory corruption in hp_wmi_perform_query()
  -  Fix hwmon keep-alive teardown
  -  Remove unused platform_profile_support variable
 
 huawei-wmi:
  -  add camera toggle keycode
 
 ibm_rtl:
  -  Fix potential OOB read at signature search
 
 ideapad-laptop:
  -  Add Yoga Pro 7 14IAH10 Mode key
  -  Map Smart Connect hotkey to KEY_LINK_PHONE
  -  Report camera switch as SW_CAMERA_LENS_COVER
 
 int1092:
  -  Mark as orphan
 
 intel/hid:
  -  Enable 5 button array on HP EliteBook x360 1030 G2
 
 intel/pmc:
  -  Add rugged Panther Lake support to intel_pmc_core
  -  Fix stale NVL PCD-S S0ix_LPM telemetry constants
 
 intel/pmt:
  -  Add register access callbacks
  -  Block mmap when callback is present
  -  complete pcidev to device update
  -  Do not remap when using callbacks
  -  refactor rc with a return value
  -  refactor rmw with a return value
 
 intel: power-domains:
  -  Handle failed init in tpmi_get_linux_die_id()
  -  Handle failed init in tpmi_get_power_domain_mask()
 
 intel_telemetry:
  -  initialize default trace verbosity
 
 intel/tpmi:
  -  Build the TPMI control words in one expression
  -  Declare the loop counters in their loops
  -  Describe a TPMI instance by its two devices
  -  Describe the device creation policy on the function
  -  Do not assume TPMI is enumerated from PCI
  -  Drop unused arg from tpmi_set_control_base()
  -  Fix typo in TPMI_FEATURE_NAME_LEN comment
  -  Get tpmi_info directly from the parent device
  -  Include the headers tpmi_common.c relies on
  -  Keep the feature resources in intel_tpmi_info
  -  Remove unused vsec_dev from intel_tpmi_pm_feature
  -  Split off the PCI VSEC enumeration
  -  Split out enumeration independent init and exit
  -  Turn TPMI_GET_SINGLE_ENTRY_SIZE() into a function
  -  Use DEFINE_RES_MEM() for the feature resources
  -  Use DEFINE_SHOW_STORE_ATTRIBUTE() for mem_write
  -  Use guard() for tpmi_dev_lock in the status read
  -  Use scnprintf() to build the debugfs names
  -  Use scope based cleanup in the memory dump
  -  Use static strings for the feature device names
 
 intel-uncore-freq:
  -  Add support for rugged Panther Lake
  -  Continue restoring limits on resume
 
 intel/vsec:
  -  Fix inverted walk_header() test in get_features()
  -  Pass a struct device to intel_vsec_set_mapping()
  -  reset state before re-enumerating
  -  Use bool for run_once
 
 intel: wmi:
  -  Remove redundant callbacks
  -  Use sysfs_emit in sbl-fw-update
 
 ISST:
  -  Avoid model check for recent servers
 
 lenovo-wmi-capdata:
  -  Adopt new WMI API
  -  Defer mutex initialization
  -  Detect stubbed capdata device
  -  Do not match missing components
  -  Do not stop the AC notifier chain on error
  -  Only allocate sub-master info when necessary
 
 lenovo-wmi-{capdata,other}:
  -  Only allocate capdata list when necessary
 
 lenovo-wmi-capdata:
  -  Register component even on WMI error
  -  Store a pointer to component info
 
 lenovo-wmi-helpers:
  -  Adopt new WMI API
 
 lib/string_choices:
  -  Add str_supported_unsupported() helper
 
 MAINTAINERS:
  -  Add Aaron Erhardt as maintainer of TUXEDO DRIVERS
  -  Add myself as a LENOVO drivers co-maintainer
 
 mellanox:
  -  Remove redundant dev_err()
 
 msi-ec:
  -  Add MSI Creator Z16 A11UE EC firmware
  -  Add MSI GL65 Leopard 9SCXK EC firmware
  -  Add MSI Katana 15 B13VFK EC firmware
  -  Report valid charge thresholds when unset
 
 msi-laptop:
  -  Fix typo in struct quirk_entry comment
 
 msi-wmi:
  -  Fix hotkeys dropped with vendor backlight
  -  Ignore WMI events for keys also handled by atkbd
  -  Sort scancodes numerically
 
 olpc:
  -  Reserve space for a string terminator
 
 oxpec:
  -  Add OneXPlayer 3 quirk
  -  Fix Apex charge limit control
 
 panasonic-laptop:
  -  Fix typo in the file history comment
  -  register FN key up/down events
 
 Remove redundant dev_err()/dev_err_probe():
  - Remove redundant dev_err()/dev_err_probe()
 
 platform/x86: thinkpad_acpi:
  - Revert: Add X9-14 Gen 1 to non-standard thermal/fan quirk tables
 
 samsung-laptop:
  -  Fix typo in sabi_configs comment
 
 simatic-ipc:
  -  fix platform device leak on registration failure
 
 surface: aggregator_registry:
  -  Add performance profile and fan support for Surface Pro 11
  -  Add Surface Laptop 8th Edition
  -  Fix tablet-mode detection on Surface Pro 11
  -  Remove sensors device for Surface Pro 11
 
 think-lmi:
  -  Use ARRAY_SIZE() in tlmi_errstr_to_err()
  -  Use scnprintf() in new_password_store()
  -  Use sysfs_emit() in pending_reboot_show()
 
 thinkpad-acpi:
  -  Add X1 Fold keyboard attachment detection
 
 thinkpad_acpi:
  -  Add X9-14 Gen 1 to non-standard thermal/fan quirk tables
  -  convert conditional mutex locks to ACQUIRE_ERR()
  -  convert mutex_lock() to guard(mutex)
  -  fix deadlock in hotkey input open/close
  -  Fix fan speed reporting on ThinkPad L440
  -  fix typos in comments
  -  Remove unreachable code in beep_read()
  -  Use bool for local is_thinkpad variable
  -  use __free(kfree) for automatic cleanup
  -  Use input_device_enabled()
  -  Use str_supported_unsupported() helper
 
 tools/power/x86/intel-speed-select:
  -  Clean all the produced files
  -  Correct macro name in debug output
  -  Fix signed shift UB in BIT() macro
  -  Increase wait time after SST PP level switch
  -  v1.27 release
 
 toshiba_haps:
  -  Remove unnecessary ret in toshiba_haps_resume()
 
 tuxedo:
  -  Don't use device driver data
  -  Fix keyboard LED map ordering
  -  Set HID report ID on success
  -  Update and extend documentation
  -  Use intensity according to HID spec
 
 uniwill-laptop:
  -  Add PCSpecialist Recoil 16 AMD
  -  Enable kb backlight and lightbar for TUXEDO
  -  Extend support for the Intel NUC x15
  -  Fix breathing animation on Intel QC
  -  Fix brightness notify for 3 level keyboards
  -  Fix typo in the kbd LED brightness comment
  -  Implement rainbow animation as trigger
  -  Label multicolor LEDs correctly
  -  Map the screen rotation key
  -  Report correct lightbar brightness
 
 wmi-bmof:
  -  Move to generic WMI code
 
 wmi:
  -  Introduce wmidev_exists()
  -  Remove dependency on CONFIG_X86
 
 yogabook:
  -  use assign_bit()/change_bit() where applicable
 
 Merges:
  -  Merge branch 'fixes' into review-ilpo-next
  -  Merge branch 'platform-drivers-x86-intel-pmt' into for-next
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCauHB9QAKCRBZrE9hU+XO
 MZV2AQCkkN0AWkpcntUWH2Ocw4fxIkGGGit7runnoFMsO0OApgEAtYECez8g+lbW
 UHrOn4M0tqqGx6qcj0/isbJP6TApGwI=
 =cGZu
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Ilpo Järvinen:
 "The usual updates for laptop quirks from HP, ASUS, Acer, Dell etc:
   - new model names and recent CPU support
   - more special button / function key handling
   - battery and hardware monitoring quirks

  Tool updates to intel-speed-select

  WMI now supports non-x86 architectures

  Miscellaneous cleanups / refactoring / improvements"

* tag 'platform-drivers-x86-v7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (237 commits)
  platform/x86: asus-wmi: name the TUF keyboard RGB state and speed codes
  platform/x86: asus-wmi: fix TUF keyboard power state shutdown naming
  platform/x86: asus-wmi: rename TUF RGB state DEVID to _CMD
  platform/x86: asus-armoury: add power limits quirk for GU605CM
  platform/x86: asus-armoury: add power limits quirk for G533QS
  platform/x86: asus-armoury: add power limits quirk for GA402NV
  platform/x86: asus-armoury: add power limits quirk for FA608UP
  platform/x86: asus-armoury: add power limits quirk for FA608UH
  platform/x86: asus-armoury: add power limits quirk for FA608PM
  platform/x86: asus-armoury: add power limits quirk for G713QR
  platform/x86: ibm_rtl: Fix potential OOB read at signature search
  platform/x86: acer-wmi: Add support for Acer Nitro AN16-41
  platform/x86: acer-wmi: Cycle platform profile on mode key 0x4
  platform/x86: hp-wmi: Disable hwmon attributes when no fans are usable
  platform/x86: gpd pocket fan: Cancel work before releasing GPIOs
  platform/x86: asus-armoury: Add XBOX ROG Ally X 20 Tunables
  platform/x86: msi-wmi: Ignore WMI events for keys also handled by atkbd
  platform/x86: msi-wmi: Sort scancodes numerically
  platform: arm64: Add a driver for the EC found on ASUS Glymur machines
  MAINTAINERS: Add myself as a LENOVO drivers co-maintainer
  ...
2026-10-28 07:36:32 -10:00
Len Brown
5afe2d3ce2 x86_energy_perf_policy: Simplify write_sysfs() return type
Simplify error check in write_sysfs().

Suggested-by: Amarjeet <amarjeet@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:25 -04:00
Len Brown
d833146644 x86_energy_perf_policy: Use calloc to initialize string buffer
strstr was being run on a potentially unterminated buffer.

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:25 -04:00
Len Brown
febae602a5 x86_energy_perf_policy: Cleanup: Constify read only parameters
Add const qualifiers to the parameters of
parse_optarg_string(), platform_profile_name_is(),
print_hwp_request(), and print_hwp_request_pkg() which are read-only.

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:25 -04:00
Len Brown
8afbe9b7fa x86_energy_perf_policy: Cleanup: Drop unused signal.h
Remove unused #include <signal.h>

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
2d14634951 x86_energy_perf_policy: Document MSRHEADER
Add comment documenting MSRHEADER

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
2778dc35d4 x86_energy_perf_policy: Cleanup: Check fseek() in VM path
Add return value validation for fseek() and ensure consistent
resource cleanup on all error paths in err_on_hypervisor().

Fixes: 0936cdfbb5 ("tools/power x86_energy_perf_policy: Input/output error in a VM")
Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
029db3fc5e x86_energy_perf_policy: Cleanup: Define BCLK_MHZ
Replace the hardcoded value 100 with a named symbolic constant BCLK_MHZ in
ratio_2_sysfs_khz() to document the assumed bus clock frequency.

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
22d8ec33a7 x86_energy_perf_policy: Cleanup: Define HWP_WINDOW_MAX_USEC
Define HWP_WINDOW_MAX_USEC
Doing so pointed out that it should be unsigned,
so change associated code that touches it to use unsigned.

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
d865b3810b x86_energy_perf_policy: Bound package iteration
Add explicit bounds checking against MAX_PACKAGES in for_packages()
to prevent potential out-of-bounds bit shift operations.
Also, use consistent shift idiom: (1ULL << pkg_num)

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
128c6fd2af x86_energy_perf_policy: Harden against potential ratio overflow
Prevent integer overflow in ratio_2_msr_perf() by using 64-bit
arithmetic for the intermediate multiplication calculation.

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
0177067d19 x86_energy_perf_policy: Fix optarg keyword matching
Replace strncmp() with strcmp() for exact string matching in
parse_optarg_string().  Exact keyword matching is safer and clearer.
This prevents accidental matches with longer strings
like "performance-foo".

Fixes: 4beec1d751 ("tools/power x86_energy_perf_policy: support HWP.EPP")
Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
db2cffbc80 x86_energy_perf_policy: Cleanup: Use snprintf() for platform-profile
Better hygiene to use snprintf() instead of strcpy().

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
0aaac38a0d x86_energy_perf_policy: Harden with strtol()
Replace atoi() with strtol() and proper error checking when parsing the
--hwp-use-pkg command-line argument value, and other spots.

Add explicit check that value is in valid range [0, 1].

Update associated error message strings.

parse_optarg_string() now returns long, as returned from strtol().

Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:24 -04:00
Len Brown
74bd795c99 x86_energy_perf_policy: Harden update_cpufreq_scaling_freq()
Protect update_cpufreq_scaling_freq() from buffer overflow
if somehow it was called with a huge CPU number.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 14:51:18 -04:00
Len Brown
481006fbcb x86_energy_perf_policy: Rewrite Linux/Android MSR path discovery
First check that the Linux MSR driver path exists, modprobe if no.
If still no, then check that the Android MSR driver path exists.

Read or Write permissions are handled at run-time
in the get_msr()/put_msr() error paths.

Create set_msr_path() helper.

Return -1 for all fatal errors.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-27 13:15:41 -04:00
Kuppuswamy Sathyanarayanan
00eae75a3b tools/power turbostat: Add rugged Panther Lake support
Add CPU model for rugged Panther Lake to the platform and perf model
tables. It uses the same cores as Panther Lake, so use the same settings.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Co-developed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:29 -04:00
Hemanth Selam
24d277a547 tools/power turbostat: Fix comment typo
Spell "instead" properly in comment.

Assisted-by: Cursor:claude-opus-5
Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:28 -04:00
Len Brown
065c85e479 tools/power turbostat: Rename cpu_subset to cpuset_cmdline
The cpu_set supporting "--cpu" on the cmdline is special.
Unlike all other cpu_sets, it is allocated, re-used,
and never freed.

Add a comment noting this and name it "cpuset_cmdline"
to clarify its use.

No functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:28 -04:00
Len Brown
1a0bd1bfad tools/power turbostat: Allow multiple --cpu on cmdline
If --cpu is on the cmdline more than once,
previous invocations are forgotten (and their
cpu_set is leaked).

Allow multiple invocations of --cpu on the cmdline.
OR them together, reusing the same cpu_set.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:28 -04:00
Len Brown
d895f1596d tools/power turbostat: Cleanup: Use one cpu_setsize for all purposes
Use a single cpu_setsize to describe every cpu_set_t.
Size it based on the maximum possible cpu number.

No functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:28 -04:00
Len Brown
7aa84b0a2c tools/power turbostat: Dump RP-Enable MSRs
To reduce verbosity, put the Enable MSRs on the same output line
as the CPUID info that shows they exist.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-26 09:44:11 -04:00
Linus Torvalds
df37e39242 Power management updates for 7.4-rc1
- Fix multiple issues related to input validation, synchronization,
    access safety, memory layout and register field validation, and error
    handling in the ACPI CPPC library (Christian Loehle and Sumit Gupta)
 
  - Select the frequency-invariance callback per CPU in the CPPC cpufreq
    driver and create the FIE worker before enabling PCC callbacks in it
    to avoid queueing work through a missing worker and dereferencing a
    NULL pointer (Christian Loehle)
 
  - Update the CPPC cpufreq driver entry in MAINTAINERS and add a new
    entry for the ACPI CPPC library (Christian Loehle)
 
  - Minor fixes in various cpufreq drivers (Alexander Koskovich, Daniel
    Schwierzeck, Frank Zhang, Haotian Zhang, Kathiravan Thirumoorthy,
    Sumeet Pawnikar, and Xueqin Luo)
 
  - Fix wrong behaviors on multi-node servers in the Loongson cpufreq
    driver (Huacai Chen)
 
  - Reject NULL from cpufreq_cpu_get() in the Rust code (Mehmet Koseoglu)
 
  - Add suspend OPP to mediatek cpufreq driver and DT (Ryan Brue)
 
  - Fixups for a few bugs identified by Sashiko in the amd-pstate cpufreq
    driver (Mario Limoncielloi, Wentao Guan)
 
  - Initial support for maximum frequency capacity handling on Zen6
    client in amd-pstate (Mario Limonciello)
 
  - Fix for amd-pstate-ut with 'Requested CPU Min frequency' BIOS option
    (K Prateek Nayak)
 
  - New Zen6 tuning values for EPP in amd-pstate (Mario Limonciello,
    Vishal Badole)
 
  - amd-pstate documentation fix (Karl Mehltretter)
 
  - Restrict deferred downscaling to low load for shared policies in the
    conservative cpufreq governor to avoid undesirable CPU frequency
    reduction in some cases (Shengming Hu)
 
  - Serialize sugov_start() against rate limit updates in the schedutil
    cpufreq governor to avoid using a stale rate limit value (Hui Su)
 
  - Prevent cpuidle governors menu and teo from returning idle state 0
    after it has been disabled (Xueqin Luo)
 
  - Replace min_t() with the better alternatives in the intel_idle driver
    and make it use 2-argument strscpy() (Andy Shevchenko)
 
  - Fix two repeated phrase instances in cpuidle (Hemanth Selam, Syazwina
    Fazrul)
 
  - Add rugged Panther Lake support to the intel_rapl power capping
    driver and make it use %pe for printing error pointers (Srinivas
    Pandruvada and Sumeet Pawnikar)
 
  - Update and improve runtime PM documentation and add a kunit test for
    supplier idle/suspend (Brian Norris)
 
  - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit()
    to ensure autosuspend disabling on driver teardown (Joshua Crofts)
 
  - Ignore page-zero RAM in E820 checksum during hibernation on x86 to
    avoid rejecting images created after kexec() (Matthias Goergens)
 
  - Add resume event mapping for PMSG_POWEROFF to the PM core to allow it
    to carry out device shutdown in the future (Mario Limonciello)
 
  - Add DPM watchdog to prepare/late/early/noirq/complete phases of
    device suspend and resume (Mayank Rungta)
 
  - Update swsusp.txt references to swsusp.rst in hibernation
    documentation (Li Jun)
 
  - Fix use-after-free of perf domain in netlink doit handlers for energy
    models (Fan Wu)
 
  - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it
    was removed inadvertently in previous development cycles to avoid
    use-after-free (Bradley Morgan)
 
  - Unregister CPU PM notifier outside the timer lock in the timer-ti-dm
    clocksource driver (Bradley Morgan)
 
  - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc
    comment and typo "hierachy" in a comment in pm-graph (Hemanth Selam)
 
  - Fix the return value in dev_pm_opp_get_of_node() kernel-doc (Karl
    Mehltretter)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrWNkISHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1M7QH/RyTpxMUHI3eLqhPIczecdsQxoJ9gCZS
 wGMQmvBRrNEw/Cp+X+j5Swo8iOJRKQ5Na+h53Ebg4EFJg5Fkh8SDO/VhQDaC0GUp
 t9y9MpVfXq/Fc/gOimzJ/MGhRmBXl5HKva586pg5TdFg4adDs4kPcDj9zDFnKMhf
 Kb0FHgjRjli1iDT1HSOV7KDsH1bZBWD1P04jMaVQ1zJb6Ngwi1msyBaRlE3A1mqX
 W31C3pi7qtfbs1v1JPmrnaVAJEZmv38t7x/G3o5FL35P2bwlgN/KXD0aMNHZ0Rnl
 A6Jz4p5ugop+gBLzyQo4W8SNcLk9cRvlp3FUwuEax4MEPbg+rhfjdDs=
 =4ccu
 -----END PGP SIGNATURE-----

Merge tag 'pm-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "This time, the most visible part are the ACPI CPPC updates from
  Christian Loehle, including CPPC cpufreq driver changes, even though
  updates of cpufreq drivers proper are still the largest topic group.
  However, the updates of cpufreq drivers depend on the ACPI CPPC
  updates, so they should really be counted together and that is well
  over 1/2 of the total commit count.

  Interestingly enough, almost all of the updates included here are
  fixes or cleanups, with some new feature support in the amd-pstate
  cpufreq driver and IPQ9650 support in the qcom-nvmem cpufreq driver.
  The runtime PM documentation improvements from Brian Norris can also
  be mostly regarded as fixes, but a new kunit test goes along with
  them.

  Specifics:

   - Fix multiple issues related to input validation, synchronization,
     access safety, memory layout and register field validation, and
     error handling in the ACPI CPPC library (Christian Loehle and Sumit
     Gupta)

   - Select the frequency-invariance callback per CPU in the CPPC
     cpufreq driver and create the FIE worker before enabling PCC
     callbacks in it to avoid queueing work through a missing worker and
     dereferencing a NULL pointer (Christian Loehle)

   - Update the CPPC cpufreq driver entry in MAINTAINERS and add a new
     entry for the ACPI CPPC library (Christian Loehle)

   - Minor fixes in various cpufreq drivers (Alexander Koskovich, Daniel
     Schwierzeck, Frank Zhang, Haotian Zhang, Kathiravan Thirumoorthy,
     Sumeet Pawnikar, and Xueqin Luo)

   - Fix wrong behaviors on multi-node servers in the Loongson cpufreq
     driver (Huacai Chen)

   - Reject NULL from cpufreq_cpu_get() in the Rust code (Mehmet
     Koseoglu)

   - Add suspend OPP to mediatek cpufreq driver and DT (Ryan Brue)

   - Fixups for a few bugs identified by Sashiko in the amd-pstate
     cpufreq driver (Mario Limoncielloi, Wentao Guan)

   - Initial support for maximum frequency capacity handling on Zen6
     client in amd-pstate (Mario Limonciello)

   - Fix for amd-pstate-ut with 'Requested CPU Min frequency' BIOS
     option (K Prateek Nayak)

   - New Zen6 tuning values for EPP in amd-pstate (Mario Limonciello,
     Vishal Badole)

   - amd-pstate documentation fix (Karl Mehltretter)

   - Restrict deferred downscaling to low load for shared policies in
     the conservative cpufreq governor to avoid undesirable CPU
     frequency reduction in some cases (Shengming Hu)

   - Serialize sugov_start() against rate limit updates in the schedutil
     cpufreq governor to avoid using a stale rate limit value (Hui Su)

   - Prevent cpuidle governors menu and teo from returning idle state 0
     after it has been disabled (Xueqin Luo)

   - Replace min_t() with the better alternatives in the intel_idle
     driver and make it use 2-argument strscpy() (Andy Shevchenko)

   - Fix two repeated phrase instances in cpuidle (Hemanth Selam,
     Syazwina Fazrul)

   - Add rugged Panther Lake support to the intel_rapl power capping
     driver and make it use %pe for printing error pointers (Srinivas
     Pandruvada and Sumeet Pawnikar)

   - Update and improve runtime PM documentation and add a kunit test
     for supplier idle/suspend (Brian Norris)

   - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit()
     to ensure autosuspend disabling on driver teardown (Joshua Crofts)

   - Ignore page-zero RAM in E820 checksum during hibernation on x86 to
     avoid rejecting images created after kexec() (Matthias Goergens)

   - Add resume event mapping for PMSG_POWEROFF to the PM core to allow
     it to carry out device shutdown in the future (Mario Limonciello)

   - Add DPM watchdog to prepare/late/early/noirq/complete phases of
     device suspend and resume (Mayank Rungta)

   - Update swsusp.txt references to swsusp.rst in hibernation
     documentation (Li Jun)

   - Fix use-after-free of perf domain in netlink doit handlers for
     energy models (Fan Wu)

   - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it
     was removed inadvertently in previous development cycles to avoid
     use-after-free (Bradley Morgan)

   - Unregister CPU PM notifier outside the timer lock in the
     timer-ti-dm clocksource driver (Bradley Morgan)

   - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc
     comment and typo "hierachy" in a comment in pm-graph (Hemanth
     Selam)

   - Fix the return value in dev_pm_opp_get_of_node() kernel-doc (Karl
     Mehltretter)"

* tag 'pm-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (89 commits)
  cpufreq: loongson3: Replace IOCSR read/write with MMIO ones
  cpufreq: loongson3: Use global physical CPU ID in get/target callbacks
  cpufreq: loongson3: Replace per-package mutex with per-node
  cpufreq: loongson3: Adjust the width of id and val in smc_message
  cpufreq: loongson3: Make this driver depend on MACH_LOONGSON64
  PM: runtime: Expand introduction with core concepts and structure
  cpufreq: schedutil: Serialize sugov_start() against rate limit updates
  MAINTAINERS: ACPI: Add a separate CPPC entry
  MAINTAINERS: cpufreq: Replace CPPC reviewer
  arm64: dts: mediatek: mt8173: Mark the lowest CPU OPPs for suspend
  cpufreq: mediatek: Enter system sleep at the suspend OPP
  cpufreq: qcom-cpufreq-hw: fix device node refcount leak in phandle parsing
  cpufreq: qcom-nvmem: Add IPQ9650 support
  cpufreq: Add Milos to cpufreq-dt-platdev blocklist
  cpufreq: Use %pe to print error pointers symbolically
  rust: rcpufreq_dt: add module alias
  cpufreq: sti: avoid NULL dereference in dev_err()
  cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
  cpufreq: sparc-us2e: fix frequency table index copy-paste error
  rust: cpufreq: reject NULL from cpufreq_cpu_get()
  ...
2026-10-21 14:24:26 -10:00
Len Brown
e48d77302b tools/power turbostat: Dump RDT CPUID.0xF,0x10,0x27,0x28 Support
If Asymmetric RDT is supported, dump it on every CPU.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:52 -04:00
Len Brown
890265c019 tools/power turbostat: Dump RDT CPUID.7 Support
Show both Symmetric and Asymmetric RDT bits.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:52 -04:00
Len Brown
e817a533bb tools/power turbostat: pmt: Improve sscanf() hygiene
Explicitly check sscanf() return values for number of matches,
and handle EOF (-1).

Defensive programming -- not an issue actively seen by users.

Fixes: 4265a86582 ("tools/power turbostat: Add PMT directory iterator helper")
Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:52 -04:00
Len Brown
e1708e514a tools/power turbostat: Cleanup: bool force_load
It is confusing to increment what is effectively a bool value.
Define force_load as bool, and access it accordingly.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:52 -04:00
Len Brown
501c340739 tools/power turbostat: Fix typo: MHz, not Mhz
The SI symbol for megahertz capitalizes
both the SI prefix ('M') and the unit symbol ('Hz').

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:52 -04:00
Len Brown
3bbe42ac51 tools/power turbostat: Cleanup: consistently use warn/err, not perror
Acknowledge that get_msr() always errs out on failure by returning
void and deleting checks for its return value.

Replace all perror() with warn().
Replace all perror()/exit() with err().

No functional change, unless you count the uniform return value of -1
on calloc failure.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
12f841ec7b tools/power turbostat: Cleanup add_counter declaration
Declaration and definition parameter name mismatch was confusing.
Some params can be 'const'.

No functional change.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
6389a3ed1a tools/power turbostat: Cleanup counter sets debug code
When the debug "--Dump" option is used to dump counter values,
also dump the counter sets.  Update that counter counter-set
debug code to pass code review.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
b1dc956189 tools/power turbostat: Cleanup: Unify comparisons to max_cpu_num
Unify the syntax of loops over all CPUs for consistency,
since we just fixed two off-by-one bugs.

No functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
91aa566a7e tools/power turbostat: Cleanup: Remove useless assert()
No functional change.

Assisted-by: Claude:claude-haiku-4-5
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
244cc1e302 tools/power turbostat: Cleanup: Delete duplicate table entry
No functional change.

Assisted-by: Claude:claude-haiku-4-5
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
c1165c0db9 tools/power turbostat: Cleanup: Remove hard-coded 8192 CPU limit
The --cpu cmdline option was parsed before topology_probe()
set max_cpu_num, and so it used a hard-coded CPU limit of 8192.

Probe max_cpu_num earlier and allocate the set for --cpu
using the same size as all other CPU sets, large
enough to hold max possible (but not bigger).

No functional change, unless you count fixing some error paths.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
afa7b0f63a tools/power turbostat: Rename: Differentiate counter and CPU sets
Sets of Built-In-Counters (BICs) are implemented using cpu_set_t.
Since cpu_set_t is also used for sets of CPUs, invent
the name "bic_set_t" to make it more clear which is which.

typedef is discouraged by kernel coding checkers,
but is appropriate here -- and better than #define.

No functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
acadea13ed tools/power turbostat: Cleanup: Delete unused flags
No functional change.

Assisted-by: Claude:claude-haiku-4-5
Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:51 -04:00
Len Brown
962d020230 tools/power turbostat: Decode Uncore Frequency Agent Types
Newer platforms export Uncore Frequency agent_types:

$ cat /sys/devices/system/cpu/intel_uncore_frequency/uncore03/agent_types
memory

Update the previous system configuration header lines:
Uncore Frequency package0 domain4 cluster1: 800 - 2100 MHz (800 - 2100 MHz) 2100 MHz

With (more concise) lines that include this (agent type) description:
pkg0: UMHz4.1(memory): 800 - 2100 MHz (800 - 2100 MHz) 2100 MHz

The actual measurement column header is unchanged:
UMHz4.1

Signed-off-by: Len Brown <len.brown@intel.com>
2026-10-19 10:19:33 -04:00
Srinivas Pandruvada
0e264bd274
tools/power/x86/intel-speed-select: v1.27 release
This version includes the following changes:
- Increase wait time after SST PP level switch
- Cleanup of temporary files and minor cleanup

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-10-13 12:01:30 +03:00
Srinivas Pandruvada
8f91d453a5
tools/power/x86/intel-speed-select: Increase wait time after SST PP level switch
After an Intel Speed Select Performance Profile (SST PP) level switch, hardware
takes time to update the HWP CAPABILITIES register. The current 2 ms wait time
is insufficient on some platforms, leading to stale capability readings.

Increase the wait time to 10 ms. Because level switching is an infrequent operation
done only during configuration and not in a fast path, the slight delay has
negligible impact.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-10-13 12:01:28 +03:00
Jiri Slaby (SUSE)
346629565a
tools/power/x86/intel-speed-select: Clean all the produced files
1) The commit 7d440da009 ("tools/power/x86/intel-speed-select: HFI
   support") added the thermal.h link, but did not remove it up on
   cleanup. Do so.
2) .*.cmd files were never deleted, so were left dangling. Clean them up
   too.
3) The "*.d" pattern was updated:
   a) the backslash was superfluous,
   b) it was made more explicit by specifying ".o" in ".*.o.d".

[ span: Capitalize first letter after : ]
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-10-13 12:01:26 +03:00
Liu Jing
cd0342cbad
tools/power/x86/intel-speed-select: Fix signed shift UB in BIT() macro
The BIT() macro is defined as `(1 << (x))` with a signed integer 1.
When x >= 31, this causes signed integer overflow which is undefined
behavior in C. This macro is used with BIT(31) in isst-core.c and
isst-core-mbox.c.

Fix it by using `1U` instead of `1` to perform an unsigned shift,
matching the kernel's own BIT() definition which uses unsigned.

[ span: Change header ]
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-10-13 12:01:23 +03:00
Ethan Nelson-Moore
e31e445b6c
tools/power/x86/intel-speed-select: Correct macro name in debug output
A call to debug_printf() in isst-core-mbox.c incorrectly refers to
CONFIG_TDP_GET_TURBO_LIMIT instead of
CONFIG_TDP_GET_TURBO_LIMIT_RATIOS. Correct it.

Discovered while searching for CONFIG_* symbols referenced in code but
not defined.

[ span: Capitalize first letter after : ]
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-10-13 12:01:21 +03:00