3421 Commits
Author SHA1 Message Date
Andy Shevchenko 5ad0af4f43 thermal: sysfs: switch to use scnprintf() to suppress truncation warning
Switch the sysfs code to use scnprintf() to avoid warnings about potential
truncation of the names of the sysfs attributes. We can't increase the buffer
size because the size is the part of an ABI for some reason. Note, with
the current size of buffer the affected attributes have a room for up to
1000 names, which ought to be enough for all cases. There is no functional
change, as the same limitation was implied before.

Fixes: c56f5c0342 ("Thermal: Make Thermal trip points writeable")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260817103324.1020212-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-04 15:49:46 +02:00
Linus Torvalds 79b4f3baae Merge tag 'mfd-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
 "New Support & Features:
   - MediaTek MT6397: Add mt6323 AUXADC support
   - MediaTek MT6397: Add mt6323 EFUSE support
   - Spreadtrum SC27xx: Add SC2730 regulator cell

  Improvements & Fixes:
   - Apple SMC: Fix key count endianness annotation
   - Azoteq IQS62x: Reject zero-length firmware records
   - ChromeOS EC: Introduce cros_ec_read_features helper and read
     features during probe to catch transfer errors
   - Cirrus Logic CS42L43: Fix regmap defaults ordering
   - Cirrus Logic CS42L43: Remove redundant NULL checks on SoundWire
   - Congatec Board Controller: Fix teardown ordering in cgbc_remove()
   - HP iPAQ Micro: Fix out-of-bounds stack read in ipaq_micro_str
   - Marvell 88PM886: Initialize the battery page
   - QNAP MCU: Keep the reply buffer alive past a command timeout
   - RAVE SP: Validate received frame payload lengths
   - Silicon Labs Si476x: Drop duplicate NULL checks
   - Silicon Labs Si476x: Modernize GPIO handling
   - Silicon Motion SM501: Fix potential memory leaks during remove
   - UCB1x00: Convert Assabet gpio-keys to use software nodes and
     register software node for GPIO controller
   - Viperboard: Fix native fields type in structures as little-endian
   - Viperboard: Remove redundant NULL check before kfree()
   - X-Powers AXP20x: Preserve other control bits when powering off

  Cleanups & Refactoring:
   - Core: Drop unused assignment of spi_device_id driver data
   - Core: Initialize spi_device_id arrays using member names
   - Core: Unify style of spi_device_id arrays
   - Maintainers: Add Intel LPSS section to follow the changes
   - Maintainers: Add a mailing list entry to MFD
   - Cirrus Logic CS42L43: Format sdw_device_id table
   - Cirrus Logic CS42L43: Use new SoundWire enumeration helper
   - ROHM PMIC: Factor out power button registration and convert
     gpio-keys to use software nodes
   - ST-Ericsson DB8500: Fold dbx500 header into db8500

  Device Tree Binding Updates:
   - Core: Add techvision vendor prefix
   - Marvell 88PM886: Allow vbus regulator
   - MediaTek MT8195 SCP: Add support for MT8189 SoC
   - Qualcomm SPMI PMIC: Document PMG1110
   - Qualcomm SPMI PMIC: Document haptics device
   - Qualcomm TCSR: Add compatible for Hawi and Maili SoCs
   - Qualcomm TCSR: Add compatible for Shikra
   - Qualcomm TCSR: Document the IPQ9650 TCSR block
   - STMicroelectronics STMPE: Fix typo st,stmpe601 (should be
     st,stmpe610)
   - Syscon: Add ESWIN EIC7700 compatible
   - Syscon: Allow syscon compatible for Loongson-2K0300 chip id
   - Syscon: Disallow simple-bus with syscon
   - Syscon: Drop custom select for older dtschema
   - TI OMAP USBHS TLL: Convert to DT schema"

* tag 'mfd-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits)
  mfd: cs42l43: Fix regmap defaults ordering
  dt-bindings: mfd: syscon: Allow syscon compatible for Loongson-2K0300 chip id
  dt-bindings: mfd: syscon: Add ESWIN EIC7700 compatible
  mfd: qnap-mcu: keep the reply buffer alive past a command timeout
  dt-bindings: mfd: qcom,tcsr: Document the IPQ9650 TCSR block
  mfd: macsmc: Fix key count endianness annotation
  dt-bindings: mfd: qcom,spmi-pmic: Document haptics device
  mfd: iqs62x: Reject zero-length firmware records
  mfd: rave-sp: validate received frame payload lengths
  mfd: sm501: Fix potential memory leaks during remove
  mfd: viperboard: Fix native fields type in structures as little-endian
  mfd: si476x-i2c: Get rid of duplicate NULL checks
  dt-bindings: mfd: Convert OMAP USB TLL to DT schema
  mfd: cgbc: Fix teardown ordering in cgbc_remove()
  mfd: mt6397-core: Add mt6323 AUXADC support
  dt-bindings: mfd: qcom,tcsr: Add compatible for Hawi and Maili SoCs
  mfd: rohm: Factor out power button registration
  mfd: ucb1x00: Convert Assabet gpio-keys to use software nodes
  mfd: ucb1x00: Register software node for GPIO controller
  mfd: cs42l43: Tidy up formatting on sdw_device_id table
  ...
