Commit Graph

4304 Commits

Author SHA1 Message Date
Linus Torvalds
85671b807f More power management updates for 7.3-rc1
- Fix a kernel panic during PMU unbind in the intel_rapl power capping
    driver and sign-extend the PMU delta on counter wraparound in it to
    avoid misreporting energy (Sumeet Pawnikar and Yifan Li)
 
  - Unblock runtime PM when device prepare fails that was not done by
    mistake (Shibo Zhu)
 
  - Fix possible rate limit overflow on 32-bit systems in the schedutil
    cpufreq governor (Hui Su)
 
  - Consolidate HWP P-states initialization in the intel_pstate cpufreq
    driver and make that driver avoid using the DESIRED_PERF HWP hint
    when the Dynamic Efficiency Control (DEC) is enabled in the processor
    to avoid inconsistent behavior (Rafael Wysocki)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmqPLkgSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1rjkIAJHjnU5/ak8dVrKfDNdK7vcP656sNJkx
 gsVjdrU0ki4JSE9n/PE2Z1SjqSz0DvWnk1RYxXBKYbwTswuBE7xqcT5M2g1RycbA
 LyEQRRUbFUHJANpNko1y431BPyiSzX/YjdFadC9vRi/IhTVxJ4SpEp0aXnqy7ANV
 JppXhyRDpgEcH2OjXhjKmKFnYD2VBw0zcIidok5uTZg6rftlxLRpzabMiGJ+T4x4
 h5l5ZDejoMnL/A6MUyrJO5cXi5E+moYXFZj7ofTgX5aNzxxu0rdQ130VMlChQI19
 nc1GdStcYO74xTguexlxU6nKWL3eiLaLqulEqghInAvVq+HEQyghsLc=
 =kZl3
 -----END PGP SIGNATURE-----

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

Pull more power management updates from Rafael Wysocki:
 "These fix two issues in the intel_rapl power capping driver, fix a
  potential issue in the schedutil cpufreq governor on 32-bit systems,
  fix a runtime PM issue related to failing system suspend, and update
  the intel_pstate cpufreq driver:

   - Fix a kernel panic during PMU unbind in the intel_rapl power
     capping driver and sign-extend the PMU delta on counter wraparound
     in it to avoid misreporting energy (Sumeet Pawnikar and Yifan Li)

   - Unblock runtime PM when device prepare fails that was not done by
     mistake (Shibo Zhu)

   - Fix possible rate limit overflow on 32-bit systems in the schedutil
     cpufreq governor (Hui Su)

   - Consolidate HWP P-states initialization in the intel_pstate cpufreq
     driver and make that driver avoid using the DESIRED_PERF HWP hint
     when the Dynamic Efficiency Control (DEC) is enabled in the
     processor to avoid inconsistent behavior (Rafael Wysocki)"

* tag 'pm-7.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  powercap: intel_rapl: Fix kernel panic during PMU unbind
  PM: sleep: Unblock runtime PM when device prepare fails
  powercap: intel_rapl: Sign-extend the PMU delta on counter wraparound
  cpufreq: intel_pstate: Avoid using DESIRED_PERF when DEC is enabled
  cpufreq: intel_pstate: Consolidate HWP P-states initialization
  cpufreq: schedutil: Fix rate limit overflow
2026-08-26 14:13:26 -07:00
Rafael J. Wysocki
76854b339b Merge branches 'pm-cpufreq' and 'pm-sleep'
Merge additional cpufreq updates and one update related to system sleep
for 7.3-rc1:

 - Unblock runtime PM when device prepare fails that was not done by
   mistake (Shibo Zhu)

 - Fix possible rate limit overflow on 32-bit systems in the schedutil
   cpufreq governor (Hui Su)

 - Consolidate HWP P-states initialization in the intel_pstate cpufreq
   driver and make that driver avoid using the DESIRED_PERF HWP hint
   when the Dynamic Efficiency Control (DEC) is enabled in the processor
   to avoid inconsistent behavior (Rafael Wysocki)

* pm-cpufreq:
  cpufreq: intel_pstate: Avoid using DESIRED_PERF when DEC is enabled
  cpufreq: intel_pstate: Consolidate HWP P-states initialization
  cpufreq: schedutil: Fix rate limit overflow

* pm-sleep:
  PM: sleep: Unblock runtime PM when device prepare fails
2026-08-26 19:49:23 +02:00
Linus Torvalds
59e6295fac Driver core changes for 7.3-rc1
- container_of:
 
   - Apply typeof_member(), remove the local __mptr variable to eliminate
     variable shadowing warnings on nested container_of() calls, and remove
     unnecessary parentheses.
 
 - core:
 
   - Add driver name to probe debug print for initcall_debug.
 
   - Avoid repeatedly printing the same 'Fixed dependency cycle' log.
 
   - Unwind device_add() on attribute creation failure in
     attribute_container_add_class_device().
 
   - Remove statistics group if encryption group creation fails in
     transport_add_class_device().
 
 - debugfs:
 
   - Fix lockdown check for mmap_prepare().
 
   - Warn if file creation failed due to uninitialized debugfs.
 
 - device property:
 
   - Implement fw_devlink support for software nodes by adding
     software_node_add_links(), which creates fwnode links from DEV_PROP_REF
     properties to enable automatic probe ordering. Add kunit-managed fwnode
     helpers and test coverage.
 
   - Fix infinite loop in fwnode_for_each_child_node() when the secondary fwnode
     has more than one child. Add test cases.
 
   - Fix out-of-bounds access in software_node_get_reference_args() when called
     with index -1 (UINT_MAX).
 
   - Refactor to use RAII approach with __free().
 
   - Add Bartosz Golaszewski as software node reviewer.
 
 - firmware loader:
 
   - Fix race where a sysfs fallback request can complete before being queued as
     pending, leading to a use-after-free on the next fallback request.
 
   - Reject 0-size built-in firmware and fail the build on empty firmware files
     in CONFIG_EXTRA_FIRMWARE.
 
 - kobject:
 
   - Provide __KOBJ_ATTR() and __KOBJ_ATTR_RO/WO() initialization macros and
     allow the constification of kobject attributes, enabling them to reside in
     read-only memory.
 
 - platform:
 
   - Provide platform_device_set_of_node(), platform_device_set_fwnode(), and
     platform_device_set_of_node_from_dev() helpers that encapsulate firmware
     node reference counting for dynamically allocated platform devices. Convert
     all in-tree users that manually assigned dev.of_node or dev.fwnode, fixing a
     pre-existing refcount bug in powermac.  Switch to counting references of all
     firmware node types, not only OF nodes.
 
   - Unify the release path for dynamically allocated platform devices by
     removing platform_device_release_full(). Amend the fwnode setter API
     contract to warn if a primary software node is overwritten. Add KUnit tests
     for correct software node removal on device unregistration.
 
 - Rust:
 
   - Auxiliary:
 
     - Add registration_data_with() closure-based API for invariant ForLt types.
 
   - Debugfs:
 
     - Migrate BinaryWriter and BinaryReaderMut trait requirements from
       kernel::transmute traits to zerocopy traits.
 
   - Device:
 
     - Add BoundInternal device context and InternalBoundContext trait for bus
       abstractions that need internal access to a bound device.
 
     - Make the lifetime on Core and CoreInternal invariant to prevent coercion
       to shorter lifetimes.
 
   - Devres:
 
     - Fix race between concurrent revokers where the losing revoker could return
       before the winning revoker finished dropping the inner data, causing
       use-after-free.
 
     - Ensure revocation is complete before the device finishes unbinding by
       making the synchronization bidirectional.
 
     - Add DevresLt<F: ForLt>, a wrapper around Devres that shortens 'static back
       to the caller's borrow scope. Implement ForLt and CovariantForLt for Bar,
       IoMem, and ExclusiveIoMem.
 
   - Driver:
 
     - Switch from index-based to pointer-based device ID info lookup, storing
       static references in driver_data. Centralize device ID handling in
       device_id.rs, removing the open-coded ACPI/OF matching logic and duplicate
       ID table from driver.rs.
 
   - I/O:
 
     - Make I/O regions typed (with a dynamically-sized Region type for the
       existing untyped case), create view types representing subregions of a
       mapped I/O region, and add io_project!() for safely creating subviews.
 
     - Split Io into a base trait (IoBase) and an extension trait (Io) with a
       blanket implementation, preventing implementers from overriding provided
       methods that unsafe code relies on.
 
     - Add a SysMem backend for shared system memory with volatile access, and
       make Coherent implement Io via an I/O view type.  Add IoSysMap as sum type
       of Mmio and SysMem. Add copying methods (memcpy_{from,to}io()) and
       read_val()/write_val() for typed access.
 
     - Replace dma_read!()/dma_write!() with io_read!()/io_write!() for
       primitives and copying methods for aggregates; drop the old macros.
       Convert nova-core to use I/O projection.
 
     - Fix internal shortcut rule dispatch in the register!() macro, remove
       unused rule arguments, and use path fragments for alias destinations.
 
   - IRQ:
 
     - Make irq::Registration compatible with lifetime-bound drivers by
       removing the 'static bound on Handler/ThreadedHandler and
       replacing Devres<RegistrationInner> with direct
       request_irq()/free_irq() calls.  Handlers can now directly own
       lifetime-bound device resources.
 
   - PCI:
 
     - Convert IrqVectorRegistration to a lifetime-annotated owning type,
       giving drivers explicit control over the allocation lifetime.
       IrqVector embeds a resolved IrqRequest, making the conversion
       infallible. Remove the redundant
       request_irq()/request_threaded_irq() wrappers from pci::Device.
 
     - Add pci_irq_type() C helper and expose it via irq_type() on
       IrqVectorRegistration and IrqVector, returning PCI_IRQ_MSIX, PCI_IRQ_MSI,
       or PCI_IRQ_INTX.
 
     - Mark pci::Device refcount methods inline.
 
   - Serdev:
 
     - Add Rust abstractions for the serial device bus, including serdev::Driver
       trait, serdev::Device wrapping struct serdev_device, and serdev::Adapter
       implementing RegistrationOps.  Includes a sample driver. Markus Probst
       takes over as serdev maintainer for both C and Rust code.
 
   - Misc:
 
     - Split ForLt into a base trait (providing the Of<'a> GAT) and an unsafe
       CovariantForLt subtrait guaranteeing covariance, enabling invariant types
       (e.g. those containing Mutex<&'bound T>) to participate in the ForLt
       abstraction.
 
     - Fix Coherent read past EOF returning -ERANGE instead of zero.
 
     - Fix firmware example UB by avoiding null-pointer ARef.
 
 - misc:
 
   - Avoid iattr allocation in kernfs listxattr by using kernfs_iattrs_noalloc().
   - Unregister SoC bus on early device registration failure.
   - Remove unused DMA_FENCE_TRACE Kconfig symbol.
   - Fix /sys/module path in comment.
   - Refactor ISA bus init to remove nested blocks.
   - Remove redundant nodemask clears in numa_init().
   - Add kernel-doc for fwnode_operations and sys_soc.h, mark internal property
     data as private for kernel-doc, and add property.h/fwnode.h to driver-api
     infrastructure docs.
   - Add MAINTAINERS entry for sys_soc.h.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCaoSPugAKCRBFlHeO1qrK
 LlBrAP958EaYZVyfAsqq0EyHv86ahXKWoDDvkwbRUZA5CfV9tAD/bMWVtPLRYaaq
 eNEZT7p5w3Haezh61H3c5zpuwFNMTA0=
 =VRIa
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core updates from Danilo Krummrich:
 "container_of:

   - Apply typeof_member(), remove the local __mptr variable to
     eliminate variable shadowing warnings on nested container_of()
     calls, and remove unnecessary parentheses

  core:

   - Add driver name to probe debug print for initcall_debug

   - Avoid repeatedly printing the same 'Fixed dependency cycle' log

   - Unwind device_add() on attribute creation failure in
     attribute_container_add_class_device()

   - Remove statistics group if encryption group creation fails in
     transport_add_class_device()

  debugfs:

   - Fix lockdown check for mmap_prepare()

   - Warn if file creation failed due to uninitialized debugfs

  device property:

   - Implement fw_devlink support for software nodes by adding
     software_node_add_links(), which creates fwnode links from
     DEV_PROP_REF properties to enable automatic probe ordering. Add
     kunit-managed fwnode helpers and test coverage

   - Fix infinite loop in fwnode_for_each_child_node() when the
     secondary fwnode has more than one child. Add test cases

   - Fix out-of-bounds access in software_node_get_reference_args() when
     called with index -1 (UINT_MAX)

   - Refactor to use RAII approach with __free()

   - Add Bartosz Golaszewski as software node reviewer

  firmware loader:

   - Fix race where a sysfs fallback request can complete before being
     queued as pending, leading to a use-after-free on the next fallback
     request

   - Reject 0-size built-in firmware and fail the build on empty
     firmware files in CONFIG_EXTRA_FIRMWARE

  kobject:

   - Provide __KOBJ_ATTR() and __KOBJ_ATTR_RO/WO() initialization macros
     and allow the constification of kobject attributes, enabling them
     to reside in read-only memory

  platform:

   - Provide platform_device_set_of_node(), platform_device_set_fwnode(),
     and platform_device_set_of_node_from_dev() helpers that encapsulate
     firmware node reference counting for dynamically allocated platform
     devices

     Convert all in-tree users that manually assigned dev.of_node or
     dev.fwnode, fixing a pre-existing refcount bug in powermac. Switch
     to counting references of all firmware node types, not only OF
     nodes

   - Unify the release path for dynamically allocated platform devices
     by removing platform_device_release_full(). Amend the fwnode setter
     API contract to warn if a primary software node is overwritten. Add
     KUnit tests for correct software node removal on device
     unregistration

  Rust:

   - Auxiliary:
       - Add registration_data_with() closure-based API for invariant
         ForLt types

   - Debugfs:
       - Migrate BinaryWriter and BinaryReaderMut trait requirements
         from kernel::transmute traits to zerocopy traits

   - Device:
       - Add BoundInternal device context and InternalBoundContext trait
         for bus abstractions that need internal access to a bound
         device.
       - Make the lifetime on Core and CoreInternal invariant to prevent
         coercion to shorter lifetimes

   - Devres:
       - Fix race between concurrent revokers where the losing revoker
         could return before the winning revoker finished dropping the
         inner data, causing use-after-free.
       - Ensure revocation is complete before the device finishes
         unbinding by making the synchronization bidirectional.
       - Add DevresLt<F: ForLt>, a wrapper around Devres that shortens
         'static back to the caller's borrow scope. Implement ForLt and
         CovariantForLt for Bar, IoMem, and ExclusiveIoMem

   - Driver:
       - Switch from index-based to pointer-based device ID info lookup,
         storing static references in driver_data. Centralize device ID
         handling in device_id.rs, removing the open-coded ACPI/OF
         matching logic and duplicate ID table from driver.rs

   - I/O:
       - Make I/O regions typed (with a dynamically-sized Region type
         for the existing untyped case), create view types representing
         subregions of a mapped I/O region, and add io_project!() for
         safely creating subviews.
       - Split Io into a base trait (IoBase) and an extension trait (Io)
         with a blanket implementation, preventing implementers from
         overriding provided methods that unsafe code relies on.
       - Add a SysMem backend for shared system memory with volatile
         access, and make Coherent implement Io via an I/O view type.
         Add IoSysMap as sum type of Mmio and SysMem. Add copying
         methods (memcpy_{from,to}io()) and read_val()/write_val() for
         typed access.
       - Replace dma_read!()/dma_write!() with io_read!()/io_write!()
         for primitives and copying methods for aggregates; drop the old
         macros. Convert nova-core to use I/O projection.
       - Fix internal shortcut rule dispatch in the register!() macro,
         remove unused rule arguments, and use path fragments for alias
         destinations

   - IRQ:
       - Make irq::Registration compatible with lifetime-bound drivers
         by removing the 'static bound on Handler/ThreadedHandler and
         replacing Devres<RegistrationInner> with direct
         request_irq()/free_irq() calls. Handlers can now directly own
         lifetime-bound device resources

   - PCI:
       - Convert IrqVectorRegistration to a lifetime-annotated owning
         type, giving drivers explicit control over the allocation
         lifetime. IrqVector embeds a resolved IrqRequest, making the
         conversion infallible. Remove the redundant
         request_irq()/request_threaded_irq() wrappers from pci::Device.
       - Add pci_irq_type() C helper and expose it via irq_type() on
         IrqVectorRegistration and IrqVector, returning PCI_IRQ_MSIX,
         PCI_IRQ_MSI, or PCI_IRQ_INTX.
       - Mark pci::Device refcount methods inline

   - Serdev:
       - Add Rust abstractions for the serial device bus, including
         serdev::Driver trait, serdev::Device wrapping struct
         serdev_device, and serdev::Adapter implementing
         RegistrationOps. Includes a sample driver. Markus Probst takes
         over as serdev maintainer for both C and Rust code

   - Misc:
       - Split ForLt into a base trait (providing the Of<'a> GAT) and an
         unsafe CovariantForLt subtrait guaranteeing covariance,
         enabling invariant types (e.g. those containing Mutex<&'bound T>)
         to participate in the ForLt abstraction.
       - Fix Coherent read past EOF returning -ERANGE instead of zero.
       - Fix firmware example UB by avoiding null-pointer ARef

  misc:
   - Avoid iattr allocation in kernfs listxattr by using
     kernfs_iattrs_noalloc().
   - Unregister SoC bus on early device registration failure.
   - Remove unused DMA_FENCE_TRACE Kconfig symbol.
   - Fix /sys/module path in comment.
   - Refactor ISA bus init to remove nested blocks.
   - Remove redundant nodemask clears in numa_init().
   - Add kernel-doc for fwnode_operations and sys_soc.h, mark
     internal property data as private for kernel-doc, and add
     property.h/fwnode.h to driver-api infrastructure docs.
   - Add MAINTAINERS entry for sys_soc.h"

* tag 'driver-core-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: (129 commits)
  rust: pci: expose the allocated interrupt type
  PCI: Add pci_irq_type() to query the allocated interrupt type
  rust: pci: remove request_irq() and request_threaded_irq() from Device
  rust: pci: resolve IRQ in index() and embed IrqRequest in IrqVector
  rust: pci: convert IrqVectorRegistration to a lifetime-managed owning type
  kernfs: avoid iattr allocation in listxattr
  rust: serdev: use ThisModule::as_ptr() instead of field access
  ACPI/IORT: use platform_device_set_fwnode()
  ACPI/APMT: use platform_device_set_fwnode()
  firmware_loader: do not queue completed sysfs fallback requests
  rust: pci: Mark Device refcount methods inline
  rust: irq: make Registration compatible with lifetime-bound drivers
  rust: net/phy: remove expansion from doc
  rust: dma: return zero for Coherent reads past EOF
  rust: io: register: use path fragment for alias destination
  rust: io: register: remove unused rule arguments
  rust: io: register: dispatch shortcut rules internally
  MAINTAINERS: add sys_soc.h to DRIVER CORE
  rust: debugfs: remove unsafe blocks from traits impl for Vec
  rust: debugfs: migrate debugfs traits requirements to zerocopy
  ...
2026-08-19 10:42:18 -07:00
Linus Torvalds
cbe8aadf15 soc: devicetree updates for 7.3
There are two new mystery SoCs with very little public information
 about them so far, Qualcomm's Cortex-A78C based "Shikra" and
 Altera's Cortex-A720 based Agilex72 SOCFPGA.
 
 We have also gained support for a couple of SoCs from the
 2023/2024 timeframe that have been in the making for a while:
 
  - The Apple platform gains support for M3 Pro, Max and Ultra SoC,
    following the basic M3 support from 7.2.
 
  - Samsung Exynos 1580 is a high-end mobile phone SoC from 2024
 
  - Canaan K230 is a RISC-V based 64-bit AI SoC, based on the
    earlier K210 chip
 
  - Sophgo SG2000 is a mixed Arm/RISC-V chip that was already
    supported using the Arm core but is now also added for RISC-V
    along with several other variants of the cv18xx series
 
 In terms of newly added machines we have reference platforms
 for all the chips above, plus
 
  - only four 32-bit Arm boards: two older phones and two
    older industrial/embedded boards; using Allwinner, Qualcomm and
    Rockchip SoCs
 
  - Three laptops und three phones using Qualcomm SoCs
 
  - Ten 64-bit Rockchips based single-board computers, along with one
  NAS box and a game console.
 
  - Seven industrial/embedded boards and modules using NXP i.MX8/9 SoCs.
 
  - A Lenovo desktop box based on NVIDIA Jetson Xavier NX
 
  - A few more single-board computers based on Allwinnner A133,
    Spacemit K1 and TI AM62.
 
 As usual, there is a constant stream of minor cleanups and fixes
 towards addressing the 'dt-check-style --mode strict' warnings,
 and everyone is expected to address those warnings for new
 submissions now.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmqDZaMACgkQmmx57+YA
 GNkkiRAAusVNTkNVcpq+QGDhd6DfLd+d4vcvTJkBZ5WyJuqKs1qZPFIMQ0iMW1cY
 hahBeYoowRX1oaB7KZc/MBE0IkOna35CEwiL6dm553xq+P208auqpNLpXTSKWsvx
 jW4eYpdA6Bt6SM9J/583Ix71b5UFsLV+W3YKT2CBUZYn9yilAEz6kPa/Hxxa1Sia
 3841Fdy6jcqusw1alzLQvrR7FxdtPFCs1f/a/GzBmZI7fxnj/cBwVghinSF9F0XW
 BzDaUjMDzBYqSlMb7auNH0IpDeVuTx2Pch+YLrE8YVVPVf3nawd48ziwXO6zRsGx
 HccLDuHpBqwnHsAh+bWi9UdxUSzjGW4KQ/W8Fj6O2SNqxPqrK2hyRYMp+76Tl65x
 2diQOajmnZ4m8E5ToWsxpRxrlo6TKo33W63HglGIA24vr0gEi9FpA3kYiaWP2ZBD
 qZz5xMeRmO1son1vtWX1CzsWFdogqBuGdztOyMoY4viSeY/ltT1EvIC0AiTIeSOt
 krOFFDxwHvu+HOPJJ15VCVwEutUnGytB2nwBc/krhNS6MSlwg9DpY53RAhBxl0Jh
 KXpPqBUpbl0Flty2rxdPx2EAt7MqeLTNXSSdzP7tvvumsT1Ik+zlPk+MkgLZ0Y5u
 71fJrcij+0LeFDCzw81jGLoYSCw+9aNaELcF+OluL6rK8YFaBOE=
 =RQan
 -----END PGP SIGNATURE-----

Merge tag 'soc-dt-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC devicetree updates from Arnd Bergmann:
 "There are two new mystery SoCs with very little public information
  about them so far, Qualcomm's Cortex-A78C based "Shikra" and Altera's
  Cortex-A720 based Agilex72 SOCFPGA.

  We have also gained support for a couple of SoCs from the 2023/2024
  timeframe that have been in the making for a while:

   - The Apple platform gains support for M3 Pro, Max and Ultra SoC,
     following the basic M3 support from 7.2.

   - Samsung Exynos 1580 is a high-end mobile phone SoC from 2024

   - Canaan K230 is a RISC-V based 64-bit AI SoC, based on the earlier
     K210 chip

   - Sophgo SG2000 is a mixed Arm/RISC-V chip that was already supported
     using the Arm core but is now also added for RISC-V along with
     several other variants of the cv18xx series

  In terms of newly added machines we have reference platforms for all
  the chips above, plus

   - Only four 32-bit Arm boards: two older phones and two older
     industrial/embedded boards; using Allwinner, Qualcomm and Rockchip
     SoCs

   - Three laptops und three phones using Qualcomm SoCs

   - Ten 64-bit Rockchips based single-board computers, along with one
     NAS box and a game console.

   - Seven industrial/embedded boards and modules using NXP i.MX8/9
     SoCs.

   - A Lenovo desktop box based on NVIDIA Jetson Xavier NX

   - A few more single-board computers based on Allwinnner A133,
     Spacemit K1 and TI AM62.

  As usual, there is a constant stream of minor cleanups and fixes
  towards addressing the 'dt-check-style --mode strict' warnings, and
  everyone is expected to address those warnings for new submissions
  now"

* tag 'soc-dt-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (864 commits)
  Revert "riscv: dts: spacemit: k3: add i2s0-i2s5 nodes"
  Documentation/process: maintainer-soc: Mention expectation about dt-check-style
  ARM: dts: helios4: add SATA regulator supplies
  ARM: dts: helios4: add vcc-supply to GPIO expander
  ARM: dts: helios4: add vcc-supply to EEPROM
  arm64: dts: turris-mox: fix usb3 phys
  arm64: dts: ti: Correct white-space style
  arm64: dts: ti: k3-am64: Fix MDIO clock reference for ICSSG0 node
  arm64: dts: qcom: talos-evk: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: sa8155p-adp: Fix swapped USB and UFS QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: eliza-mtp: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: lemans: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: glymur: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: kaanapali: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: sar2130p: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: sm8750: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: sm8650: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: purwa: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: hamoa: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  arm64: dts: qcom: sc8180x: Fix swapped USB QMP PHY vdda-phy/vdda-pll supplies
  ...
2026-08-18 19:36:32 -07:00
Linus Torvalds
8dcef8882a x86/msr updates for v7.3:
- Streamline the x86 MSR handling APIs along the 64-bit
    variants, simplifying the interfaces. Removal of the
    old APIs is planned for the next cycle, to reduce
    churn & integration pain. (Juergen Gross)
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmqC3qYRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1jSOA//cTRslNJ4t3g2cR8iPDFXsjMmwsvpDJn1
 OVqOlyFcQpJCliC37JmRA94B6RufVdoFikOuyshn4SaPix8+lUKZDt+c5N6wfZsI
 NJ4zuCHD4k0tDhHCYXihEISBAGUJrHk+6eiNTxDTlCUhCxqLvX1W1L0fiB4R2w0h
 /Z1ZfL0Om6QV/V8u7lC8Vio0Uxp12Zjm60I43QBsUTOoD+4poaGGORV+03lnGnaZ
 eaq9VRZKrrx6h3K5hS1Ja6j6mWehQzWabn3v5cM15IwYNuVA4g38OKR8ofqk0Shz
 DvCILEtjoT7mXfvGoxYTSuEEa5aJoTSplMVbsrRuXHtcwDplnCGxCnYE0pYCfpFD
 4xzvBBm15X20M0CFFW3lvJKqyN43M+Wfh/aOG0AT8BmIPKuyzZgc9yJ/QxmS4dYY
 5atebSCK+caKr8IXshTTvssEWGF1A6un/0lOfuS2BmdIZuREYxzKWF3sqp3f10Gx
 hSm1xB5HRhoQCIFP3PGER8bwwea0UmjI9VWHEkBKfNadqz3OPEZf4PQNiWJ3Q6x0
 T7EGOWJlZTzCH2iqGrzPY0g56pPoDwGzjIruAmhc5NMFEOIHy0MKyPw4huWKSSzB
 WVpqi8Gnn0HS3dECOnvkDpNM0JXDp9XYSaL5mLs/ZgWPIwJ6fFHbY34xm3A+Cjdp
 hGYmT3Mtx1A=
 =QBg3
 -----END PGP SIGNATURE-----

Merge tag 'x86-msr-2026-08-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 MSR updates from Ingo Molnar:

 - Streamline the x86 MSR handling APIs along the 64-bit variants,
   simplifying the interfaces.

   Removal of the old APIs is planned for the next cycle, to reduce
   churn & integration pain (Juergen Gross)

* tag 'x86-msr-2026-08-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
  x86/mce: Work around build warning after MSR-interface switch
  cpufreq: Stop using 32-bit MSR interfaces
  x86/featctl: Stop using 32-bit MSR interfaces
  KVM/x86: Stop using 32-bit MSR interfaces
  x86/mtrr: Stop using 32-bit MSR interfaces
  acpi: Stop using 32-bit MSR interfaces
  powercap: Stop using 32-bit MSR interfaces
  thermal/intel: Stop using 32-bit MSR interfaces
  x86/olpc: Stop using 32-bit MSR interfaces
  x86/hyperv: Stop using 32-bit MSR interfaces
  hwmon: Stop using 32-bit MSR interfaces
  EDAC: Stop using 32-bit MSR interfaces
  x86/cpu: Stop using 32-bit MSR interfaces
  x86/apic: Stop using 32-bit MSR interfaces
  x86/resctrl: Stop using 32-bit MSR interfaces
  x86/tsc: Stop using 32-bit MSR interfaces
  x86/amd: Stop using 32-bit MSR interfaces
  x86/pci: Stop using 32-bit MSR interfaces
  x86/hygon: Stop using 32-bit MSR interfaces
  x86/mce: Stop using 32-bit MSR interfaces
  ...
2026-08-18 14:02:15 -07:00
Linus Torvalds
a5778046a0 Power management updates for 7.3-rc1
- Minor fixes and cleanups in assorted cpufreq drivers (Dan Carpenter,
    Guru Das Srinagesh, Haoxiang Li, Karl Mehltretter, Sasha Finkelstein,
    and Pan Chuang)
 
  - Fix cpufreq table creation and bios_limits() callback in the Rust
    bindings (Priya Bala Govindasamy)
 
  - Add IPQ5210 support to qcom-nvmem driver (Varadarajan Narayanan)
 
  - Adjust the .adjust_perf() cpufreq driver callback to allow the
    maximum performance value to be passed to drivers and update the
    intel_pstate driver to use it (Rafael Wysocki)
 
  - Set policy->cur to the actual requested frequency in the intel_pstate
    driver when the performance policy is used (Rafael Wysocki)
 
  - Simplify HWP handling on Broadwell processors in intel_pstate (Rafael
    Wysocki)
 
  - Fix setting minimum P-state at init time in intel_pstate (Rafael
    Wysocki)
 
  - Consolidate frequency values computation in intel_pstate and clean up
    code in that driver (Rafael Wysocki)
 
  - Add missing kernel-doc descriptions for structure and union members
    in the amd-pstate driver (David Vernet)
 
  - Handle missing policy in dynamic EPP callbacks in the amd-pstate
    driver (EDAMAMEX)
 
  - Introduce EXPORT_SYMBOL_FOR_PSTATE_UT() to export amd-pstate driver
    symbols to the amd-pstate-ut subdriver (K Prateek Nayak)
 
  - Add dynamic EPP as an "energy_performance_preference" mode in
    amd-pstate, remove the "amd_dynamic_epp" kernel command line option
    and the "dynamic_epp" sysfs attribute, and update the dynamic_epp
    documentation accordingly (K Prateek Nayak)
 
  - Add unit tests for CPPC Performance Priority and the "dynamic" EPP
    mode in the amd-pstate driver (K Prateek Nayak)
 
  - Set min_limit_freq based on bios_min_perf in amd-pstate and remove
    the defensive check for bios_min_perf from it (K Prateek Nayak)
 
  - Fix EPP return type and handle errors in amd-pstate during
    initialization, toggle auto_sel in active mode on shared memory
    systems, and cache the firmware programmed EPP value (Marco Scardovi)
 
  - Skip tests in amd-pstate-ut if the amd-pstate driver is not in active
    use (Qianheng Peng)
 
  - Replace sprintf() with sysfs_emit() in sysfs show in the cpufreq
    schedutil governor and fix a self-contradictory comment in
    sugov_iowait_apply() (Zhongqiu Han)
 
  - Fix the usage example for the sampling_rate tunable of the ondemand
    cpufreq governor in admin-guide (wangxiaodong)
 
  - Avoid using deep idle states during initialization in the intel_idle
    driver to work around device handling issues (Rafael Wysocki)
 
  - Fix and refactor the ACPI processor driver code related to ACPI _LPI
    support and add ACPI _LPI support to intel_idle based on that ACPI
    processor driver update (Rafael Wysocki)
 
  - Backup and restore governor for cpufreq sptests (Yiwei Lin)
 
  - Remove unnecessary sudo from quick_shuffle() and remove unused local
    variables from switch_show_governor() in cpufreq selftests (Jinseok
    Kim)
 
  - Rename the PM core module parameter prefix to "pm" and allow the PM
    transition (DPM) watchdog to be disabled by default (Tzung-Bi Shih)
 
  - Fix off-by-one in wakelocks number limit check in the system sleep
    sysfs interface (Haowen Tu)
 
  - Remove kernel-doc markings from helper descriptions in the core
    hibernation code (Adi Nata)
 
  - Use %pe to print error pointer values in the hibernation core (Ronan
    Marchal)
 
  - Fix memory leak in snapshot_write_next() error path (Malaya Kumar
    Rout)
 
  - Delay allocating and linking the next swap_map_page in the
    hibernation image saving code until another image page actually
    needs to be recorded (Haesung Kim)
 
  - Fix cleanup ordering around scope-based pointers in OPP (Gregor
    Herburger).
 
  - Use clk_get_optional() for optional clocks in OPP (Praveen Talari).
 
  - Stop setting runtime_error on runtime resume callback failures to
    allow drivers to recover from resume issues (Praveen Talari)
 
  - Handle PMU registration failure during probe in the intel_rapl_tpmi
    driver (Sumeet Pawnikar)
 
  - Avoid optional imports in intel_pstate_tracer unless they are really
    needed (Yousef Alhouseen)
 
  - Add generic CPPC performance display to the cpupower utility, build
    and call CPPC information on non-AMD processors, make cpupower print
    kernel and hardware frequency information, and add libm to cpupower
    for generic CPPC view (Jeremy Linton)
 
  - Remove conditional return with no effect from cpupower (Sang-Heon
    Jeon)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmp+DXsSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO10Z4IAIYwM9RKwbwCqPMKGvWExIb+1kpEy1aw
 wyFnYSiQd09XCt8/YjERFR9gB7CfGduisTxEOqOdCIpGX2rT9Me5xO5aR5Gz4FE3
 bML7KyulS9tVyaEVBjFx1yDZxGTNooTQVTLIxBYbCVB1RrgiCGdLyC2okn79XHlk
 olTZemq59Kn0B6t7BP7UQ0WCCCAs3RlbrQIZSrVh0HydoO0DHlJvttN2fc7bjeiM
 Je/dSm14o+vjglkVpY1kbxzBHJOH7/XH5nqSQRoHoAZWdllWK4+iQtll63Un4A72
 2KG0O5+nFrS3d166TEjDEInnEwR012Sod/8Gk72M0IZZhG/naqs5ekE=
 =mn7E
 -----END PGP SIGNATURE-----

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

Pull power management updates from Rafael Wysocki:
 "As has been the case for quite some time, this set of changes is
  dominated by cpufreq updates including intel-pstate and amd-pstate
  driver updates, minor fixes and cleanups of other assorted cpufreq
  drivers, schedutil governor updates, fixes of the Rust bindings, new
  hardware support (IPQ5210 in qcom-nvmem), and some updates of self
  tests related to cpufreq.

  The second largest group of changes are cpuidle updates consisting of
  intel_idle driver updates and ACPI processor idle driver updates, both
  mostly related to ACPI _LPI support.

  There are also updates related to system sleep, mostly in the
  hibernation core code, two operating performance points (OPP) updates,
  one runtime PM framework update, one power capping update, and some
  tools updates including the addition of ACPI CPPC support to cpupower.

  Specifics:

   - Minor fixes and cleanups in assorted cpufreq drivers (Dan
     Carpenter, Guru Das Srinagesh, Haoxiang Li, Karl Mehltretter, Sasha
     Finkelstein, and Pan Chuang)

   - Fix cpufreq table creation and bios_limits() callback in the Rust
     bindings (Priya Bala Govindasamy)

   - Add IPQ5210 support to qcom-nvmem driver (Varadarajan Narayanan)

   - Adjust the .adjust_perf() cpufreq driver callback to allow the
     maximum performance value to be passed to drivers and update the
     intel_pstate driver to use it (Rafael Wysocki)

   - Set policy->cur to the actual requested frequency in the
     intel_pstate driver when the performance policy is used (Rafael
     Wysocki)

   - Simplify HWP handling on Broadwell processors in intel_pstate
     (Rafael Wysocki)

   - Fix setting minimum P-state at init time in intel_pstate (Rafael
     Wysocki)

   - Consolidate frequency values computation in intel_pstate and clean
     up code in that driver (Rafael Wysocki)

   - Add missing kernel-doc descriptions for structure and union members
     in the amd-pstate driver (David Vernet)

   - Handle missing policy in dynamic EPP callbacks in the amd-pstate
     driver (EDAMAMEX)

   - Introduce EXPORT_SYMBOL_FOR_PSTATE_UT() to export amd-pstate driver
     symbols to the amd-pstate-ut subdriver (K Prateek Nayak)

   - Add dynamic EPP as an "energy_performance_preference" mode in
     amd-pstate, remove the "amd_dynamic_epp" kernel command line option
     and the "dynamic_epp" sysfs attribute, and update the dynamic_epp
     documentation accordingly (K Prateek Nayak)

   - Add unit tests for CPPC Performance Priority and the "dynamic" EPP
     mode in the amd-pstate driver (K Prateek Nayak)

   - Set min_limit_freq based on bios_min_perf in amd-pstate and remove
     the defensive check for bios_min_perf from it (K Prateek Nayak)

   - Fix EPP return type and handle errors in amd-pstate during
     initialization, toggle auto_sel in active mode on shared memory
     systems, and cache the firmware programmed EPP value (Marco
     Scardovi)

   - Skip tests in amd-pstate-ut if the amd-pstate driver is not in
     active use (Qianheng Peng)

   - Replace sprintf() with sysfs_emit() in sysfs show in the cpufreq
     schedutil governor and fix a self-contradictory comment in
     sugov_iowait_apply() (Zhongqiu Han)

   - Fix the usage example for the sampling_rate tunable of the ondemand
     cpufreq governor in admin-guide (wangxiaodong)

   - Avoid using deep idle states during initialization in the
     intel_idle driver to work around device handling issues (Rafael
     Wysocki)

   - Fix and refactor the ACPI processor driver code related to ACPI
     _LPI support and add ACPI _LPI support to intel_idle based on that
     ACPI processor driver update (Rafael Wysocki)

   - Backup and restore governor for cpufreq sptests (Yiwei Lin)

   - Remove unnecessary sudo from quick_shuffle() and remove unused
     local variables from switch_show_governor() in cpufreq selftests
     (Jinseok Kim)

   - Rename the PM core module parameter prefix to "pm" and allow the PM
     transition (DPM) watchdog to be disabled by default (Tzung-Bi Shih)

   - Fix off-by-one in wakelocks number limit check in the system sleep
     sysfs interface (Haowen Tu)

   - Remove kernel-doc markings from helper descriptions in the core
     hibernation code (Adi Nata)

   - Use %pe to print error pointer values in the hibernation core
     (Ronan Marchal)

   - Fix memory leak in snapshot_write_next() error path (Malaya Kumar
     Rout)

   - Delay allocating and linking the next swap_map_page in the
     hibernation image saving code until another image page actually
     needs to be recorded (Haesung Kim)

   - Fix cleanup ordering around scope-based pointers in OPP (Gregor
     Herburger).

   - Use clk_get_optional() for optional clocks in OPP (Praveen Talari).

   - Stop setting runtime_error on runtime resume callback failures to
     allow drivers to recover from resume issues (Praveen Talari)

   - Handle PMU registration failure during probe in the intel_rapl_tpmi
     driver (Sumeet Pawnikar)

   - Avoid optional imports in intel_pstate_tracer unless they are
     really needed (Yousef Alhouseen)

   - Add generic CPPC performance display to the cpupower utility, build
     and call CPPC information on non-AMD processors, make cpupower
     print kernel and hardware frequency information, and add libm to
     cpupower for generic CPPC view (Jeremy Linton)

   - Remove conditional return with no effect from cpupower (Sang-Heon
     Jeon)"

* tag 'pm-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
  cpufreq: imx6q: fix out-of-bounds write when probed more than once
  cpufreq: imx6q: fix devres accumulation across driver rebind
  rust: cpufreq: Fix temporary write in Registration::bios_limit_callback
  rust: cpufreq: Add CPUFREQ_TABLE_END as last table entry in TableBuilder::to_table
  opp: Use clk_get_optional() to avoid leaving opp_table->clk as an error pointer
  intel_idle: Avoid using deep idle states during initialization
  cpupower: remove conditional return with no effect
  cpufreq: intel_pstate: Adjust policy->cur in active mode to policy
  cpufreq/amd-pstate: Document missing kernel-doc members
  cpufreq/amd-pstate-ut: Add unit test for CPPC Performance Priority
  cpufreq/amd-pstate-ut: Add unit test for "dynamic" EPP mode
  cpufreq/amd-pstate: Reduce the scope of exported symbols
  Documentation/amd-pstate: Update dynamic_epp documentation with new behavior
  cpufreq/amd-pstate: Remove "amd_dynamic_epp" cmdline and "dynamic_epp" sysfs
  cpufreq/amd-pstate: Add dynamic EPP as an "energy_performance_preference" mode
  cpufreq/amd-pstate: Extract platform profile to EPP conversion into a helper
  cpufreq/amd-pstate: Remove the defensive check for bios_min_perf
  cpufreq/amd-pstate: Set min_limit_freq based on bios_min_perf
  powercap: intel_rapl_tpmi: Handle PMU registration failure during probe
  PM: sleep: Allow disabling DPM watchdog by default
  ...
2026-08-18 08:47:09 -07:00
Rafael J. Wysocki
d657aa1b8e cpufreq: intel_pstate: Avoid using DESIRED_PERF when DEC is enabled
In principle, the desired performance level can be set in MSR_HWP_REQUEST
to indicate to the processor what performance level the OS would like
the given CPU to run at, but if the Dynamic Efficiency Control (DEC)
feature is enabled in the processor, doing so may result in confusing
the processor firmware.  It is then better to let the processor firmware
figure out the most suitable performance level by itself.

Accordingly, make intel_pstate always set the desired performance level
to zero (which means "no preference") when running on a platform with
DEC enabled.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/4758098.LvFx2qVVIh@rafael.j.wysocki
2026-08-15 19:10:48 +02:00
Rafael J. Wysocki
c659fa329e cpufreq: intel_pstate: Consolidate HWP P-states initialization
After previous changes, intel_pstate_hybrid_hwp_adjust() does not do
much and its name and kerneldoc comment (which is not really necessary
because the function is static) have become a bit confusing.  Moreover,
the initialization of P-states on systems with HWP enabled is divided
between it and a direct conditional statement branch in
intel_pstate_get_cpu_pstates() which is not super-easy to follow.

Address this by introducing intel_pstate_get_hwp_pstates() for the
entire HWP-specific initialization of P-states and moving the code from
intel_pstate_hybrid_hwp_adjust() into it along with some HWP-related
code from intel_pstate_get_cpu_pstates().

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/6021518.DvuYhMxLoT@rafael.j.wysocki
2026-08-15 19:08:20 +02:00
Danilo Krummrich
dbaafe9cc5 Linux 7.2-rc7
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmp49yoeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG1WIH/1SD1rNIb4Prf0C7
 Rk9Hz0IZ3uYNe1Xi+Ozv3zQUuLB6d7ewl9e4zyHHYT4eeIKvBZv9jtIF3QH4ty5X
 JB9Gy62WICtqIEkzzt2bkcV1byFmKz2+BLv04fgcyTXEGOEByCDiZ3/N3kSJOqvg
 YxsGOmKkQSTavFLSe96Gj2pgchJqZ6j3qucDO6GrPOo8depP2kfzxfaJbXix0HEZ
 ln08X9hgZDxy4I98PmSaaJsK2R/i6T6jQdA3i8DnSbbyNhLn+3FK6gkP08ZEpaor
 82WwJf+MVCLHXLYDy0aYOUDHpkNkkJWOj45A2Hv9JkOupGcUpyPGr82l4yh/MrxC
 +kM28xs=
 =rIbd
 -----END PGP SIGNATURE-----

Merge tag 'v7.2-rc7' into driver-core-next

We need the driver-core fixes in here as well to build on top of.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-10 01:20:05 +02:00
Alexandre Belloni
b981359d9e arm64: tegra: Device tree changes for v7.3-rc1
This contains a new device tree for the Lenove ThinkEdge SE70 Edge
 Client device as well as a number of fixes and cleanups for Tegra234 and
 Tegra194. Tegra264 sees a number of additions to enable more features.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmpvcb8ACgkQ3SOs138+
 s6EVRg//e3keeg7ehCUFVA8mDnGfxtIR5ErkU0I5LkCaQucREvHveHuNSayiNSM0
 DQVcqv3n/egea4Nnon+eH4ddpa0fosFUm0tW1agLdvhn41nKhiTg/vNcPUwqNE+p
 qw43rl5ecChZslW8l8+4eln9sRoTnxBKKlydu5aKKVQtpLbn23uZTwtlSwMWcduO
 0GjNOpvrjNyLWzGQ6lrO7uxRxrTHJPYm68Y/sVt38tZYHKC/Ksosy1/o0fKwJd4Q
 kMfk2lu1DxY6LGihNmNgpoITva0EaxtwDN1I4IO+dWLNq+feOrwCdTIaanycQPSw
 29COUfEcpblWvkRxd6ffWLwsAEk1ydR49FaJLgaAddb0ImEJfEeiaz8roAMqW24Q
 QEEDtSwg8JeC4dhWSgOqPOin328hiz3gEG3qYkP/Bi9NgCq2a0eVRlWfBOkgPI8u
 isGcVm1yfb2cxdgC26QWivLtuTxDNeHp/rcyGAinWrzd5FJFMvd/tn76inOS33X1
 U4shiIvnYDMh0j1VkvHa2ZvN1lqOTmbAGqHOF0iuCC2fhHuu6VW3/7j7wYgtv4gP
 Mp2dfVWEdj1Yp+iedS63XN+rFnEqMqw2733TkI1ThLzF3PXz0BO73QMvY+qAujlV
 8eLPr5091lXQKYCKCLx8AGBpLtXOFHzS1BxR/tr+OPWAutGFoXA=
 =qSTk
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-7.3-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt

arm64: tegra: Device tree changes for v7.3-rc1

This contains a new device tree for the Lenove ThinkEdge SE70 Edge
Client device as well as a number of fixes and cleanups for Tegra234 and
Tegra194. Tegra264 sees a number of additions to enable more features.

* tag 'tegra-for-7.3-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (1469 commits)
  arm64: tegra: Correct Tegra234 p3740 interrupt flags
  arm64: tegra: Correct Tegra234 p3737 interrupt flags
  arm64: tegra: Correct Tegra194 p2972 interrupt flags
  arm64: tegra: Drop CPU masks from GICv3 PPI interrupts
  arm64: tegra: Add Lenovo ThinkEdge SE70 device tree
  arm64: tegra: Add pinctrl nodes for Tegra264
  arm64: tegra: Fix CMDQV interrupt type on Tegra264
  arm64: tegra: Properly sort devices on Tegra264
  arm64: tegra: Add GTE nodes for Tegra264
  arm64: tegra: Add Host1x and VIC on Tegra264
  arm64: tegra: Populate CPU and L2 cache nodes on Tegra264
  arm64: tegra: Enable GPCDMA in Tegra264 and add iommu-map
  Linux 7.2-rc5
  super: fix emergency thaw deadlock on frozen block devices
  tracing: perf: Fix stale head for perf syscall tracing
  ftrace: Add global mutex to serialize trace_parser access
  tracing: Delay module ref count for "enable_event" trigger
  tracing: Fix use-after-free freeing trigger private data
  bpf, sockmap: Fix cork use-after-free in tcp_bpf_sendmsg()
  tracing: Fix context switch counter truncation
  ...

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2026-08-09 03:46:57 +02:00
Alexandre Belloni
0b02b8f941 RISC-V SpacemiT DT changes for 7.3
For K3 SoC
 - Enable SD card support
 - Enable QSPI
 - Fix reset delay of ETH PHY
 - Fix PHY ID of ETH
 - Symbolic PDAM ID
 - Add SPI controller support
 - Add USB and PHY support
 - Add I2S nodes
 
 For K1 SoC
 - Symbolic PDAM ID
 - Enable cpufreq support
 - Fix max CPU core voltage
 
 For boards of K3
 - Pico-ITX
   - Enable ALDPS on RTL8211F PHY
   - Disable 125MHz clock on RTL8211F PHY
   - Enable NOR flash
   - Add EEPROM support
 - CoM260
   - Add EEPROM support
 
 For boards of K1
 - Milk-V Jupiter
   - Enable CPU DVFS
 - Banana Pi BPI-CM6
   - Add initial support
 - OrangePi R2S
   - Enable PCIe
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQKvBAABCgCZFiEEtbq4ycMbcRVnAiPcMarqR1lNu+0FAmpupawbFIAAAAAABAAO
 bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
 Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCNUJBQjhDOUMzMUI3MTE1NjcwMjIz
 REMzMUFBRUE0NzU5NERCQkVEAAoJEDGq6kdZTbvtuDgP/0+IIPDo/U7U0IhT+dAx
 Mxr1fWX1M4h5nEmirD8Zsx8TSfvZrpZr5MvazjrHxZ5U2U4ntkqrcoByhIqEy6Dn
 wz3A8arOEe3BU1zXf4UAPAW0CZA3Bp9rEDgwbgsTfyelSLyeDqaMX8l/8XQLU8Sl
 f28L5p+5AQota4Cutl36yE/KP6cK+7SBSgXA2Rnb9SXzvwC9cQGuOUq71zUsS7jI
 FdpYcvyCbLFmUiq2XoeFAdGB04nYs28VWiFnHg7FNdrCqWH6pgi/zxd3QtlTxjd6
 oIrp/NsBnx9WAyx9GDhckpqOLt+sA49BjMTArBHmytVBI0ku2kbueQXJIS2J2OEq
 Cj4jkMD36Mbk21UP/3OOohARxPYWDDsRQ6NzvAMqNnmFdGa2lTCGA2pBsXF6pzYA
 cgFoSQq3s37ArNWaFxeCgnAnzyUWtEUEA3wcp+04xh4s9a90khxuU/rpF+GuyZwp
 5Bfppy9L9dI6BogmfAcMsVHcLd0UhDoC6nokx8QLCtrVKEnpvWHfAtWProzEINfX
 k9K+f+fLtvL4aWGevKfZZfbMwFRrDaARI03HqW/flUjLBVggoC2FFo63WOfEmvZr
 ldCmIWM2iDgr7gBTSy8FSX+3FNROyc2xDFhM189crVvK0+LCCMyqGhHFNnk6NYbU
 NRf7S+rwIN9yrBSUgrX6GCXs
 =WKqT
 -----END PGP SIGNATURE-----

Merge tag 'spacemit-dt-for-7.3-1' of https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux into soc/dt

RISC-V SpacemiT DT changes for 7.3

For K3 SoC
- Enable SD card support
- Enable QSPI
- Fix reset delay of ETH PHY
- Fix PHY ID of ETH
- Symbolic PDAM ID
- Add SPI controller support
- Add USB and PHY support
- Add I2S nodes

For K1 SoC
- Symbolic PDAM ID
- Enable cpufreq support
- Fix max CPU core voltage

For boards of K3
- Pico-ITX
  - Enable ALDPS on RTL8211F PHY
  - Disable 125MHz clock on RTL8211F PHY
  - Enable NOR flash
  - Add EEPROM support
- CoM260
  - Add EEPROM support

For boards of K1
- Milk-V Jupiter
  - Enable CPU DVFS
- Banana Pi BPI-CM6
  - Add initial support
- OrangePi R2S
  - Enable PCIe

* tag 'spacemit-dt-for-7.3-1' of https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux: (33 commits)
  riscv: dts: spacemit: Add cpu scaling for Milk-V Jupiter
  riscv: dts: spacemit: k1-bananapi-cm6: fix maximum CPU core voltage
  riscv: dts: spacemit: k1-orangepi-r2s: fix maximum CPU core voltage
  riscv: dts: spacemit: k1-musepi-pro: fix maximum CPU core voltage
  riscv: dts: spacemit: k1-orangepi-rv2: fix maximum CPU core voltage
  riscv: dts: spacemit: k1-milkv-jupiter: fix maximum CPU core voltage
  riscv: dts: spacemit: k1-bananapi-f3: fix maximum CPU core voltage
  riscv: dts: spacemit: Make dtschema recognize the etherent PHY correctly on K3 com260 board
  riscv: dts: spacemit: Make dtschema recognize the etherent PHY correctly on K3 pico-itx board
  riscv: dts: spacemit: k3: add i2s0-i2s5 nodes
  riscv: dts: spacemit: k3: add USB controller and USB phy support
  riscv: dts: spacemit: enable PCIe on OrangePi R2S
  riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1
  riscv: dts: spacemit: k3-com260: add eeprom on i2c2
  riscv: dts: spacemit: add SPI controllers for K3
  riscv: dts: spacemit: add K3 PDMA request numbers
  riscv: dts: spacemit: Fix phy id check for the phy on com260 board
  riscv: dts: spacemit: Fix phy id check for the phy on pico-itx board
  riscv: dts: spacemit: Add enough deassert time for the PHY on com260 board
  riscv: dts: spacemit: Add enough deassert time for the PHY on PICO ITX
  ...

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2026-08-08 18:51:39 +02:00
Rafael J. Wysocki
f4fa4b7c3f CPUFreq arm updates for 7.3
- Minor fixes / cleanups in cpufreq drivers (Dan Carpenter, Guru Das
   Srinagesh, Haoxiang Li, Karl Mehltretter, Sasha Finkelstein, and Pan
   Chuang).
 
 - Fix cpufreq table creation and bios_limits() callback in the Rust
   bindings (Priya Bala Govindasamy).
 
 - Add IPQ5210 support to qcom-nvmem driver (Varadarajan Narayanan).
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEx73Crsp7f6M6scA70rkcPK6BEhwFAmp0KYAACgkQ0rkcPK6B
 Ehxsow/+IrqGfGqroec6PCnK+oCSCgRTcgoXDk01A8lHH2yS9wHv08sW9r1yxCrY
 DVCgV5M8u2w/Q5/6Zop9JalliV8MVom5zlbeMnc5kgybH9ZRZWI0KhkMH9pNIBaI
 ZLlNjcldt7k/pZoRUhJSDEbMKAUZvb2t607UzcPLjBsibHdUil+KGrwT5GkaUnCu
 AkjXNRd3Tjt39NgRBzUhHvMAx4pUftw80G7ic+leKL+D9OAWsZUTMy9wyv/NoMIj
 jZwWr5knrYJn7nYiMgcc0+GCGsALOfwKCqsYscfhA6KoHmkkLxvyW/xH1e5uIUPT
 S3h6SDKzarTYfA5rTkxY0OD+ZacYrxGsXSvnakBWxqR4IW82XDIdWom66HteKJPE
 6bDFTnzOsdDpmTVJZVhZ2WljxcKrgQW95q8tNS3TuQOYHQNmtD4LnV11Zjvwwt5w
 pEL9QghiCfLg76Yf5pOafvifK+LYCCdteCYygImPBWc2Ih0XJX5KdV7fhTIPbSyS
 iaH/4bVgec7Sdkt8/bgW5qCyd/nXJpqx4KV9akp6lBMfEQtSiZ5fGOzAMtAOTaLS
 k03UC3H983uAVHzwD4d+nb5yeKm/0Xi7vxx9Lz9gCncyo+V6Oj2FefB38wkgO1Ou
 wu+CpqeOSBTjEEwR2HoL3Js6/cFKqGtP9RwsJC0eimBhJNNntr8=
 =9e9M
 -----END PGP SIGNATURE-----

Merge tag 'cpufreq-arm-updates-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm

Pull CPUFreq Arm updates for 7.3 from Viresh Kumar:

"- Minor fixes / cleanups in cpufreq drivers (Dan Carpenter, Guru Das
   Srinagesh, Haoxiang Li, Karl Mehltretter, Sasha Finkelstein, and Pan
   Chuang).

 - Fix cpufreq table creation and bios_limits() callback in the Rust
   bindings (Priya Bala Govindasamy).

 - Add IPQ5210 support to qcom-nvmem driver (Varadarajan Narayanan)."

* tag 'cpufreq-arm-updates-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  cpufreq: imx6q: fix out-of-bounds write when probed more than once
  cpufreq: imx6q: fix devres accumulation across driver rebind
  rust: cpufreq: Fix temporary write in Registration::bios_limit_callback
  rust: cpufreq: Add CPUFREQ_TABLE_END as last table entry in TableBuilder::to_table
  cpufreq: apple-soc: Calculate frequency as a 64-bit value
  cpufreq: spear: Fix an IS_ERR() vs NULL bug in spear1340_set_cpu_rate()
  cpufreq: brcmstb-avs: Remove redundant dev_err()
  rust: rcpufreq_dt: use vertical import style
  cpufreq: apple-soc: Fix OPP table cleanup
  cpufreq: qcom-nvmem: Add IPQ5210 support
2026-08-06 13:25:02 +02:00
Karl Mehltretter
8c3afcf27f cpufreq: imx6q: fix out-of-bounds write when probed more than once
imx6_soc_volt is allocated fresh on every probe, sized to the number of
ARM OPPs:

	imx6_soc_volt = devm_kcalloc(cpu_dev, num, sizeof(*imx6_soc_volt),
				     GFP_KERNEL);

but it is filled through soc_opp_count, which has static storage and is
never reset. A second bind after an unbind keeps indexing from where the
first one stopped, and writes past the end of the new array.

Unbinding and rebinding the driver on qemu's mcimx6ul-evk, under KASAN:

  BUG: KASAN: slab-out-of-bounds in imx6q_cpufreq_probe+0x3b0/0xa34
  Write of size 4 at addr c5e90480 by task binder/73
   imx6q_cpufreq_probe from platform_probe+0x88/0xe4
   platform_probe from really_probe+0x108/0x384
   bind_store from kernfs_fop_write_iter+0x1b4/0x28c

The write lands one u32 past the end of the allocation.

soc_opp_count is only read a few lines below the loop that fills it, so it
never needed static storage. Make it a local.

Fixes: b4573d1d65 ("cpufreq: imx6q: correct VDDSOC/PU voltage scaling when cpufreq is changed")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2026-08-06 11:54:41 +05:30
Karl Mehltretter
22c23c72c3 cpufreq: imx6q: fix devres accumulation across driver rebind
imx6_soc_volt is allocated with devm_kcalloc(cpu_dev, ...), where cpu_dev
is the CPU device from get_cpu_device(0). That device is never unbound, so
its devres list is never released, and imx6q_cpufreq_remove() does not free
the array either. Every probe therefore adds an allocation that stays for
the lifetime of the system.

Allocate against the platform device instead. Its devres is released when
the driver is unbound, which is exactly the lifetime the array wants:
imx6q_set_target() reads it, and nothing may reach that after
cpufreq_unregister_driver().

That makes the array actually go away on unbind, so also clear the
file-scope pointer in remove and on the failed-probe path, rather than
leave it pointing at memory devres is about to release.

Tested by rebinding the driver on qemu's mcimx6ul-evk.

Fixes: b4573d1d65 ("cpufreq: imx6q: correct VDDSOC/PU voltage scaling when cpufreq is changed")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2026-08-06 11:54:41 +05:30
Christian Loehle
df5a1d4a8c ACPI: CPPC: Reject desired_perf reads on _CPC revision 4+
When CPPC feedback counters cannot provide a usable sample, cppc-cpufreq
calls cppc_get_desired_perf() because some platforms repurpose Desired
Performance to report actual delivered performance.

ACPI 6.5 defines _CPC revision 3 and lists Read/Write as the Optional
Attribute of Desired Performance. ACPI 6.6 advances _CPC to revision 4 and
lists only Write, so invoking that workaround for revision 4 or later would
require a register read that the interface no longer specifies.

Make cppc_get_desired_perf() return -EOPNOTSUPP for _CPC revision 4 or
later. Use the revision retained in the per-CPU CPC descriptor rather than
the platform-wide FADT revision.

The _CPC revision may still not accurately describe the implemented
register semantics. If a nominally revision 3 platform implements a
non-readable Desired Performance register, a read may return zero and make
cppc_cpufreq_get_rate() report 0 kHz. Treat a zero read as unusable and
fall back to the cached OSPM request, just as for a failed read.

Fixes: c471956319 ("cppc_cpufreq: Use desired perf if feedback ctrs are 0 or unchanged")
Cc: stable@vger.kernel.org
Suggested-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/20260803203531.1268651-2-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-08-05 14:59:01 +02:00
Rafael J. Wysocki
eb49643e66 amd-pstate 7.3 content (07/30/26)
* Changes for dynamic EPP
 * Adjustments to the bios min perf feature
 * Fixes to kernel doc
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEECwtuSU6dXvs5GA2aLRkspiR3AnYFAmprwUITHHN1cGVybTFA
 a2VybmVsLm9yZwAKCRAtGSymJHcCdobfD/9dkDCf6Go6vAt31Z1PnnJfPKtl7+2n
 CzwKu5+Fx+/4nsJ/MiiDtQ5gJ6q9Pn0NA05vm6fuLhXznzAoWYExi+b3YRNWttyh
 0om7PZfrLWS6oCYl+DC/zu6cL8TBZJweqAEYcNBxRKAKXP5Icgpefrpj+lOW5asr
 YSl9b1cU2NboUksfWqfRGDmDCwKMKsBuZGlEMV8DgpnVJo0A2t8UmXCesUmd+hzP
 LOupRKZlVUkYHeHOGuRnwSkKMoSyzcJjW7oCbkZfLOTjM2KXZ3AEadyNG257H4U5
 PqGSA56EkDqycBuQzZKE6Ayz/mCWmNrB+jd/RjViARVNkUdNy+S8qafVuHEwG0RB
 L5rWef76BKvhK1dAVZ512cidWEfp4Rw2iDaF7o4LUDysCmThAI2VZ+e6uxs6We4R
 2Qe8l6KIxXt9bmf704q9jo62DKzdIve9PV5Y/WRcBft3NqvNmIu/VReIm29LqdDq
 3cYWODH3Lg0kVwaB1jY5n8XAEThhEnB1T4iVWJyfeAX+F4WuSRslM/8sJgdZG3uf
 kIkCbzMa3z5y7cASQCKdfQDzaxf6Vw7oX8c30UzZE5+PYcTuWuLQl6fclddXj1W7
 TEYG1NskvtgETTLA1QXb5JTJYNcGHvUwd+Ng5O7robQ7QSaUGvIw4uHUsLQXG9DI
 JvjxN/NNdJTRQg==
 =8o8O
 -----END PGP SIGNATURE-----

Merge tag 'amd-pstate-v7.3-2026-07-30' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux

Pull amd-pstate 7.3 content (07/30/26) from Mario Limonciello:

"* Changes for dynamic EPP
 * Adjustments to the bios min perf feature
 * Fixes to kernel doc"

* tag 'amd-pstate-v7.3-2026-07-30' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux:
  cpufreq/amd-pstate: Document missing kernel-doc members
  cpufreq/amd-pstate-ut: Add unit test for CPPC Performance Priority
  cpufreq/amd-pstate-ut: Add unit test for "dynamic" EPP mode
  cpufreq/amd-pstate: Reduce the scope of exported symbols
  Documentation/amd-pstate: Update dynamic_epp documentation with new behavior
  cpufreq/amd-pstate: Remove "amd_dynamic_epp" cmdline and "dynamic_epp" sysfs
  cpufreq/amd-pstate: Add dynamic EPP as an "energy_performance_preference" mode
  cpufreq/amd-pstate: Extract platform profile to EPP conversion into a helper
  cpufreq/amd-pstate: Remove the defensive check for bios_min_perf
  cpufreq/amd-pstate: Set min_limit_freq based on bios_min_perf
2026-07-31 19:36:04 +02:00
Rafael J. Wysocki
9e4cb21f29 cpufreq: intel_pstate: Adjust policy->cur in active mode to policy
Since arch_freq_get_on_cpu() on x86 falls back to cpufreq_quick_get(),
which effectively causes policy->cur to be returned when intel_pstate
is used, adjust intel_pstate_set_policy() to set policy->cur to reflect
the P-state that is actually going to be requested in the "performance"
policy case instead of setting it to policy->min (which is confusing
because it causes scaling_cur_freq to show the minimum frequency while
the CPU is likely running at the maximum one).

For this purpose, rearrange intel_pstate_set_policy() to handle the HWP
case separately, to avoid calling intel_pstate_set_pstate() pointlessly
with HWP enabled, and use the observation that with HWP enabled in the
active mode, the utilization update hook is only needed when HWP boost
is used and the policy is not "performance".

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/5144014.31r3eYUQgx@rafael.j.wysocki
2026-07-31 19:35:39 +02:00
Rafael J. Wysocki
53d08ba34e Merge back cpufreq material for 7.3
* pm-cpufreq:
  cpufreq/amd-pstate: handle missing policy in dynamic EPP callbacks
  cpufreq/amd-pstate: Cache the firmware programmed EPP value
  cpufreq/amd-pstate: Toggle auto_sel in active mode on shared memory systems
  cpufreq/amd-pstate: Fix EPP return type and handle errors during initialization
  cpufreq: amd-pstate-ut: Skip tests when amd-pstate driver is not active
  cpufreq: schedutil: Replace sprintf() with sysfs_emit() in sysfs show
  cpufreq: schedutil: Fix self-contradictory comment in sugov_iowait_apply()
  Documentation: admin-guide: cpufreq: fix sampling_rate example command
  cpufreq: intel_pstate: Move two functions closer to callers
  cpufreq: intel_pstate: Consolidate frequency values computation
  cpufreq: intel_pstate: Introduce intel_pstate_update_freq_limits()
  cpufreq: intel_pstate: Fix setting minimum P-state at init time
  cpufreq: intel_pstate: Rename INTEL_PSTATE_HWP_BROADWELL
  cpufreq: intel_pstate: Simplify HWP handling on Broadwell
  cpufreq: intel_pstate: Adjust the .adjust_perf() driver callback
  cpufreq: intel_pstate: Rearrange checks in hybrid_get_cost()
2026-07-31 16:22:32 +02:00
Gary Guo
0deeb4222d rust: driver: remove $module_table_name from module_device_table
Wrap the generated code in a `const _: ()` block to avoid symbol conflict.
This removes the need of creating a new identifier.

Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20260629-id_info-v2-7-56fccbe9c5ef@garyguo.net
[ Consider the serdev code merged in the meantime. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-30 22:50:15 +02:00
David Vernet
d06c75c22d cpufreq/amd-pstate: Document missing kernel-doc members
kernel-doc warns about five undescribed members in amd-pstate.h:
union perf_cached's @val and struct amd_cpudata's @raw_epp,
@current_profile, @ppdev and @profile_name. Describe them.

Signed-off-by: David Vernet <void@manifault.com>
Acked-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://lore.kernel.org/r/20260728073150.54964-2-void@manifault.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-28 11:05:23 -05:00
K Prateek Nayak
d9a3b95f37 cpufreq/amd-pstate-ut: Add unit test for CPPC Performance Priority
Add a unit test for CPPC Performance Priority that modifies the floor
perf and confirms if the modification was successful similar to the
energy_performance_preference unit test.

On platforms that do not support X86_FEATURE_CPPC_PERF_PRIO, the test
returns -EOPNOTSUPP and amd_pstate_ut_check_floor_freq is marked as
"skipped".

Suggested-by: Kalpana Shetty <kalpana.shetty@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-10-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:51 -05:00
K Prateek Nayak
d61c1ad390 cpufreq/amd-pstate-ut: Add unit test for "dynamic" EPP mode
Extend the EPP unit test to cover the "dynamic" epp mode. Since
"dynamic_epp" is no longer a system-wide toggle, remove the legacy
"dynamic_epp" bits from the unit test.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-9-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:51 -05:00
K Prateek Nayak
047e65218d cpufreq/amd-pstate: Reduce the scope of exported symbols
Symbols exported by amd-pstate.c are ever only needed for amd-pstate-ut.
Introduce EXPORT_SYMBOL_FOR_PSTATE_UT() to export these symbols
selectively to "amd-pstate-ut" namespace as opposed to all GPL modules.

No functional changes intended.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-8-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:51 -05:00
K Prateek Nayak
32692fcf61 cpufreq/amd-pstate: Remove "amd_dynamic_epp" cmdline and "dynamic_epp" sysfs
Since dynamic_epp has been converted to an
"energy_performance_preference", toggling the feature via the sysfs file
or the kernel cmdline is now redundant.

Remove the sysfs file and the "amd_dynamic_epp" cmdline and only depend
on "energy_performance_preference" to toggle dynamic_epp.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-6-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:51 -05:00
K Prateek Nayak
b7294b6275 cpufreq/amd-pstate: Add dynamic EPP as an "energy_performance_preference" mode
Convert the global "dynamic_epp" toggle into a per-CPU
"energy_performance_preference" mode "dynamic" that allows toggling the
functionality of "dynamic_epp" at a per-CPU level.

Instead of being a system-wide toggle, users can opt into the
functionality of dynamic EPP on a per-CPU basis by switching to the
powersave governor and selecting the "dynamic" mode from the available
performance preferences.

Unlike the previous implementation that had to check for driver mode
before toggling on the functionality, block writes to certain sysfs
files, potentially disallow policy change, etc. the per-CPU toggle fits
naturally into the intended design and provides more granular control to
the user.

The dynamic_epp file is now redundant as the option to toggle it on is
controlled via energy_performance_preference, and the dynamic_epp file
will be removed in the subsequent commit.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-5-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:50 -05:00
K Prateek Nayak
77b049427b cpufreq/amd-pstate: Extract platform profile to EPP conversion into a helper
Avoid duplication by extracting the switch case that derives EPP based
on platform profile into the amd_pstate_get_epp_from_platform_profile()
helper.

No functional changes intended.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-4-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:50 -05:00
K Prateek Nayak
0e85027801 cpufreq/amd-pstate: Remove the defensive check for bios_min_perf
Initialization of bios_min_perf (BIOS Requested CPU Min Freq.) only
succeeds when the driver init finds the CPPC_REQ MSRs to have all 0s
except for MIN_PERF bits.

A kexec puts the driver through the suspend path which, although resets
the min_perf back to bios_min_perf, keeps the rest of the CPPR_REQ
intact with the last value at the time of suspend.

The defensive check for bios_min_perf exists to prevent the min perf
from last CPPC_REQ being incorrectly considered as bios_min_perf when
a kexec switches from an older kernel running the version of driver
which is not aware of bios_min_perf to a newer one.

This scenario is extremely unlikely and Mario suggested it is better to
simplify the initialization rather than complicating the suspend resume
paths.

Drop the defensive check for bios_min_perf initialization and add a
debug message to dump the BIOS Requested Min Freq. to console leaving
enough breadcrumbs for debug if a situation so arises.

Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-3-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:50 -05:00
K Prateek Nayak
5c3ecf36d2 cpufreq/amd-pstate: Set min_limit_freq based on bios_min_perf
amd_pstate_update_min_max_limit() sets the min_limit_perf to the
nominal_perf to avoid frequency throttling when the system is idling.

This was found to be an ideal default but is suboptimal for users who
have profiled their workload at different operating frequencies and have
configured the optimal idling frequency via bios_min_perf.

Use the bios_min_perf (if configured) as the min_limit_perf when running
with performance governor. In absence of bios_min_perf, continue using
nominal_perf as the default min_limit_perf to avoid throttling.

Fixes: 608a76b652 ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260727072056.1248-2-kprateek.nayak@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27 19:46:50 -05:00
Abdun Nihaal
d5f8e5f604 cpufreq: powernow-k8: Fix possible memory leak in powernowk8_cpu_init()
The memory allocated for data->powernow_table inside
powernow_k8_cpu_init_acpi() or find_psb_table() is not freed in one of
the error paths in powernowk8_cpu_init(). Fix that by adding a kfree().

Fixes: 1ff6e97f1d ("[CPUFREQ] cpumask: avoid playing with cpus_allowed in powernow-k8.c")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Link: https://patch.msgid.link/20260727093553.98246-1-nihaal@cse.iitm.ac.in
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-27 16:58:45 +02:00
Rafael J. Wysocki
7f464fb229 amd-pstate content for 7.3 (07/22/26)
* Avoid running unit tests without amd-pstate
 * Fixes for EPP on shared memory systems
 * Fixes for dynamic EPP callbacks
 * Avoid loading on guests
 * Allow lowest nonlinear == minimum freq
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEECwtuSU6dXvs5GA2aLRkspiR3AnYFAmphGlcTHHN1cGVybTFA
 a2VybmVsLm9yZwAKCRAtGSymJHcCdkotD/wMShVE4ozDlaNXjQq2LdQB4LK/hbvy
 A4Z1BzHVn8ljw8eCkyZB/sB4pjNA0aXnXtTSkimbvwkiQhYbOqoNF5YFA1JWcqNK
 IjhUDTXbs+mwVDIU8aRuynkioGa1+jMPlLOExUkngCMTdraftPRUfSIH5I7cQ80q
 +qlSMJvhT2S3AuZYhy+HBKJa1Hbl2i36viMuxqmSicz8AwKXEHnZ2EFaf2u+ssat
 keF9/S2jvD9g8B/jxiVsK3zCxlH3RBwDQGLWRG7DaKSHLOugLV8BHtv37cNSYyiq
 e+TTSOeziUi9A8rGl39WYbIj5qUwrYvJ7c8aLeZ28RT3zS0IlqSrkFGeAw2XfInH
 /Kp9khIQdI09Jv5RIKsDrEjCws8zGB9SghxxnEDasagIfCoj4RIEAOvZeBdjvPr+
 BMWYe5XLw7VzJIVX6bCBYC3QOld/2YZjV/duu611Cs9ijqYoxWuF9uM/Eorqx889
 aj1kDcy/4PtkBM2CwhU6PnM2zwAQr45jIQ9Nc2Scm5PkBc8NQvYtO1L2qRRCoI8s
 khfcywX4iOnqoNswskji5c8N9gQUh/eTChOhgJoMkYRZv+yO0IcpDoQpUJUAz1wO
 BcTC0ZPESvNb/tAbm6WZFPoxVm33CwnGQr7WdOArx4K/ZyKvC25D/sfzJth/BSI7
 g+uEfZuopnuxSw==
 =rxGv
 -----END PGP SIGNATURE-----

Merge tag 'amd-pstate-v7.3-2026-07-22' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux

Merge amd-pstate content for 7.3 (07/22/26) from Mario Limonciello:

"* Avoid running unit tests without amd-pstate
 * Fixes for EPP on shared memory systems
 * Fixes for dynamic EPP callbacks
 * Avoid loading on guests
 * Allow lowest nonlinear == minimum freq"

* tag 'amd-pstate-v7.3-2026-07-22' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: (923 commits)
  cpufreq/amd-pstate: handle missing policy in dynamic EPP callbacks
  cpufreq/amd-pstate: Cache the firmware programmed EPP value
  cpufreq/amd-pstate: Toggle auto_sel in active mode on shared memory systems
  cpufreq/amd-pstate: Fix EPP return type and handle errors during initialization
  cpufreq: amd-pstate-ut: Skip tests when amd-pstate driver is not active
  cpufreq/amd-pstate: Prevent the driver from loading on unsupported hardware
  cpufreq/amd-pstate: Loosen requirement on lowest nonlinear frequency != min freq
  Linux 7.2-rc4
  Revert "drm/amd/display: Restore 5s vbl offdelay for NV3x+ DGPUs"
  drm/amd/display: check GRPH_FLIP status before sending event
  drm/amd/display: consolidate DCN vblank/flip handling onto vupdate_no_lock
  drm/amd: Create a device link between APU display and XHCI devices
  drm/amd/display: wire DCN42B mcache programming callback
  drm/amd/display: set new_stream to NULL after release
  drm/amd/display: Force PWM backlight on Lenovo Legion 5 15ARH05
  drm/amdkfd: free MQD managers on DQM init failures
  drm/amdgpu/ttm: Consider concurrent VM flushes for buffer entities
  drm/amd/pm/smu7: Fix AC/DC switch notification
  drm/amdgpu: Disable PCIe dynamic speed switching on Ryzen Pinnacle Ridge
  drm/amdgpu: always emit the job vm fence
  ...
2026-07-23 13:25:55 +02:00
Rafael J. Wysocki
601eecdeee amd-pstate fixes for 7.2 (7/22/26)
* Fix a case blocking amd-pstate from binding
   when lowest nonlinear freq == minimum freq
 * Stop trying to bind in guests
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEECwtuSU6dXvs5GA2aLRkspiR3AnYFAmphGcUTHHN1cGVybTFA
 a2VybmVsLm9yZwAKCRAtGSymJHcCdpQgEADZ9o0b+2twgu3oQn2HhuDsdM6unEgt
 U03liFAdH/+dTRjRuZ/IMu57+uoN4JC7dnYsqpmfvZebnAU/tjWwHK31sJzmvxj2
 /j3H9ATtZNyfBpwzUlhP0x2spbjxGM92xfyOxlpcLuBCApDMJ4G8tp30r/ipVBpp
 MyWLDxolHApZTTrHdWhIfkio94mQ2Q5PX/orggTUOhgKE0BH4KKOpmr5ECXiAalg
 h30J7sKuhEiuWD+3/WxS0ymwKeDhIn2qemZ40F5gx8JXevqaq5xkVtD5Kg+YifDx
 DBPq1/kAl+CIONmJdZRJZquuaTl6jI72XVqPMeUcvIYRYS0lxy8P60fLq81iSa7y
 hvCJW0AZ0X/FXTlTQaFrmXuYA69K7lvw/FfCEJSQNMw05AEYMtSrTz5QY/0F/hZ/
 3Znyj915KwUa/6KfCQyIVrSYEREc7ujypAQFJASM8a44LYnLe/87dVBKvsV5/jwm
 4A43ZyYFrzSAj9P2KJcRi7qFtePhxTaUjQn7glJqjijtY1QWoQpylhvpfD/4fEfJ
 5aSMojk7sdCITAz86KbIv1SPwO6gzE7kHWkCggHmVlK7oY4Zn7cJCnAEc+i+LQRu
 6rnU+J9Xfr3vab30WsMusxzrvAYtxVo4yqpHVUXHgKbfl/apO6CO7COelWLj5uxx
 nt2SdJ6bpz9czA==
 =XjRG
 -----END PGP SIGNATURE-----

Merge tag 'amd-pstate-v7.2-2026-07-22' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux

Merge amd-pstate fixes for 7.2 (7/22/26) from Mario Limonciello:

"* Fix a case blocking amd-pstate from binding
   when lowest nonlinear freq == minimum freq
 * Stop trying to bind in guests"

* tag 'amd-pstate-v7.2-2026-07-22' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux:
  cpufreq/amd-pstate: Prevent the driver from loading on unsupported hardware
  cpufreq/amd-pstate: Loosen requirement on lowest nonlinear frequency != min freq
2026-07-23 13:22:58 +02:00
Sasha Finkelstein
391b4b1d54 cpufreq: apple-soc: Calculate frequency as a 64-bit value
The current frequency calculation is done in 32 bit, causing problems
if run on a future SoC that can boost higher than 4.2GHz. Ideally, we
should use a true u64 instead of unsigned long and "knowning" that this
only runs on 64 bit machines, but the core code uses ulong everywhere,
so this should be good enough.

Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Reviewed-by: Joshua Peisach <jpeisach@ubuntu.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Reviewed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2026-07-23 09:40:57 +05:30
Shuwei Wu
736d655c84 cpufreq: dt-platdev: Add SpacemiT K1 SoC to the allowlist
Add the compatible string for supporting the generic
cpufreq driver on the SpacemiT K1 SoC.

Signed-off-by: Shuwei Wu <shuwei.wu@mailbox.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Yixun Lan <dlan@kernel.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Milan P. Stanić <mps@arvanta.net>
Tested-by: Gong Shuai <gsh517025@gmail.com> # OrangePi-RV2
Link: https://patch.msgid.link/20260626-shadow-deps-v4-1-bba9831f2f1d@mailbox.org
Signed-off-by: Yixun Lan <dlan@kernel.org>
2026-07-22 22:37:17 +00:00
EDAMAMEX
39c0cf62fc cpufreq/amd-pstate: handle missing policy in dynamic EPP callbacks
cpufreq_cpu_get() returns NULL when no cpufreq policy is associated with
the requested CPU, for example because the CPU is offline or the policy
has already been torn down.  Both amd_pstate_power_supply_notifier() and
amd_pstate_profile_set() acquire a policy via cpufreq_cpu_get() and then
pass that pointer to amd_pstate_get_balanced_epp() and
amd_pstate_set_epp(), which dereference it unconditionally.  A racing
CPU hotplug or driver teardown can therefore lead to a NULL pointer
dereference on either of these dynamic EPP paths.

The third cpufreq_cpu_get() caller in this file, amd_pstate_verify(),
already handles the NULL case.  Bring the two new callers in line with
that pattern: return NOTIFY_OK from the power-supply notifier (matching
the other "nothing to do" exits) and -ENODEV from amd_pstate_profile_set()
(the usual cpufreq error for a missing CPU policy).

Found by code inspection; not tested on hardware.

Fixes: e30ca6dd53 ("cpufreq/amd-pstate: Add dynamic energy performance preference")
Fixes: 798c47593c ("cpufreq/amd-pstate: Add support for platform profile class")
Signed-off-by: EDAMAMEX <edame8080@gmail.com>
Link: https://lore.kernel.org/r/20260520070211.2753183-1-edame8080@gmail.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:48 -05:00
Marco Scardovi
d0f4c1c8cb cpufreq/amd-pstate: Cache the firmware programmed EPP value
At CPU EPP initialization, the private cpudata structure is allocated via
kzalloc, which means cpudata->cppc_req_cached is initialized to 0. This
makes the default cached EPP value 0 (AMD_CPPC_EPP_PERFORMANCE).

When initializing a system that defaults to performance EPP, the driver
attempts to configure the EPP via amd_pstate_set_epp(). Because the
requested EPP (0) matches the uninitialized cached value (0), the cache
guard check triggers, and the driver skips writing to the hardware.

Cache the firmware-programmed default EPP value in cppc_req_cached during
CPU EPP initialization. This saves on an unnecessary reprogramming later
when the EPP is first set.

Assisted-by: Antigravity:gemini-3.5-flash
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Link: https://lore.kernel.org/r/20260609073042.81275-4-scardracs@disroot.org
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:48 -05:00
Marco Scardovi
9dfd13f80c cpufreq/amd-pstate: Toggle auto_sel in active mode on shared memory systems
On shared memory systems, the EPP configuration path (handled via
cppc_set_epp_perf()) is responsible for toggling on the CPPC autonomous
selection register (auto_sel).

Currently, shmem_init_perf() returns early without doing any of the auto_sel
configuration steps if cppc_state is AMD_PSTATE_ACTIVE. This skips enabling
auto_sel, leaving the CPU in non-autonomous mode.

Remove the early return check in shmem_init_perf() when cppc_state is
AMD_PSTATE_ACTIVE. Toggling auto_sel is necessary for the active mode on
shared memory systems to function based on the ACPI spec for CPPC v2 and
below.

Fixes: 2dd6d0ebf7 ("cpufreq: amd-pstate: Add guided autonomous mode")
Assisted-by: Antigravity:gemini-3.5-flash
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Reviewed-by: K Prateek Nayak <kprateek.anayk@amd.com>
Link: https://lore.kernel.org/r/20260609073042.81275-3-scardracs@disroot.org
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:48 -05:00
Marco Scardovi
57476909c3 cpufreq/amd-pstate: Fix EPP return type and handle errors during initialization
Currently, the EPP getter helper functions (msr_get_epp, shmem_get_epp, and
the static call wrapper amd_pstate_get_epp) return u8 or s16. This makes it
difficult to correctly propagate negative error values returned by the
underlying MSR read or CPPC helpers (such as rdmsrq_on_cpu or
cppc_get_epp_perf).

Modify the return type of these functions to int, allowing them to return
negative error codes properly.

Additionally, in amd_pstate_epp_cpu_init(), fetch the firmware-programmed
default EPP value and validate it before assigning it to the EPP variables.
If amd_pstate_get_epp() returns an error code, propagate the error and abort
the CPU initialization to prevent subsequent configuration failures.

Fixes: 555bbe67a6 ("cpufreq/amd-pstate: Convert all perf values to u8")
Assisted-by: Antigravity:gemini-3.5-flash
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Reviewed-by: K Prateek Nayak <kprateek.anayk@amd.com>
Link: https://lore.kernel.org/r/20260609073042.81275-2-scardracs@disroot.org
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:48 -05:00
Qianheng Peng
8d31bb1451 cpufreq: amd-pstate-ut: Skip tests when amd-pstate driver is not active
The crash issue may occur when modprobe amd_pstate_ut on intel platform.

   amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid  success!
   amd_pstate_ut: 2    amd_pstate_ut_check_enabled   success!
   BUG: kernel NULL pointer dereference, address: 0000000000000080
   #PF: supervisor read access in kernel mode
   #PF: error_code(0x0000) - not-present page
   PGD 0 P4D 0
   Oops: 0000 [#1] SMP NOPTI
   CPU: 0 PID: 20300 Comm: modprobe
   Kdump: loaded Tainted: G O 6.6.0-0010.rc1.ctl4.x86_64 #1
   Hardware name: FiberHome R2200 V5/Xeon Boards, BIOS 3.1a 02/24/2020
   RIP: 0010:amd_pstate_ut_check_perf+0x141/0x280 [amd_pstate_ut]
   Call Trace:
    <TASK>
    amd_pstate_ut_init+0x1b/0xff0 [amd_pstate_ut]
    ? __pfx_amd_pstate_ut_init+0x10/0x10 [amd_pstate_ut]
    do_one_initcall+0x42/0x2e0
    ? kmalloc_trace+0x26/0x90
    do_init_module+0x60/0x240
    __se_sys_init_module+0x185/0x1c0
    do_syscall_64+0x62/0x190
    entry_SYSCALL_64_after_hwframe+0x76/0x7e
    </TASK>

Add state detection to amd pstate driver to prevent amd_pstate_ut driver
from testing on non-AMD platforms.

Fixes: 14eb1c96e3 ("cpufreq: amd-pstate: Add test module for amd-pstate driver")
Suggested-by: Li Xiong <xiongl24@chinatelecom.cn>
Suggested-by: Xibo Wang <wangxb12@chinatelecom.cn>
Signed-off-by: Qianheng Peng <pengqh1@chinatelecom.cn>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Link: https://lore.kernel.org/r/1784191899-28957-1-git-send-email-pengqh1@chinatelecom.cn
(ML: adjust title)
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:48 -05:00
Rong Zhang
08fc1e7b31 cpufreq/amd-pstate: Prevent the driver from loading on unsupported hardware
X86_FEATURE_HW_PSTATE indicates if the processor supports frequency
scaling or not. Without it, the driver is unusable and thus will not
load. This check also prevents the driver from loading in guests and
thus not confuse users with misleading prints.

Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Acked-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Rong Zhang <i@rong.moe>
Link: https://lore.kernel.org/r/20260722-amd-pstate-vm-v4-1-d6607d9e9d9a@rong.moe
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:32 -05:00
Mario Limonciello
6842427bf2 cpufreq/amd-pstate: Loosen requirement on lowest nonlinear frequency != min freq
This requirement was introduced by commit 8f8b42c1fc ("cpufreq:
amd-pstate: optimize the initial frequency values verification")
specifically to aid in debugging BIOS issues with invalid _CPC tables
on some older systems.

This requirement is too tight for new systems though as some systems
actually have lowest nonlinear frequency identical to minimum
frequency.  Allow that combo to work.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20260715174318.18235-1-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22 13:45:22 -05:00
Christian Loehle
9753c0ab89 cpufreq: cppc: Sanitize lockless policy limit snapshots
cppc_cpufreq_update_perf_limits() reads policy->min and policy->max
without holding the policy lock. The cpufreq core updates those fields
with separate stores, so a reader can observe the old minimum together
with the new maximum and construct MIN_PERF greater than MAX_PERF.

Read both fields once and, if the lockless snapshot is inconsistent,
reduce the minimum to the observed maximum. This matches the conservative
correction used by cpufreq_driver_resolve_freq() and ensures that CPPC
never receives an inverted limit pair.

Fixes: ea3db45ae4 ("cpufreq: cppc: Update MIN_PERF/MAX_PERF in target callbacks")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/20260722093825.1030594-3-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 15:09:14 +02:00
Christian Loehle
11055a46f3 ACPI: CPPC: Check all controls for fast switching
ACPI 6.2, Section 6.2.11.2 permits _CPC registers to use flexible
address spaces. Linux advertises that capability through _OSC and parses
the address space of each _CPC register independently. A directly
accessible DESIRED_PERF combined with PCC-backed limits is therefore a
valid configuration.

cppc_allow_fast_switch() only checks DESIRED_PERF, although the fast-switch
callback passes DESIRED_PERF, MIN_PERF and MAX_PERF to cppc_set_perf(). If
a limit uses PCC, that function can sleep while called from scheduler
context.

Allow fast switching only when every supported control used by the
callback has an address space already accepted for fast access. Check the
complete policy domain, including initialized CPUs that are currently
offline and may later become the policy's managing CPU.

Fixes: 658fa7b1c4 ("ACPI: CPPC: Add cppc_get_perf() API to read performance controls")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/20260722093825.1030594-2-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 15:09:14 +02:00
Juergen Gross
e8caa0abfb cpufreq: Stop using 32-bit MSR interfaces
The 32-bit MSR interfaces rdmsr() and wrmsr() are planned to be
removed. Use the related 64-bit variants instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Link: https://patch.msgid.link/20260703112445.1763078-1-jgross@suse.com
2026-07-17 11:31:25 +02:00
Rafael J. Wysocki
f08b21ef54 Merge back cpufreq material for 7.3 2026-07-16 15:50:17 +02:00
Rafael J. Wysocki
3ff72cac73 cpufreq: intel_pstate: Move two functions closer to callers
Move intel_pstate_set_pstate() and intel_pstate_set_min_pstate() closer
to their first callers.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ rjw: Changelog adjustment ]
Link: https://patch.msgid.link/3433588.44csPzL39Z@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-15 17:46:40 +02:00
Rafael J. Wysocki
39b28ab6e9 cpufreq: intel_pstate: Consolidate frequency values computation
Update intel_pstate_get_cpu_pstates() to use
intel_pstate_update_freq_limits() for computing the max and
turbo frequency values in all cases, including non-hybrid HWP
and HWP disabled.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3059329.e9J7NaK4W3@rafael.j.wysocki
2026-07-15 17:46:40 +02:00
Rafael J. Wysocki
773e484787 cpufreq: intel_pstate: Introduce intel_pstate_update_freq_limits()
Introduce a new helper function, intel_pstate_update_freq_limits(),
for updating the max and turbo frequency values for the given CPU after
updating the corresponding P-states.

Use it in intel_pstate_get_hwp_cap() and intel_pstate_get_cpu_pstates(),
in the latter case instead of the direct updates of the max and turbo
frequency values in intel_pstate_hybrid_hwp_adjust().

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2277328.irdbgypaU6@rafael.j.wysocki
2026-07-15 17:46:40 +02:00
Rafael J. Wysocki
db53c573d3 cpufreq: intel_pstate: Fix setting minimum P-state at init time
If HWP is enabled, writes to MSR_IA32_PERF_CTL have no effect,
so intel_pstate_get_cpu_pstates() should not attempt to call
intel_pstate_set_min_pstate() to set the minimum P-state for the
given CPU in that case.

Accordingly, remove the intel_pstate_set_min_pstate()
call from intel_pstate_get_cpu_pstates() and make both
intel_pstate_cpu_init() and intel_cpufreq_cpu_init() call
that function in their non-HWP code paths.

The HWP code path in intel_pstate_cpu_init() does not need to update
the current P-state of the CPU directly at all because it is taken
care of the processor automatically, but the HWP code path of
intel_cpufreq_cpu_init() should update it in principle to
initialize the DESIRED_PERF field in MSR_HWP_REQUEST.  For this
purpose, make it call intel_cpufreq_hwp_update() and pass
the minimum P-state limit to it as the current target value along
with the current minimum and maximum limits.

Fixes: f6ebbcf08f ("cpufreq: intel_pstate: Implement passive mode with HWP enabled")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5090465.GXAFRqVoOG@rafael.j.wysocki
2026-07-15 17:46:40 +02:00
Rafael J. Wysocki
12a7f1aa06 cpufreq: intel_pstate: Rename INTEL_PSTATE_HWP_BROADWELL
Since the only role of INTEL_PSTATE_HWP_BROADWELL is to indicate that
hybrid HWP should not be used, rename it to INTEL_PSTATE_HWP_NOT_HYBRID.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3431755.44csPzL39Z@rafael.j.wysocki
2026-07-15 17:46:40 +02:00
Rafael J. Wysocki
76d70f65e3 cpufreq: intel_pstate: Simplify HWP handling on Broadwell
After commit de5bcf404a ("cpufreq: intel_pstate: Clean up
frequency computations"), the Broadwell HWP mode does not actually
do anything useful because intel_pstate_get_hwp_cap() is called in
intel_pstate_verify_cpu_policy() without checking the Broadwell mode
and it overrides the initial turbo and max pstate values read from
MSR_PLATFORM_INFO (the minimum P-state value still comes from
MSR_PLATFORM_INFO if HWP is used even without the Broadwell mode).

Moreover, hwp_cap_cached is used in some places for updating
MSR_HWP_REQUEST without checking the Broadwell mode either.

Effectively, the only difference made by the Broadwell HWP mode is
skipping the hybrid initialization which may as well be achieved
by avoiding to set pstate_funcs.get_cpu_scaling on Broadwell.

Link: https://sashiko.dev/#/patchset/6005456.DvuYhMxLoT%40rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3057514.e9J7NaK4W3@rafael.j.wysocki
2026-07-15 17:46:40 +02:00