2026-08-27 10:45:08 -07:00
Linus Torvalds b81e341319 Merge tag 'thermal-7.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more thermal control updates from Rafael Wysocki:
 "This mostly consists of assorted updates of thermal drivers, including
  new hardware support (Airoha AN7583, Qualcomm Master BandGap thermal
  monitor, QCom PMIC5 Gen3 ADC), but it also includes two reverts of
  recent cosmetic thermal core updates that went against driver core
  plans to eliminate class_create():

   - Fix missing bitfield include headers in Armada and QCom SPM BMG
     drivers (Daniel Lezcano)

   - Fix missed file when manually applying a change after a conflict
     resolution for the QCom SPMI ADC TM5 Gen3 (Daniel Lezcano)

   - Move thermal_zone_device_enable() to the right place in order to
     prevent calling it if the thermal zone registration failed (Dan
     Carpenter)

   - Improve bitfield manipulations on Armada (Bryan B. Lima)

   - Remove unneeded 'fast_io' on Sun8i and Armada (Wolfram Sang)

   - Fix wrong boundary when clamping the low values in the set_trips()
     callback and fix wrong mask when setting the temperature interval
     on Airoha (Christian Marangi)

   - Make use of the regmap API to support Airoha AN7583 (Christian
     Marangi)

   - Fix adc_tm5_get_temp() return check value on the QCom SPMI ADC
     sensor (Rakesh Kota)

   - Fix unbalanced clock enablement when the resume fails on the iMX
     driver (Can Peng)

   - Add Qualcomm Master BandGap thermal monitor support (Satya Priya
     Kakitapalli)

   - Add Maili Temperature bindings compatible (Haritha S K)

   - Add a devm action to clean hardware interrupts, sampling, and
     control registers on Spacemit K1 (Pei Xiao)

   - Fix trivial typo in a thermal OF code comment (Marek Vasut)

   - Remove unnecessary print on Qcom SPMI ADC driver when a call to
     devm_request_threaded_irq() fails as this one already prints a
     message (Jishnu Prakash)

   - Add support for QCom PMIC5 Gen3 ADC by using auxiliary driver and
     shared interrupt with the IIO driver (Jishnu Prakash)

   - Make resets optional on MT8196 and add the corresponding property
     in the DT bindings (AngeloGioacchino Del Regno)

   - Fix clock staying enabled on failing resume operation on Qoriq (Can
     Peng)

   - Fix wrong closing brace position in thermal library header (Andreas
     Haufler)

   - Fix low and high trip point validation by moving the check after
     the clamp on the spacemit driver (surendra)

   - Remove redundant error messages on IRQ request failure (Pan Chuang)

   - Add IIO_CONSUMER namespace import to the qcom-spmi-mbg-tm thermal
     driver to avoid modpost warnings that would appear after merging
     the iio tree against the thermal updates (Nathan Chancellor)

   - Revert two recent cosmetic updates of the thermal core conflicting
     with driver core plans to eliminate class_create() (Rafael
     Wysocki)"

* tag 'thermal-7.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
  thermal/drivers/qcom-spmi-mbg-tm: Add module namespace import for IIO_CONSUMER
  Revert "thermal/core: Allocate the thermal class dynamically"
  Revert "thermal/core: Use the thermal class pointer as init guard"
  thermal/drivers/armada: Fix missing bitfields include
  thermal/drivers/qcom/spm mbg tm: Fix missing bitfield header
  thermal/drivers/qcom: Fix missing spmi adc tm5 gen3 file
  thermal/drivers: Remove redundant error messages on IRQ request failure
  thermal/drivers/spacemit: Validate clamped trip thresholds
  tools/lib/thermal: Fix misplaced extern "C" closing brace
  thermal/drivers/qoriq: Disable clock on resume failure
  thermal/drivers/mediatek/lvts_thermal: Make reset optional for MT8196
  dt-bindings: thermal: mediatek: Make resets optional for MT8196
  thermal/drivers/qcom: add support for PMIC5 Gen3 ADC thermal monitoring
  iio: adc: qcom-spmi-adc5-gen3: Share SDAM0 IRQ with ADC_TM auxiliary driver
  iio: adc: qcom-spmi-adc5-gen3: Remove an unnecessary print
  thermal/of: Fix trivial enabled typo
  thermal/drivers/spacemit/k1: Add shutdown action and reorder registration order
  dt-bindings: thermal: qcom-tsens: Document the Maili Temperature Sensor
  thermal/drivers/qcom: Add support for Qualcomm MBG thermal monitoring
  dt-bindings: thermal: Add Qualcomm MBG thermal monitor support
  ...
2026-08-26 14:21:30 -07:00
Nathan Chancellor 79a57e4882 thermal/drivers/qcom-spmi-mbg-tm: Add module namespace import for IIO_CONSUMER
Commit ebf1d03dab ("iio: inkern: Use namespaced exports") in the iio
tree restricts certain exported core functions that a driver added in
commit c3dce11733 ("thermal/drivers/qcom: Add support for Qualcomm MBG
thermal monitoring") from the thermal tree uses, causing modpost to
warn (or error without CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS):

  ERROR: modpost: drivers/thermal/qcom/qcom-spmi-mbg-tm.ko: module uses symbol 'devm_iio_channel_get' from namespace 'IIO_CONSUMER', but does not import it.
  ERROR: modpost: drivers/thermal/qcom/qcom-spmi-mbg-tm.ko: module uses symbol 'iio_read_channel_processed' from namespace 'IIO_CONSUMER', but does not import it.

Add the IIO_CONSUMER namespace import to clear up the error.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260812-qcom-spmi-mbg-tm-ns-modpost-error-v1-1-d849390d2714@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-08-25 21:09:40 +02:00
Rafael J. Wysocki aa4174127f Revert "thermal/core: Allocate the thermal class dynamically"
This reverts commit 34f5400364 ("thermal/core: Allocate the thermal
class dynamically") that went against driver core changes aiming at the
elimination of class_create() [1].

No intentional functional impact.

Link: https://lore.kernel.org/linux-pm/2026082411-flask-rewire-434f@gregkh/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/4761117.LvFx2qVVIh@rafael.j.wysocki
2026-08-25 21:08:46 +02:00
Rafael J. Wysocki 1087c29d9c Revert "thermal/core: Use the thermal class pointer as init guard"
This reverts commit 499274d078 ("thermal/core: Use the thermal class
pointer as init guard") because it depends on another commit that needs
to be reverted.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/6301222.lOV4Wx5bFT@rafael.j.wysocki
2026-08-25 21:08:45 +02:00
Linus Torvalds 93e4b3076b Merge tag 'char-misc-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc/IIO/etc driver updates from Greg KH:
 "Here is the big set of char, misc, iio, counter, fpga, and other small
  driver subsystems for 7.3-rc1.

  Overall, due to some driver removals we only added a bit more code
  than removed, which was a nice change. Highlights in this merge
  request are:

   - Loads of IIO driver updates and additions

   - binder driver updates (more on that below...)

   - Removal of the SGI XP and GRU drivers as they are not used anymore
     and turn out to be pretty insecure overall

   - Removal of the obsolete ibmasm driver as it's not being used
     anymore

   - Coresight driver updates and additions

   - Mei driver udpates

   - Counter driver updates

   - FPGA driver updates

   - ICC driver updates

   - lots and lots of other tiny driver updates to resolve reported
     issues

  All of these have been in linux-next for a while"

* tag 'char-misc-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (513 commits)
  iio: chemical: atlas-sensor: use iio_trigger_poll_nested() to fix remove UAF
  iio: adc: pac1921: fix wrong channel used in trigger handler read
  iio: light: gp2ap002: re-enable irq if runtime suspend fails
  iio: light: gp2ap002: Fix unbalanced runtime PM on repeated event writes
  iio: light: apds9306: fix PM reference leak in apds9306_read_data()
  iio: gyro: mpu3050: fix sign of raw angular velocity readings
  iio: srf04: fix pm_runtime handling on probe error path
  iio: adc: ad4080: configure backend data size
  iio: adc: adi-axi-adc: add data size support for AD408X backend
  iio: chemical: atlas-sensor: fix PM reference leak in buffer postenable
  iio: dac: ad5446: fix OF module device table
  iio: light: opt4001: Fix reversed GENMASK() arguments in fault count mask
  iio: light: opt4001: Reject integration times with a non-zero seconds part
  iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem()
  iio: light: opt4001: Fix power down clearing bits of the wrong register
  iio: light: opt4060: Fix incorrect register name in threshold read error message
  iio: light: opt4060: Fix pointer type passed to div_u64_rem()
  iio: light: opt4060: Reject integration times with a non-zero seconds part
  iio: light: ltrf216a: fix runtime PM reference leak in error path
  iio: pressure: dps310: fix NULL pointer dereference on ACPI probe
  ...
2026-08-25 09:38:50 -07:00
Linus Torvalds 5808ac1889 Merge tag 'x86_cpu_for_v7.3_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpuid updates from Borislav Petkov:

 - Get rid of static_cpu_has() - one less API to care about testing CPU
   features

 - Unify the handling of CPU core types (performance, efficient, etc) by
   mapping the vendor-specific types to Linux ones

 - Continuation of the work of Ahmed Darwish to centralize CPUID leaf
   representation

* tag 'x86_cpu_for_v7.3_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/CPU: Rename struct cpuid_read_output to struct cpuid_output
  x86/cpu/scattered: Sort it properly
  x86/cpu: Use parsed CPUID(0x1)
  x86/lib: Add CPUID(0x1) family and model calculation
  x86/cpu: Use parsed CPUID(0x0)
  x86/cpu/transmeta: Rescan CPUID(0x1) after modifying capabilities
  x86/topology: Add TOPO_CPU_TYPE_LOW_POWER
  x86/topology: Name the AMD core-type values
  x86/topo: Map vendor CPU types to generic Linux such types
  x86/bugs: Don't use cpu-type matching in cpu_vuln_blacklist
  x86/cpu: Hide and rename static_cpu_has()
2026-08-18 19:09:42 -07:00
Linus Torvalds 8dcef8882a 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
Daniel Lezcano b115930d71 thermal/drivers/armada: Fix missing bitfields include
Add the missing include leading to the error:

error: implicit declaration of function ‘FIELD_GET’ [-Werror=implicit-function-declaration]
  184 |                 if (FIELD_GET(MON_FAULT_STATUS_MASK, val) == MON_FAULT_LVL1_UPR)
      |                     ^~~~~~~~~
cc1: all warnings being treated as errors

Fixes: cbe31d5ce4 ("thermal/drivers/armada: Use bitfield and bitmask macros")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608082242.drjXuzsN-lkp@intel.com/
Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260811094747.2940616-1-daniel.lezcano@kernel.org
2026-08-18 13:09:22 +02:00
Daniel Lezcano c5f7c0d35c thermal/drivers/qcom/spm mbg tm: Fix missing bitfield header
Add missing bitfield header leading to the error:

>> drivers/thermal/qcom/qcom-spmi-mbg-tm.c:184:21: error: implicit declaration of function 'FIELD_GET' [-Wimplicit-function-declaration]
     184 |                 if (FIELD_GET(MON_FAULT_STATUS_MASK, val) == MON_FAULT_LVL1_UPR)
         |                     ^~~~~~~~~

Fixes: c3dce11733 ("thermal/drivers/qcom: Add support for Qualcomm MBG thermal monitoring")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608080800.RfxKb9uR-lkp@intel.com/
Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260811094935.2941313-1-daniel.lezcano@kernel.org
2026-08-18 13:08:50 +02:00
Jishnu Prakash cebe359188 thermal/drivers/qcom: Fix missing spmi adc tm5 gen3 file
Add missing file resulting from a manual application of the change
below after fixing a conflict in the Makefile.

Fixes: 948ee3a74f ("thermal/drivers/qcom: add support for PMIC5 Gen3 ADC thermal monitoring")
Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260811145427.3089426-1-daniel.lezcano@kernel.org
2026-08-18 13:07:51 +02:00
Rafael J. Wysocki ccda015d76 Merge tag 'thermal-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal driver updates for 7.3-rc1 from Daniel Lezcano:

"- Move thermal_zone_device_enable() to the right place in order to
   prevent calling it if the thermal zone registration failed (Dan
   Carpenter)

 - Improve bitfield manipulations on Armada (Bryan B. Lima)

 - Remove unneeded 'fast_io' on Sun8i and Armada (Wolfram Sang)

 - Fix wrong boundary when clamping the low values in the set_trips()
   callback and fix wrong mask when setting the temperature interval on
   Airoha (Christian Marangi)

 - Make use of the regmap API in order to support the Airoha AN7583
   (Christian Marangi)

 - Fix adc_tm5_get_temp() return check value on the QCom SPMI ADC
   sensor (Rakesh Kota)

 - Fix unbalanced clock enablement when the resume fails on the iMX
   driver (Can Peng)

 - Add Qualcomm Master BandGap thermal monitor support (Satya Priya
   Kakitapalli)

 - Add Maili Temperature bindings compatible (Haritha S K)

 - Add a devm action to clean hardware interrupts, sampling, and
   control registers on Spacemit K1 (Pei Xiao)

 - Fix trivial typo in an OF code comment (Marek Vasut)

 - Remove unecessary print on Qcom SPMI ADC driver when a call to
   devm_request_threaded_irq() fails as this one already prints a
   message (Jishnu Prakash)

 - Add support for QCom PMIC5 Gen3 ADC by using auxialiary driver and
   shared interrupt with the IIO driver (Jishnu Prakash)

 - Make resets optional on MT8196 and add the corresponding property in
   the DT bindings (AngeloGioacchino Del Regno)

 - Fix clock staying enabled with the resume operation fails on Qoriq
   (Can Peng)

 - Fix wrong closing brace position in thermal library header (Andreas
   Haufler)

 - Fix low and high trip point validation by moving the check after the
   clamp on the spacemit driver (surendra)

 - Remove redundant error messages on IRQ request failure (Pan Chuang)

* tag 'thermal-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (26 commits)
  thermal/drivers: Remove redundant error messages on IRQ request failure
  thermal/drivers/spacemit: Validate clamped trip thresholds
  tools/lib/thermal: Fix misplaced extern "C" closing brace
  thermal/drivers/qoriq: Disable clock on resume failure
  thermal/drivers/mediatek/lvts_thermal: Make reset optional for MT8196
  dt-bindings: thermal: mediatek: Make resets optional for MT8196
  thermal/drivers/qcom: add support for PMIC5 Gen3 ADC thermal monitoring
  iio: adc: qcom-spmi-adc5-gen3: Share SDAM0 IRQ with ADC_TM auxiliary driver
  iio: adc: qcom-spmi-adc5-gen3: Remove an unnecessary print
  thermal/of: Fix trivial enabled typo
  thermal/drivers/spacemit/k1: Add shutdown action and reorder registration order
  dt-bindings: thermal: qcom-tsens: Document the Maili Temperature Sensor
  thermal/drivers/qcom: Add support for Qualcomm MBG thermal monitoring
  dt-bindings: thermal: Add Qualcomm MBG thermal monitor support
  thermal/drivers/imx: Disable clock on runtime resume failure
  thermal/drivers/qcom-spmi-adc-tm5: Drop IIO_VAL_INT check in adc_tm5_get_temp
  thermal/drivers/airoha: Add support for AN7583 Thermal Sensor
  dt-bindings: arm: airoha: Add the chip-scu node for AN7583 SoC
  thermal/drivers/airoha: Generalize get_thermal_ADC and set_mux function
  thermal/drivers/airoha: Generalize probe function
  ...
2026-08-10 12:53:41 +02:00
Rafael J. Wysocki 2d5667b6c3 Merge branches 'thermal-core', 'thermal-hwmon', 'thermal-intel' and 'thermal-tools'
Merge updates of the thermal core, thermal drivers for Intel platforms
and the thermometer utility for 7.3-rc1:

 - Use sysfs_emit_at() in trans_table_show() (Thorsten Blum)

 - Remove hwmon class devices created for thermal zones when the thermal
   zone devices holding them are removed (Rafael Wysocki)

 - Add support for the Directed Package-level Thermal Interrupt to
   the Intel thermal throttling driver to allow package-level thermal
   interrupts to go to one specific CPU in a processor package instead
   of going to all of the CPUs in it (Ricardo Neri)

 - Clean up RFIM groups on DVFS failure and clean up ODVP on probe
   failures in the int340x thermal driver (Pengpeng Hou)

 - Remove redundant dev_err() from the int340x thermal driver and the
   bxt_pmic driver (Pan Chuang)

 - Simplify ptc_temperature_write() in the int340x thermal driver by
   using kstrtou32_from_user() (Dmitry Antipov)

 - Close fd on realloc() failure in the thermometer utility (Amarjeet)

* thermal-core:
  thermal: sysfs: Use sysfs_emit_at() in trans_table_show()

* thermal-hwmon:
  thermal: hwmon: Remove hwmon class device along with its parent

* thermal-intel:
  thermal: intel: int340x: simplify ptc_temperature_write()
  thermal: intel: bxt_pmic: Remove redundant dev_err()
  thermal: intel: int340x: Remove redundant dev_err()
  thermal: intel: int3400: clean up ODVP on probe failures
  thermal: intel: int340x: clean up RFIM groups on DVFS failure
  thermal: intel: Add a syscore shutdown callback for kexec reboot
  thermal: intel: Add syscore callbacks for suspend and resume
  thermal: intel: Enable the Directed Package-level Thermal Interrupt
  thermal: intel: Add resources to handle directed package-level thermal interrupts
  x86/thermal: Add bit definitions for Intel Directed Package Thermal Interrupt

* thermal-tools:
  tools/thermal/thermometer: close fd on realloc() failure
2026-08-07 21:45:08 +02:00
Pan Chuang 55c16e15ff thermal/drivers: Remove redundant error messages on IRQ request failure
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
automatically log detailed error messages on failure. Remove the
now-redundant driver-specific dev_err() and dev_err_probe() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260717024733.374913-1-panchuang@vivo.com
2026-08-07 17:27:28 +02:00
surendra 68b78ad1e3 thermal/drivers/spacemit: Validate clamped trip thresholds
k1_tsensor_set_trips() checks the requested trip temperatures before
converting them to the sensor register representation. Distinct
out-of-range temperatures can clamp to the same hardware value, leaving the
sensor with an invalid low/high threshold pair.

Validate the ordering after conversion and clamping.

Fixes: 296a977f2b ("thermal/drivers/spacemit/k1: Add thermal sensor support")
Signed-off-by: surendra <kr494167@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260720103606.93924-1-kr494167@gmail.com
2026-08-07 17:18:53 +02:00
Can Peng fcbf9964b6 thermal/drivers/qoriq: Disable clock on resume failure
qoriq_tmu_resume() enables the TMU clock before clearing the
power-down bit and enabling monitoring.

If either register update fails, the function returns with the clock
still enabled. This leaves the clock enable count unbalanced after a
failed resume.

Disable the clock on those failure paths before returning the error.

Fixes: 51904045d4 ("thermal: qoriq: Add clock operations")
Cc: stable@vger.kernel.org
Signed-off-by: Can Peng <pengcan@kylinos.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260722075625.452684-1-pengcan@kylinos.cn
2026-08-07 17:18:50 +02:00
AngeloGioacchino Del Regno 6b73e78462 thermal/drivers/mediatek/lvts_thermal: Make reset optional for MT8196
Depending on the SoC+Firmware combination, the LVTS hardware may be
may be actively used by one or even multiple concurrent MCUs!
In this case, resetting it may produce either a severe slowdown of
the entire system, or even a thermal protection AP reset, as some
MCU(s) may be reading a very high or very low temperature while the
LVTS is being reset.

On those, don't fail if no reset is found as that may be omitted on
purpose, but still check if there's one, because some board(s) may
be running on a different bootchain with reduced firmwares or using
firmwares with reduced functionality.

So, use devm_reset_control_get_optional_exclusive() instead, as the
LVTS controller always had only one reset and retrieving that by
index, specifically, always made little sense anyway.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20260721105230.101906-3-angelogioacchino.delregno@collabora.com
2026-08-07 17:18:48 +02:00
Jishnu Prakash 948ee3a74f thermal/drivers/qcom: add support for PMIC5 Gen3 ADC thermal monitoring
Add support for ADC_TM part of PMIC5 Gen3 in an auxiliary driver
under the Gen3 ADC driver. Its functionality is similar to that of
PMIC5 Gen2 ADC_TM, which implements the threshold setting and
interrupt generating functions, used to support thermal trip points.

In Gen3 ADC, the register interface is implemented on one or more SDAM
(Shared Direct Access Memory) peripherals instead of dedicated ADC
peripherals. Each ADC SDAM has eight channels which can be configured
for either immediate reads (main ADC driver's functionality) or ADC_TM
reads. By convention, the first channel of the first ADC SDAM is reserved
for all immediate reads and remaining channels across all SDAMs are used
for ADC_TM functionality.

On the first SDAM, the interrupt line and configuration registers are
shared between the main ADC and auxiliary ADC_TM drivers. Access to the
registers is protected through a mutex shared between the drivers. The
ADC_TM driver accesses this mutex and some other functions shared from
the main driver (like adc5_gen3_get_scaled_reading() for immediate channel
reads in the .get_temp() callback) through APIs exported into a shared
namespace.

Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260722-gen3_adc_tm-v4-3-011981f756c8@oss.qualcomm.com
2026-08-07 17:18:45 +02:00
Marek Vasut c4c4050236 thermal/of: Fix trivial enabled typo
Fix trivial typo, s@enabled@enable@. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260804213738.287818-1-marek.vasut+renesas@mailbox.org
2026-08-07 17:18:40 +02:00
Pei Xiao 9cbf780428 thermal/drivers/spacemit/k1: Add shutdown action and reorder registration order
Add a devm action to clean hardware interrupts, sampling, and control
registers on driver unbind, mirroring what k1_tsensor_init() sets up.

Reorder the registration order within probe(): register the thermal
zones first, then request the IRQ, and register the shutdown action
last.  On removal, the hardware interrupt is disabled first, then the
IRQ is released, and finally the thermal zones are released.  This
avoids the IRQ thread accessing an already unregistered thermal zone
during devres cleanup.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Link: https://patch.msgid.link/1967d2bcc8fede6fbd25fc8eee07f2873fb41472.1784184867.git.xiaopei01@kylinos.cn
2026-08-07 17:18:39 +02:00
Satya Priya Kakitapalli c3dce11733 thermal/drivers/qcom: Add support for Qualcomm MBG thermal monitoring
Add a driver for the Qualcomm MBG (Master Bandgap) thermal monitoring
device. It monitors PMIC die temperature in hardware and raises an
interrupt when a programmed threshold is crossed.

MBG hardware supports two upper-threshold levels. Currently, only the
level-1 threshold is supported by the driver.

Temperature is read from the associated ADC channel, and when a level-1
upper-threshold violation occurs, the hardware generates an interrupt
over SPMI. The driver notifies the thermal framework accordingly.

Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Co-developed-by: Sachin Gupta <sachin.gupta@oss.qualcomm.com>
Signed-off-by: Sachin Gupta <sachin.gupta@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260722-spmi-mbg-driver-v3-2-ef73064f2789@oss.qualcomm.com
2026-08-07 17:18:34 +02:00
Rafael J. Wysocki 2b57e24d34 thermal: hwmon: Remove hwmon class device along with its parent
The current code creates one hwmon device per thermal zone type and that
device is registered under the first thermal zone of the given type.

That turns out to be problematic when the thermal zone holding the
hwmon device is removed.

For example, say that there are two ACPI thermal zones on a system

 /sys/devices/virtual/thermal/thermal_zone0/
 /sys/devices/virtual/thermal/thermal_zone1/

The current code registers a hwmon class device for thermal_zone0 only:

 /sys/devices/virtual/thermal/thermal_zone0/hwmon0/

because the type is "acpitz" for both of them, but it adds a sysfs
attribute that belongs to thermal_zone1 under it:

 /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input

There is also

 /sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input

which belongs to thermal_zone0.

When thermal_zone0 is removed, say because the ACPI thermal driver is
unbound from the underlying platform device, thermal_remove_hwmon_sysfs()
skips the removal of hwmon0 because of the temp2_input attribute
belonging to thermal_zone1 which effectively prevents thermal_zone0
removal from making progress.

Address this by making thermal_remove_hwmon_sysfs() remove the entire
hwmon class device interface for the given thermal zone type when the
thermal zone device holding it is removed.

To prevent races with thermal_add_hwmon_sysfs() that may interfere
with this, carry out the entire addition and removal of hwmon sysfs
interfaces for thermal zones under thermal_hwmon_list_lock.

Also adjust the layout of the labels in thermal_add_hwmon_sysfs() to
the current kernel coding style to align with the new "unlock" label.

Link: https://lore.kernel.org/linux-pm/20260402021828.16556-1-liujia6264@gmail.com/
Fixes: f6b6b52ef7 ("thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/5094738.GXAFRqVoOG@rafael.j.wysocki
2026-08-05 13:57:39 +02:00
Rafael J. Wysocki ff8da20b6f Revert "thermal/drivers/hwmon: Cleanup coding style a bit"
Revert commit 030a48b0f6 ("thermal/drivers/hwmon: Cleanup coding style
a bit") that introduced a use-after-free into the error path of
thermal_add_hwmon_sysfs() by removing a valid check from it.

Link: https://lore.kernel.org/linux-hwmon/20260803183915.4ED7D1F000E9@smtp.kernel.org/
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/5123895.31r3eYUQgx@rafael.j.wysocki
2026-08-05 13:25:55 +02:00
Rafael J. Wysocki f93d951ce0 Revert "thermal: hwmon: Register a hwmon device for each thermal zone"
Revert commit d6323469bc ("thermal: hwmon: Register a hwmon device
for each thermal zone") that changed the names of hwmon class devices
associated with thermal zones and their sysfs layout which made user
space unhappy.

Closes: https://lore.kernel.org/linux-pm/cafd8af9-c6e9-4bf2-b496-23e796fbc9a6@linux.dev/
Closes: https://lore.kernel.org/linux-hwmon/ab8b093b-46e6-4738-afcf-4b97c9ad5af9@googlemail.com/
Cc: stable@vger.kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2301040.irdbgypaU6@rafael.j.wysocki
2026-07-31 16:32:39 +02:00
Rafael J. Wysocki c89039b724 Revert "thermal: hwmon: Use extra_groups for adding temperature attributes"
Revert commit cfb5dc0f60 ("thermal: hwmon: Use extra_groups for adding
temperature attributes") because it is depended on by another one that
turned out to be problematic.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/1992232.tdWV9SEqCh@rafael.j.wysocki
2026-07-31 16:32:38 +02:00
Linus Walleij b8bc38bcec mfd: db8500-prcmu: Fold dbx500 header into db8500
Move the DBx500 PRCMU definitions into the DB8500 PRCMU
header and delete the wrapper header.

Convert users of simple PRCMU wrappers to call the DB8500 helpers
directly.

The dbx500-prcmu.h header was the result of an earlier attempt to
abstract several DBx5x SoC PRCMU units to use the same abstract
header. They are deleted from the kernel and this is not just
causing maintenance burden and build errors.

The stub code is using -ENOSYS in a way checkpatch complains about
so replace these with -EINVAL while we're at it.

Assisted-by: Codex:gpt-5-5
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606180825.vUSQntkJ-lkp@intel.com/
Signed-off-by: Linus Walleij <linusw@kernel.org>
Acked-by: Brian Masney <bmasney@redhat.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/oe-kbuild-all/202606180825.vUSQntkJ-lkp@intel.com/
Link: https://patch.msgid.link/20260619-mfd-prcmu-merge-headers-v1-1-8ea0ee23b4d6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2026-07-30 14:32:45 +01:00
Can Peng bcc6d886e5 thermal/drivers/imx: Disable clock on runtime resume failure
imx_thermal_runtime_resume() enables the thermal clock before
powering up the sensor and enabling measurements.

If either regmap_write() fails, the function returns with the clock
still enabled. This leaves the clock enable count unbalanced after a
failed runtime resume.

Disable the clock on those failure paths before returning the error.

Fixes: 4cf2ddf16e ("thermal/drivers/imx: Implement runtime PM support")
Cc: stable@vger.kernel.org
Signed-off-by: Can Peng <pengcan@kylinos.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260722084909.463437-1-pengcan@kylinos.cn
2026-07-27 16:38:43 +02:00
Rakesh Kota 0c569e2202 thermal/drivers/qcom-spmi-adc-tm5: Drop IIO_VAL_INT check in adc_tm5_get_temp
Commit bb21ee31f5 ("iio: Fix iio_multiply_value use in
iio_read_channel_processed_scale") fixed the
iio_read_channel_processed_scale to return 0 on success instead
of IIO_VAL_INT (1). The existing check in adc_tm5_get_temp()
treated a successful return as an error because it expected
IIO_VAL_INT. Drop the redundant `ret != IIO_VAL_INT` condition
and rely solely on the negative error check.

Fixes: bb21ee31f5 ("iio: Fix iio_multiply_value use in iio_read_channel_processed_scale")
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://patch.msgid.link/20260724-adc-tm5-drop-iio-val-int-check-v1-1-0b85a0895dd7@oss.qualcomm.com
2026-07-27 16:15:06 +02:00
Christian Marangi b20d978275 thermal/drivers/airoha: Add support for AN7583 Thermal Sensor
Add support for Airoha AN7583 Thermal driver. This apply similar logic
on how to read the temperature but totally drop support for the
PTP_THERMAL subsystem. PTP_THERMAL subsystem was a way to trigger trip
point from hardware by configuring how to read the temperature
internally.

This subsystem has been totally removed from Airoha AN7583 permitting
only to read the temperature.

The SoC support up to 3 sensor but the original driver always read the
BGA sensor hence it's currently implemented reading only this specific
sensor. Reference and values for the other 2 sensor are defined for
further implementation if confirmed working.

set_thermal_mux() is extended to also address muxing the sensor as
AN7583 use a different way to read the temperature from 3 different
diode. The EN7581 code is updated to account for these changes.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260702094846.17325-8-ansuelsmth@gmail.com
2026-07-27 16:02:46 +02:00
Christian Marangi 86741c9128 thermal/drivers/airoha: Generalize get_thermal_ADC and set_mux function
In preparation for support of Airoha AN7583, generalize
get_thermal_ADC() and set_thermal_mux() with the use of reg_field API.

This is to take into account the same logic between the current
supported SoC and the new one but with different register address.

While at it also further improve some comments and move sleep inside the
set_thermal_mux function.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260702094846.17325-6-ansuelsmth@gmail.com
2026-07-27 16:02:21 +02:00
Christian Marangi 62f6a66189 thermal/drivers/airoha: Generalize probe function
In preparation for support of Airoha AN7583, generalize the probe
function to address for the 2 SoC difference.

Implement a match_data struct where it's possible to define a more
specific probe and post_probe function and specific thermal ops and
pllrg protect value.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260702094846.17325-5-ansuelsmth@gmail.com
2026-07-27 16:01:57 +02:00
Christian Marangi a3137f1aa4 thermal/drivers/airoha: Convert to regmap API
In preparation for support of Airoha AN7583, convert the driver to
regmap API. This is needed as Airoha AN7583 will be based on syscon
regmap.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260702094846.17325-4-ansuelsmth@gmail.com
2026-07-27 15:57:46 +02:00
Christian Marangi 6791265d60 thermal/drivers/airoha: Fix copy paste error for sen internal
In airoha_thermal_setup_monitor there is a copy paste error on configuring
the internval for temp monitor. Fix the error and use the correct mask for
the sen interval for the EN7581_TEMPMONCTL2 register.

Fixes: 42de37f40e ("thermal/drivers: Add support for Airoha EN7581 thermal sensor")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Wayen Yan <win847@gmail.com>
Link: https://patch.msgid.link/20260702094846.17325-3-ansuelsmth@gmail.com
2026-07-27 15:57:16 +02:00
Christian Marangi 251621813f thermal/drivers/airoha: Fix copy paste error on clamp_t low temp
In airoha_thermal_set_trips, there is a copy paste error on clamping the
value for the low trip temp point. Fix it to the correct value and actually
clamp for the low variable.

Fixes: 42de37f40e ("thermal/drivers: Add support for Airoha EN7581 thermal sensor")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Wayen Yan <win847@gmail.com>
Link: https://patch.msgid.link/20260702094846.17325-2-ansuelsmth@gmail.com
2026-07-27 15:56:35 +02:00
Wolfram Sang b08e97bee0 thermal: Remove unneeded 'fast_io' parameter in regmap_config
When using MMIO with regmap, fast_io is implied. No need to set it
again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260705164311.2273-2-wsa+renesas@sang-engineering.com
2026-07-27 13:51:56 +02:00
Thorsten Blum de8e50af88 thermal: sysfs: Use sysfs_emit_at() in trans_table_show()
Replace snprintf() with sysfs_emit_at() in trans_table_show().
sysfs_emit_at() is preferred for formatting sysfs output because it
provides safer bounds checking.

Convert multiple PAGE_SIZE length checks to check the number of bytes
actually copied by sysfs_emit_at(), thus avoiding manual buffer size
accounting.

Consistently return -EFBIG when the transition table output exceeds the
sysfs buffer, including the header row.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260719132251.31936-3-thorsten.blum@linux.dev
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-23 15:40:27 +02:00
Dmitry Antipov f1e50b1bcc thermal: intel: int340x: simplify ptc_temperature_write()
Simplify 'ptc_temperature_write()' by using the convenient
'kstrtou32_from_user()'.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20260702160240.2929965-1-dmantipov@yandex.ru
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 17:04:10 +02:00
Pan Chuang 5cc6da534c thermal: intel: bxt_pmic: Remove redundant dev_err()
The devm_request_threaded_irq() now automatically logs detailed error
messages on failure. This eliminates the need for driver-specific
dev_err() calls that previously printed generic messages.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
[ rjw: Subject adjustment ]
Link: https://patch.msgid.link/20260709023048.599150-12-panchuang@vivo.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 16:59:40 +02:00
Pan Chuang 7529239146 thermal: intel: int340x: Remove redundant dev_err()
The devm_request_threaded_irq() now automatically logs detailed error
messages on failure. This eliminates the need for driver-specific
dev_err() calls that previously printed generic messages.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://patch.msgid.link/20260709023048.599150-11-panchuang@vivo.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 16:55:06 +02:00
Pengpeng Hou d83dc9ce57 thermal: intel: int3400: clean up ODVP on probe failures
evaluate_odvp() creates per-ODVP sysfs files before the thermal zone
and later probe resources are registered. The current unwind path only
calls cleanup_odvp() from the late sysfs failure path, so failures after
evaluate_odvp() but before that label, including
thermal_tripless_zone_device_register() failures, leave the ODVP files
and storage behind.

Move the ODVP cleanup to the common ART/TRT unwind path so every failure
after evaluate_odvp() releases the ODVP state. Also clear the cached
ODVP pointers in cleanup_odvp(), because evaluate_odvp() can already call
it for partial setup failures while probe continues.

Fixes: 006f006f1e ("thermal/int340x_thermal: Export OEM vendor variables")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260623015140.19300-1-pengpeng@iscas.ac.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 16:45:36 +02:00
Pengpeng Hou 28f34d7daf thermal: intel: int340x: clean up RFIM groups on DVFS failure
proc_thermal_rfim_add() can create the FIVR and DLVR sysfs groups
before creating the DVFS group.

If DVFS group creation fails while both earlier groups are enabled, the
current error handling removes only one group: the FIVR branch returns
before the DLVR cleanup branch can run.  This leaves the DLVR group
behind even though RFIM setup fails.

Use one DVFS failure path that removes all previously created RFIM
groups before returning the error.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260615065245.84252-1-pengpeng@iscas.ac.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-22 15:32:39 +02:00
Juergen Gross cdf3ab55a9 thermal/intel: Stop using 32-bit MSR interfaces
The 32-bit MSR interfaces rdmsr(), wrmsr(), rdmsr_safe() and
wrmsr_safe() 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>
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/20260703112232.1762925-1-jgross@suse.com
2026-07-17 10:26:49 +02:00
Ricardo Neri 1e768cc92b thermal: intel: Add a syscore shutdown callback for kexec reboot
A kexec reboot may load a kernel that does not support directed package-
level thermal interrupts. Without a shutdown callback, the directed
interrupt configuration remains enabled across kexec but will not be
handled correctly. In particular, if the CPU designated to receive the
directed interrupt goes offline, no other CPU in the package will receive
it.

Add a syscore shutdown callback to disable directed package-level thermal
interrupts on all packages before a kexec reboot. If the post-kexec kernel
does not enable directed interrupts, it falls back to broadcasting the
interrupt to all CPUs.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-6-3a26d1e47fc8@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-14 21:31:02 +02:00
Ricardo Neri 66e1929b48 thermal: intel: Add syscore callbacks for suspend and resume
Directed package-level thermal interrupts are serviced by a single CPU per
package. These handler CPUs are selected at boot through the CPU hotplug
infrastructure. This mechanism is sufficient to restore the directed
interrupt configuration when resuming from suspend for non-boot packages.
It also keeps the handler-tracking array updated.

For the boot package, CPU0 is chosen during boot because its CPU hotplug
online callback runs first. However, this callback is not invoked on
resume. The directed package-level interrupt configuration for the boot
package is not restored. Add a syscore resume callback to re-enable
directed package-level interrupts for this package.

Disabling directed interrupts during suspend is required to keep the
handler-tracking array in a consistent state for the boot package,
allowing the correct configuration to be restored on resume.

The resume callback must busy-wait for hardware acknowledgment of the
directed interrupt setup. Otherwise, the handler-tracking array could be
left in an inconsistent state. This implies running with interrupts
disabled for up to 15ms, though in practice it takes less than 1ms.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-5-3a26d1e47fc8@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-14 21:31:02 +02:00
Ricardo Neri 15520ed82b thermal: intel: Enable the Directed Package-level Thermal Interrupt
Package-level thermal interrupts are broadcast to all online CPUs within a
package, even though only one CPU needs to service them. This results in
unnecessary wakeups, lock contention, and corresponding performance and
power-efficiency penalties.

When supported by hardware, a CPU requests to receive directed package-
level thermal interrupts by setting a designated bit in
IA32_THERM_INTERRUPT. The operating system must then verify that hardware
has acknowledged this request by checking a designated bit in
IA32_PACKAGE_THERM_STATUS.

Enable directed package-level thermal interrupts on one CPU per package
using the CPU hotplug infrastructure. The first CPU of a package that
comes online will handle the interrupt. If the handling CPU goes offline,
select a new CPU. Temporarily enable directed interrupts on both the
current and new CPU until hardware acknowledges the new selection, then
disable them on the outgoing CPU.

Systems without directed-interrupt support continue to broadcast the
package-level interrupt to all CPUs.

Also, add a rollback mechanism in the CPU hotplug online callback to
fall back to broadcast mode if the directed-interrupt acknowledgment fails
in any package. This is most important during boot, when all CPUs in a
package come online and would otherwise keep retrying on faulty hardware.
A complete rollback is not needed in the CPU hotplug offline callback since
at that point the hardware is known to work.

While here, update an inline comment to point to the correct volume of the
Intel Software Developer's Manual.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-4-3a26d1e47fc8@linux.intel.com
[ rjw: Rebased on top of 7.2-rc2 ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-14 21:30:19 +02:00
Ricardo Neri 2bedc06404 thermal: intel: Add resources to handle directed package-level thermal interrupts
When supported by hardware, a CPU requests to receive directed package-
level thermal interrupts by setting a designated bit in
IA32_THERM_INTERRUPT. It is sufficient to have one CPU per package handling
the interrupt.

Add an array to keep track of those CPUs as well as init and cleanup
functions. A subsequent changeset will designate a CPU per package to
handle the interrupt.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-3-3a26d1e47fc8@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-10 12:32:54 +02:00
Bryan B. Lima cbe31d5ce4 thermal/drivers/armada: Use bitfield and bitmask macros
Replace manual bitfield manipulations with FIELD_MODIFY() and define
constants with BIT() and GENMASK() to make code more readable.

Also, remove offset and shift constants for clarity in use of bitfield
macros.

Signed-off-by: Bryan B. Lima <bblima@usp.br>
Co-developed-by: Gustavo S. Correa <gustavoscorrea@usp.br>
Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260701010802.99029-1-bblima@usp.br
2026-07-08 13:22:15 +02:00
Dan Carpenter dd04ad1cda thermal/drivers/rcar: Fix error checking in probe()
This code accidentally calls thermal_zone_device_enable() before checking
whether thermal_zone_device_register_with_trips() failed.  Move the call
until later to avoid an error pointer dereference of "priv->zone".

The driver works differently depending on if we are using OF thermal or
not.  We use thermal_add_hwmon_sysfs() if we are using OF thermal and
call thermal_zone_device_enable() if not.  We can share same error check
for if either of these fail.

Moving the thermal_zone_device_enable() call is a bit cleaner as well.
The original code used a three step process to cleanup:
1. Call thermal_zone_device_unregister() to cleanup.
2. Set priv->zone to an error pointer to preserve the error code.
3. Set priv->zone to NULL to avoid a second call to
   thermal_zone_device_unregister() in the rcar_thermal_remove()
   function.

Now we can just do a direct goto error_unregister and rcar_thermal_remove()
handles the cleanup properly.

Fixes: bbcf90c064 ("thermal: Explicitly enable non-changing thermal zone devices")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/aj5WnseULiwgmlWv@stanley.mountain
2026-07-08 13:18:36 +02:00
Borislav Petkov (AMD) 3eaa50e1e2 x86/cpu: Hide and rename static_cpu_has()
cpu_feature_enabled() is the one to use to test feature flags so hide
the static thing which doesn't pay attention to disabled mask bits
anyway.

Use the following command to do the replacement:

  $ git grep --files-with-matches -w static_cpu_has -- ':(exclude)*cpufeature.h' \
  | xargs sed -i 's/static_cpu_has(/cpu_feature_enabled\(/g'

There should be no functional changes resulting from this.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Link: https://patch.msgid.link/20260620015041.336288-1-bp@kernel.org
2026-07-06 21:34:26 -07:00