Commit Graph

3475 Commits

Author SHA1 Message Date
Linus Torvalds
a9547379cb Thermal control fixes for 7.4-rc1
- Fix CPU mask truncation in power limit trace event used by the power
    allocator thermal governor (Hungyu Lin)
 
  - Fix code indentation in create_s32_tzp_attr() and rearrange it to
    use early return when applicable (Thorsten Blum)
 
  - Allow cross builds of the Intel thermal tests (Sasha Levin)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrk+OUSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1l6sH/1hdre7kr1AixczWHUuhG22QZpOT2uV0
 UWQ5woVkcFivobTemz+3OZR5sA2bx2iuO7AsNUqDwOTEnxuH4vAB7STwp7CM2gBE
 x2/1ZWdHje7QBw0sXEiH5RYQDkLeOMcfS8lXnXzoEVIkRz86vEd9yzRQfbvK/nNv
 PEhTScmXN+euC1ZWglVOjzx/NEEjHnLvSrAU2nuKhEp7VOx0niL2BAtMKYM0w44X
 cmPpmqs2TG1ya5rGNxwQYZa9XKFZ9QSNXfPClyncy1MJDRJKBcvYo5Xi7JZGh3yh
 pTJeuS4UPYwKEWCEdSFOsbgruWjxfLAqQlMfGNAfWOMvB8YMl8Kt/Mk=
 =M2+P
 -----END PGP SIGNATURE-----

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

Pull thermal control fixes from Rafael Wysocki:
 "These fix three issues related to thermal control:

   - Fix CPU mask truncation in power limit trace event used by the
     power allocator thermal governor (Hungyu Lin)

   - Fix code indentation in create_s32_tzp_attr() and rearrange it to
     use early return when applicable (Thorsten Blum)

   - Allow cross builds of the Intel thermal tests (Sasha Levin)"

* tag 'thermal-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: sysfs: Fix indentation in create_s32_tzp_attr()
  thermal: Fix CPU mask truncation in power limit trace event
  selftests/thermal: allow cross builds of the Intel tests
2026-10-30 13:28:58 -10:00
Linus Torvalds
e3e15872e7 ACPI support fixes for 7.4-rc1
- Separate handler locking from sysfs lifetime in the ACPI platform
    profile driver to avoid possible deadlocks due to sysfs accesses
    during driver removal (Daniel Lezcano)
 
  - Introduce additional locking around the evaluation of selected ACPI
    control methods in a few places to work around issues related to
    concurrency in AML on some platforms (Ali Ahmet Memiş)
 
  - Address two issues reported by Sashiko in the ACPI table data sysfs
    interface (Jamie Nguyen)
 
  - Initialize parser_state.aml_end in acpi_install_method() properly to
    avoid out-of-bounds accesses during control method installation (Ivan
    Hu)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrk+i0SHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1BKUIAIvsvGOzWnUBWGY2GN9umZfNbEFnYrXH
 7mbAzDTP5lDjyqnrod7eSjXAATxWISxupR7qVPSbqjqGURwzMCZsPeX4ZRd5pUTZ
 THA0KTeE57hMKj/dvzvFQKIswGUkruQ09NZ3J6KZ514CJJ7SgSOilbUDf+7xzbLZ
 yLDDBc0POqhZaKIuAYSFsoRw+D7PB2q/k5Hvv8VVhumDgl2YcCLcpQSG4lftqdxn
 R6bjVAQaKJj/nArxwdQRt/LdNSQu1WQgnLkq57Ewwd4tORBlgMsGP9GrR/9QaQqY
 E6VINShueGRnDNIMAzb4imbXVsfE+gtoyYdAffCTV3HXy8aoJ95OwGA=
 =04kC
 -----END PGP SIGNATURE-----

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

Pull ACPI support fixes from Rafael Wysocki:
 "These address assorted issues in ACPI support code and work around
  concurrency-related issues in AML on some platforms:

   - Separate handler locking from sysfs lifetime in the ACPI platform
     profile driver to avoid possible deadlocks due to sysfs accesses
     during driver removal (Daniel Lezcano)

   - Introduce additional locking around the evaluation of selected ACPI
     control methods in a few places to work around issues related to
     concurrency in AML on some platforms (Ali Ahmet Memiş)

   - Address two issues reported by Sashiko in the ACPI table data sysfs
     interface (Jamie Nguyen)

   - Initialize parser_state.aml_end in acpi_install_method() properly
     to avoid out-of-bounds accesses during control method installation
     (Ivan Hu)"

* tag 'acpi-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: sysfs: Finish sysfs init when creating a table file fails
  ACPI: sysfs: Map only the requested range in acpi_data_show()
  ACPICA: Initialize parser_state.aml_end in acpi_install_method()
  ACPI: platform_profile: Separate handler locking from sysfs lifetime
  platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively
  thermal: intel: int340x: Evaluate _TMP exclusively
  ACPI: battery: Evaluate battery methods exclusively
  ACPI: utils: Add exclusive AML evaluation helpers
2026-10-30 13:10:30 -10:00
Thorsten Blum
361da59d79 thermal: sysfs: Fix indentation in create_s32_tzp_attr()
Indent the show callback consistently with the store callback and use an
early return if the thermal zone parameters are not available.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20261003000011.58045-3-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-10-26 20:25:09 +01:00
Hungyu Lin
82c9c94f54 thermal: Fix CPU mask truncation in power limit trace event
num_possible_cpus() counts CPUs, but CPU IDs need not be contiguous.
Using it to size the thermal_power_cpu_limit bitmap can omit CPUs with
higher IDs. For example, possible CPUs 0 and 64 produce an eight-byte
bitmap on a 64-bit system, dropping CPU 64.

Use nr_cpumask_bits for both sizing and copying the bitmap.

Fixes: 6828a4711f ("thermal: add trace events to the power allocator governor")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261023060724.5691-1-dennylin0707@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-10-26 20:21:23 +01:00
Linus Torvalds
d857e1f3fa MFD for v7.4
- New Support & Features
   - Cirrus Logic CS42L43: Add support for the CS42L44 variant
   - Khadas MCU: Add support for the VIM4 MCU variant along with per-variant fan duty-cycle
     levels and optional fan supply regulator support
   - Maxim MAX77705: Add support for the PASS2 hardware revision
   - MediaTek MT6397: Add AUXADC sub-device support for MT6397
   - Motorola CPCAP: Support per-board sub-device compositions and add the Tegra20 Mot
     composition
   - ROHM BD73800: Add support for the BD73800 PMIC core, regulator, RTC, clock gate, and
     GPIO sub-devices
   - TI LM3533: Add VIN regulator supply support, configure initial backlight mapping mode
     from Device Tree, and implement the `backlight_scale` property
   - X-Powers AC200: Add support for the AC200 I2C mixed-signal companion IC
 
 - Improvements & Fixes
   - Cirrus Logic CS42L43: Synchronize SoundWire enumeration work in `remove()` before
     devres cleanup begins
   - Dialog DA903x: Manage IRQ work cancellation and sub-device removal via devres to
     prevent use-after-free during teardown
   - Dialog DA9150: Balance `enable_irq_wake()` with `disable_irq_wake()` during probe
     failure and driver removal
   - Intel LPSS: Add DMI quirks for Dell Latitude 5285 and 7275 to ignore ACPI resource
     conflicts on the I2C4 controller
   - Intel Quark I2C/GPIO: Manage the fixed-rate clock and its clkdev lookup with devres to
     fix a resource leak on unbind
   - Maxim MAX77705: Select `REGMAP_I2C` and `REGMAP_IRQ` in Kconfig to fix build errors
   - Qualcomm WCD934x: Initialize the parent DMA mask to suppress "DMA mask not set"
     warnings on child devices
   - Qualcomm WCD934x: Pass the valid device pointer to `dev_err_probe()` on IRQ lookup
     failure to avoid a NULL pointer dereference
   - Rockchip RK8xx: Register the poweroff handler in the atomic `SYS_OFF_MODE_POWER_OFF`
     phase so polling I2C transfers complete during shutdown
   - ST-Ericsson AB8500: Use `devm_mfd_add_devices()` to prevent leaking child devices on
     probe failure
   - TI BQ257xx: Mark self-modifying BQ25792 configuration registers as volatile
   - TI LM3533: Set `coherent_dma_mask` to zero to suppress "DMA mask not set" warnings
   - TI TPS65217: Check for errors during IRQ initialization and masking, and manage IRQ
     domain and wake teardown with devres
   - TI TWL: Unregister the auxiliary platform device via a devres action on probe failure
     and driver unbind
 
 - Cleanups & Refactoring
   - Core: Convert drivers from deprecated `SIMPLE_DEV_PM_OPS()` to
     `DEFINE_SIMPLE_DEV_PM_OPS()` and `pm_sleep_ptr()`
   - Core: Fix spelling mistakes in comments across various MFD drivers and headers
   - Maintainers: Add ROHM BD73800 PMIC files under the ROHM PMIC entry
   - Maintainers: Specify the `for-mfd-next` branch for the MFD and Syscon git trees
   - Dialog DA9062: Use `DEFINE_RES_IRQ_NAMED()` for IRQ resource definitions
   - Intel LPSS: Simplify DebugFS handling by dropping redundant error checks and
     intermediate dentry variables, using octal permissions, and switching to
     `debugfs_remove()`
   - Khadas MCU: Convert MFD cell arrays to `const` and use `MFD_CELL_NAME()`
   - ST-Ericsson AB8500: Fix a spelling typo in a comment
   - TI LM3533: Convert from platform data to Device Tree bindings and pass only regmap and
     light sensor presence to child devices
   - TI LM3533: Remove driver-specific regmap wrappers, redundant pdata helpers, and
     unnecessary `extern` qualifiers, and use `dev_groups` for sysfs attributes
   - Wolfson WM831x: Fix a spelling typo in a comment
 
 - Device Tree Binding Updates
   - HiSilicon Hi6421 SPMI: Fix the compatible string to match `hisilicon,hi6421-spmi`
   - MediaTek MT6357: Allow an `adc` child node
   - MediaTek MT6360: Allow two-cell interrupt specifiers with trigger flags
   - MediaTek MT6397: Document the `#sound-dai-cells` property
   - MediaTek MT6397: Document the battery-backed NVMEM layout under the RTC child node
   - MediaTek MT6397: Document the MT6323 PMIC EFUSE child node
   - Motorola CPCAP: Convert MFD and power button bindings to DT schema and document the
     Mapphone and Mot compositions
   - Qualcomm SPMI PMIC: Document the PM4125 audio codec compatible
   - Qualcomm SPMI PMIC: Document the PMAU0102 PMIC compatible
   - Qualcomm TCSR: Document the MSM8952 TCSR compatible
   - Rockchip RK805: Fold the pin controller binding into the RK805 PMIC DT schema
   - ROHM BD73800: Document the BD73800 PMIC and its regulators
   - ROHM PMIC: Factor out common pin properties into `rohm,pmic-pins.yaml` and reference
     them across BD71815, BD71828, and BD72720 bindings
   - ST-Ericsson AB8500: Document AB8500 and AB8505 buck converter regulators
   - ST-Ericsson AB8500: Document codec audio graph ports, sound DAI cells, and analog
     microphone wiring properties
   - ST-Ericsson DB8500 PRCMU: Deprecate the `db8500-prcmu-regulators` child node and make
     it optional
   - Syscon: Document the Ambarella CV75 secure scratchpad compatible
   - TI BQ25703A: Add the BQ25798 compatible with fallback to BQ25792
   - TI Keystone: Convert Device State Control bindings to DT schema
   - TI LM3533: Document the LM3533 LED controller, backlight, and indicator LED bindings
   - TI LP3943: Convert MFD and PWM bindings to DT schema
   - TI TPS61050: Convert bindings to DT schema
   - TI TPS65086: Make the `regulators` child node optional
   - TI TPS65910: Document `wakeup-source` and GPIO hog child nodes
   - TI TWL6040: Convert bindings to DT schema and align property names with the driver
   - X-Powers AC200: Document the AC200 mixed-signal companion IC
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmrfbfQACgkQUa+KL4f8
 d2FqyxAAsju3PmhlmAdSaHEYXu3PQwzV4j9ZJ4jynWeMyVcKGPePiWfaaSqpyQ36
 gn95B6ZoFlVl9aRAKu0kaLCSx2oGTtD9BoQ6jjfvVW6yU4LzmhvdCw+Zr7Img61H
 rv+kYmZiqzwt1LGaGBbbDNtP1q+B+QFKvgdDGvaiRKGEvOtuKuASLnD4t8jtWuLT
 5VIMFcCFqySeYUwLMnLQk8C2Fqysx1dPvOe0doe90vPF5tpKI8ZNIrbk0OruQzlN
 tfQahrfUnmkZGdjO+lalbkwSvlSrs+6KTckr53fyrIYHILPJcbfnFPimLhDzBVG4
 Ko/WnjGWwt2XkfIkGJJALUZptyz5YpfKfwxl+Xi3NAyWkpVcKfI0nASLd6T8QO4h
 mJQsg2SQer3/HCY2z8Hs8IW1XBhzLPtZN+e5qPOIPBNW3D11y92KodvjMxfSRmdz
 lCeIJohs5md75f3aFUqFSi0iDv4tgTZ2BCUSz9BzqYgkA7cQYlmQrYEqFrhHQFjo
 sYAAFBlg4SLJ5J5N1cEp8DFrjompbqDCenm2csntvJhWQ6hmxHbm5zEKMKeXUYLw
 le+E+jpvg7EXoEsoy+3dVY89gdMpnVN68A7wRCH8EVIrIzq1pRpFpX2V9kd85sro
 SV1LOuEnnnyjEdJ3wSQGEKkPXdy/YZguMBDqoFKw3ODV0cez/cE=
 =Is2H
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Support & Features:
   - Cirrus Logic CS42L43: Add support for the CS42L44 variant
   - Khadas MCU: Add support for the VIM4 MCU variant along with
     per-variant fan duty-cycle levels and optional fan supply regulator
     support
   - Maxim MAX77705: Add support for the PASS2 hardware revision
   - MediaTek MT6397: Add AUXADC sub-device support for MT6397
   - Motorola CPCAP: Support per-board sub-device compositions and add
     the Tegra20 Mot composition
   - ROHM BD73800: Add support for the BD73800 PMIC core, regulator,
     RTC, clock gate, and GPIO sub-devices
   - TI LM3533: Add VIN regulator supply support, configure initial
     backlight mapping mode from Device Tree, and implement the
     `backlight_scale` property
   - X-Powers AC200: Add support for the AC200 I2C mixed-signal companion IC

  Improvements & Fixes:
   - Cirrus Logic CS42L43: Synchronize SoundWire enumeration work in
     `remove()` before devres cleanup begins
   - Dialog DA903x: Manage IRQ work cancellation and sub-device removal
     via devres to prevent use-after-free during teardown
   - Dialog DA9150: Balance `enable_irq_wake()` with
     `disable_irq_wake()` during probe failure and driver removal
   - Intel LPSS: Add DMI quirks for Dell Latitude 5285 and 7275 to
     ignore ACPI resource conflicts on the I2C4 controller
   - Intel Quark I2C/GPIO: Manage the fixed-rate clock and its clkdev
     lookup with devres to fix a resource leak on unbind
   - Maxim MAX77705: Select `REGMAP_I2C` and `REGMAP_IRQ` in Kconfig to
     fix build errors
   - Qualcomm WCD934x: Initialize the parent DMA mask to suppress "DMA
     mask not set" warnings on child devices
   - Qualcomm WCD934x: Pass the valid device pointer to
     `dev_err_probe()` on IRQ lookup failure to avoid a NULL pointer
     dereference
   - Rockchip RK8xx: Register the poweroff handler in the atomic
     `SYS_OFF_MODE_POWER_OFF` phase so polling I2C transfers complete
     during shutdown
   - ST-Ericsson AB8500: Use `devm_mfd_add_devices()` to prevent leaking
     child devices on probe failure
   - TI BQ257xx: Mark self-modifying BQ25792 configuration registers as
     volatile
   - TI LM3533: Set `coherent_dma_mask` to zero to suppress "DMA mask
     not set" warnings
   - TI TPS65217: Check for errors during IRQ initialization and
     masking, and manage IRQ domain and wake teardown with devres
   - TI TWL: Unregister the auxiliary platform device via a devres
     action on probe failure and driver unbind

  Cleanups & Refactoring
   - Core: Convert drivers from deprecated `SIMPLE_DEV_PM_OPS()` to
     `DEFINE_SIMPLE_DEV_PM_OPS()` and `pm_sleep_ptr()`
   - Core: Fix spelling mistakes in comments across various MFD drivers
     and headers
   - Maintainers: Add ROHM BD73800 PMIC files under the ROHM PMIC entry
   - Maintainers: Specify the `for-mfd-next` branch for the MFD and
     Syscon git trees
   - Dialog DA9062: Use `DEFINE_RES_IRQ_NAMED()` for IRQ resource
     definitions
   - Intel LPSS: Simplify DebugFS handling by dropping redundant error
     checks and intermediate dentry variables, using octal permissions,
     and switching to
    `debugfs_remove()`
   - Khadas MCU: Convert MFD cell arrays to `const` and use
     `MFD_CELL_NAME()`
   - ST-Ericsson AB8500: Fix a spelling typo in a comment
   - TI LM3533: Convert from platform data to Device Tree bindings and
     pass only regmap and light sensor presence to child devices
   - TI LM3533: Remove driver-specific regmap wrappers, redundant pdata
     helpers, and unnecessary `extern` qualifiers, and use `dev_groups`
     for sysfs attributes
   - Wolfson WM831x: Fix a spelling typo in a comment

  Device Tree Binding Updates
   - HiSilicon Hi6421 SPMI: Fix the compatible string to match
     `hisilicon,hi6421-spmi`
   - MediaTek MT6357: Allow an `adc` child node
   - MediaTek MT6360: Allow two-cell interrupt specifiers with trigger
     flags
   - MediaTek MT6397: Document the `#sound-dai-cells` property
   - MediaTek MT6397: Document the battery-backed NVMEM layout under the
     RTC child node
   - MediaTek MT6397: Document the MT6323 PMIC EFUSE child node
   - Motorola CPCAP: Convert MFD and power button bindings to DT schema
     and document the Mapphone and Mot compositions
   - Qualcomm SPMI PMIC: Document the PM4125 audio codec compatible
   - Qualcomm SPMI PMIC: Document the PMAU0102 PMIC compatible
   - Qualcomm TCSR: Document the MSM8952 TCSR compatible
   - Rockchip RK805: Fold the pin controller binding into the RK805 PMIC
     DT schema
   - ROHM BD73800: Document the BD73800 PMIC and its regulators
   - ROHM PMIC: Factor out common pin properties into
     `rohm,pmic-pins.yaml` and reference them across BD71815, BD71828,
     and BD72720 bindings
   - ST-Ericsson AB8500: Document AB8500 and AB8505 buck converter
     regulators
   - ST-Ericsson AB8500: Document codec audio graph ports, sound DAI
     cells, and analog microphone wiring properties
   - ST-Ericsson DB8500 PRCMU: Deprecate the `db8500-prcmu-regulators`
     child node and make it optional
   - Syscon: Document the Ambarella CV75 secure scratchpad compatible
   - TI BQ25703A: Add the BQ25798 compatible with fallback to BQ25792
   - TI Keystone: Convert Device State Control bindings to DT schema
   - TI LM3533: Document the LM3533 LED controller, backlight, and
     indicator LED bindings
   - TI LP3943: Convert MFD and PWM bindings to DT schema
   - TI TPS61050: Convert bindings to DT schema
   - TI TPS65086: Make the `regulators` child node optional
   - TI TPS65910: Document `wakeup-source` and GPIO hog child nodes
   - TI TWL6040: Convert bindings to DT schema and align property names
     with the driver
   - X-Powers AC200: Document the AC200 mixed-signal companion IC"

* tag 'mfd-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (74 commits)
  dt-bindings: mfd: db8500-prcmu: Deprecate EPOD regulators
  dt-bindings: mfd: syscon: Add Ambarella CV75 secure scratchpad
  dt-bindings: mfd: rockchip,rk805: Convert pinctrl to DT schema
  mfd: intel-lpss: Add Dell Latitude 7275 to the resource conflict quirk
  mfd: intel-lpss: Add resource conflict quirk for Dell Latitude 5285
  mfd: tps65217: Use devres for IRQ domain and wake teardown
  mfd: tps65217: Check return value when masking interrupt sources
  mfd: tps65217: Fix NULL pointer dereference on IRQ init failure
  dt-bindings: mfd: qcom,spmi-pmic: Add compatibles for pm4125-codec
  mfd: bq257xx: Mark self-modifying BQ25792 registers volatile
  dt-bindings: mfd: mediatek: mt6397: describe the RTC's nvmem layout
  mfd: mt6397-core: Add mt6397 AUXADC support
  mfd: max77705: Mark PASS2 revision as supported
  mfd: ab8500: Fix child device leaks on probe failure
  dt-bindings: mfd: Add MT6397 sound DAI cells
  dt-bindings: mfd: mediatek: mt6397: Add mt6323 PMIC EFUSE
  dt-bindings: mfd: hisilicon: Fix Hi6421 SPMI compatible
  dt-bindings: mfd: ti,bq25703a: Expand to include BQ25798
  dt-bindings: mfd: Allow MT6360 interrupt flags
  dt-bindings: mfd: mediatek: Allow MT6357 ADC
  ...
2026-10-26 08:38:17 -10:00
Ali Ahmet Memiş
c4aae727be thermal: intel: int340x: Evaluate _TMP exclusively
On ThinkPad P1 Gen2 and P53, INT3403 _TMP switches the EC page selector
without taking the mutex the battery methods use, so it must not run
interleaved with them.

Evaluate _TMP with acpi_evaluate_integer_exclusive(), also where int3403
and processor_thermal probe for it.

Fixes: d33e89d122 ("thermal: core: Suspend thermal zones later and resume them earlier")
Reported-by: Charis Stratakis <c.stratakis@proton.me>
Closes: https://lore.kernel.org/all/37N_jFulf7n-Z55NfKfE71C_wVPxYvZ0xD_iRUg2fXu7TypDiF5PStQ6siSfVBih6fThg5WoPes8U5ZQpfVm_teMFcUGXFxz2DdMbfSWuws=@proton.me/
Cc: All applicable <stable@vger.kernel.org> # 80892972ff ACPI: utils: Add exclusive AML evaluation helpers
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20261018122220.678822-4-aliamemis@disroot.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-10-22 19:05:28 +02:00
Linus Torvalds
4403278e4e Thermal control updates for 7.4-rc1
- Make the Intel powerclamp thermal driver reject invalid window_size
    values, drop redundant clamp() from duration_set() in it, and
    simplify 4 functions in it (Thorsten Blum)
 
  - Add rugged Panther Lake support to the intel_tcc_cooling thermal
    driver (Srinivas Pandruvada)
 
  - Fix temperature selection around 0 C in the int340x thermal driver,
    drop redundant else from proc_thermal_add() in it, and simplify
    slider_def_*_set() in it (Thorsten Blum)
 
  - Drop unbalanced paren from cpu-idle-cooling.rst (Manuel Ebner)
 
  - Use %pe to print error pointers symbolically in the thermal control
    code and fix assorted typos in comments in it (Sumeet Pawnikar and
    Hemanth Selam)
 
  - Add the Exynos ACPM thermal driver for Google GS101, along with
    DT bindings and a MAINTAINERS entry (Tudor Ambarus)
 
  - Add Renesas RZ/G3L thermal sensor support and DT bindings, and move
    default calibration values to per-SoC match data (Biju Das)
 
  - Add Qualcomm MSM8952 TSENS support and the corresponding DT binding
    compatible (Muzaffer Kadir)
 
  - Document the Qualcomm PMAU0102 Master BandGap temperature monitor
    compatible in the DT bindings (Dhruvin Rajpura)
 
  - Extend the QCom TSENS v2 trip temperature limits to the hardware
    range of -204°C to +204°C to prevent interrupt storms when operating
    beyond the previous software limits (Priyansh Jain)
 
  - Fix temperature threshold map indexing in the QCom SPMI temperature
    alarm driver to prevent out-of-bounds reads (Georgi Djakov)
 
  - Describe the additional bus clock required by the Amlogic T7 thermal
    sensor and switch the driver to the clk_bulk API to manage multiple
    clocks (Ronald Claveau)
 
  - Request the Airoha EN7581 IRQ after thermal zone registration to
    prevent the interrupt handler from accessing an unregistered or
    already freed thermal zone (Vitaliy Sochnev)
 
  - Fix the Airoha AN7583 ADC mux field mapping, serialize access to the
    shared ADC, and verify mux selection to avoid invalid temperature
    readings and spurious critical shutdowns (Vitaliy Sochnev)
 
  - Register separate thermal zones for the AN7583 bandgap, GbE and CPU
    sensors, and update the DT bindings to use one thermal sensor cell
    to select the sensor (Vitaliy Sochnev)
 
  - Fix signed integer overflow in the Renesas RZ/G3E temperature-to-code
    conversion, preserve compare interrupt state across runtime PM,
    and prevent overlapping temperature conversions (Ovidiu Panait)
 
  - Remove redundant trip window validation and runtime PM
    pm_runtime_mark_last_busy() calls from the Renesas RZ/G3E driver
    (Ovidiu Panait)
 
  - Propagate reset assertion failures from Renesas RZ/G3E suspend and
    attempt to restore power if the sensor was active (Pengpeng Hou)
 
  - Stop the TI bandgap alert IRQ before removing sensor interfaces and
    cancel pending alert work to prevent use-after-free on driver removal
    (Weigang He)
 
  - Validate Spreadtrum sensor IDs read from the device tree before using
    them for register offsets and array indexing (Weigang He)
 
  - Convert the TI OMAP bandgap DT bindings to schema and document the
    DRA752 compatible and thermal sensor cells (Bhargav Joshi)
 
  - Use DT property helpers matching the signed temperature and unsigned
    hysteresis types defined by the thermal zone bindings (Rob Herring)
 
  - Reuse common error handling code in the power allocator governor
    bind callback (Markus Elfring)
 
  - Constify the thermal zone device operations in the i.MX9 driver
    (Christophe JAILLET)
 
  - Fix kernel-doc parameter names and firmware node references in the
    cooling device registration helpers (Aryan Sinha)
 
  - Correct the documented return value of ti_bandgap_get_sensor_data()
    to describe validation errors and potentially NULL stored data
    (Karl Mehltretter)
 
  - Ensure NUL-termination when copying the cooling device command-line
    argument in tmon and fix the associated string truncation warning
    (Florian Fainelli)
 
  - Fix undefined behavior caused by a signed shift in the tmon thermal
    zone binding display (Liu Jing)
 
  - Fix wording in tmon comments (Hemanth Selam)
 
  - Simplify cpufreq_set_cur_state() in the cpufreq_cooling thermal
    control driver (Thorsten Blum)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrWO9cSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1HisH/3xEFIHZG7l+OHCETxNJDq3kC+4g48OM
 s7c96CuKI//bhNe0IZ0CBhSskqHAeU8gpxL3PjJOXFBFdrWkPOxjwzOVCOY0JOA6
 CZK8JiInyY6zBGXneHrySGD9QvJJ21EoYH0aIKaRAfgQyCHj5ETKa/SxAlNuLkqY
 wKMhRdofD+1ZvTe4voV4F9Brb4JUruPAJkMYdG1cU8LV9SVkW9KaEYWsS/ZLm7aC
 rY8UexK48vR9o80pR/zI48j5dndhO29PzRV5WeR1GSMcnYxIE7K5W4zTniwj5Zoh
 tv8fdC05eFbN2b3IEwaHix5xn7wK+T5KzXhau1aH+YJTSVeaW1gZo+k=
 =uhgs
 -----END PGP SIGNATURE-----

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

Pull thermal control updates from Rafael Wysocki:
 "These are mostly updates of thermal drivers including a new Exynos
  ACPM thermal driver for Google GS101, new Renesas RZ/G3L thermal
  sensor support, new Qualcomm MSM8952 TSENS support, new Qualcomm
  PMAU0102 Master BandGap temperature monitor support in DT bindings,
  and new rugged Panther Lake support in intel_tcc_cooling. Moreover,
  the AN7583 driver is extended to register separate thermal zones for
  bandgap, GbE and CPU (its DT bindings are updated accordingly).

  There are also multiple fixes and assorted cleanups, as usual.

  Specifics:

   - Make the Intel powerclamp thermal driver reject invalid window_size
     values, drop redundant clamp() from duration_set() in it, and
     simplify 4 functions in it (Thorsten Blum)

   - Add rugged Panther Lake support to the intel_tcc_cooling thermal
     driver (Srinivas Pandruvada)

   - Fix temperature selection around 0 C in the int340x thermal driver,
     drop redundant else from proc_thermal_add() in it, and simplify
     slider_def_*_set() in it (Thorsten Blum)

   - Drop unbalanced paren from cpu-idle-cooling.rst (Manuel Ebner)

   - Use %pe to print error pointers symbolically in the thermal control
     code and fix assorted typos in comments in it (Sumeet Pawnikar and
     Hemanth Selam)

   - Add the Exynos ACPM thermal driver for Google GS101, along with DT
     bindings and a MAINTAINERS entry (Tudor Ambarus)

   - Add Renesas RZ/G3L thermal sensor support and DT bindings, and move
     default calibration values to per-SoC match data (Biju Das)

   - Add Qualcomm MSM8952 TSENS support and the corresponding DT binding
     compatible (Muzaffer Kadir)

   - Document the Qualcomm PMAU0102 Master BandGap temperature monitor
     compatible in the DT bindings (Dhruvin Rajpura)

   - Extend the QCom TSENS v2 trip temperature limits to the hardware
     range of -204°C to +204°C to prevent interrupt storms when
     operating beyond the previous software limits (Priyansh Jain)

   - Fix temperature threshold map indexing in the QCom SPMI temperature
     alarm driver to prevent out-of-bounds reads (Georgi Djakov)

   - Describe the additional bus clock required by the Amlogic T7
     thermal sensor and switch the driver to the clk_bulk API to manage
     multiple clocks (Ronald Claveau)

   - Request the Airoha EN7581 IRQ after thermal zone registration to
     prevent the interrupt handler from accessing an unregistered or
     already freed thermal zone (Vitaliy Sochnev)

   - Fix the Airoha AN7583 ADC mux field mapping, serialize access to
     the shared ADC, and verify mux selection to avoid invalid
     temperature readings and spurious critical shutdowns (Vitaliy
     Sochnev)

   - Register separate thermal zones for the AN7583 bandgap, GbE and CPU
     sensors, and update the DT bindings to use one thermal sensor cell
     to select the sensor (Vitaliy Sochnev)

   - Fix signed integer overflow in the Renesas RZ/G3E
     temperature-to-code conversion, preserve compare interrupt state
     across runtime PM, and prevent overlapping temperature conversions
     (Ovidiu Panait)

   - Remove redundant trip window validation and runtime PM
     pm_runtime_mark_last_busy() calls from the Renesas RZ/G3E driver
     (Ovidiu Panait)

   - Propagate reset assertion failures from Renesas RZ/G3E suspend and
     attempt to restore power if the sensor was active (Pengpeng Hou)

   - Stop the TI bandgap alert IRQ before removing sensor interfaces and
     cancel pending alert work to prevent use-after-free on driver
     removal (Weigang He)

   - Validate Spreadtrum sensor IDs read from the device tree before
     using them for register offsets and array indexing (Weigang He)

   - Convert the TI OMAP bandgap DT bindings to schema and document the
     DRA752 compatible and thermal sensor cells (Bhargav Joshi)

   - Use DT property helpers matching the signed temperature and
     unsigned hysteresis types defined by the thermal zone bindings (Rob
     Herring)

   - Reuse common error handling code in the power allocator governor
     bind callback (Markus Elfring)

   - Constify the thermal zone device operations in the i.MX9 driver
     (Christophe JAILLET)

   - Fix kernel-doc parameter names and firmware node references in the
     cooling device registration helpers (Aryan Sinha)

   - Correct the documented return value of ti_bandgap_get_sensor_data()
     to describe validation errors and potentially NULL stored data
     (Karl Mehltretter)

   - Ensure NUL-termination when copying the cooling device command-line
     argument in tmon and fix the associated string truncation warning
     (Florian Fainelli)

   - Fix undefined behavior caused by a signed shift in the tmon thermal
     zone binding display (Liu Jing)

   - Fix wording in tmon comments (Hemanth Selam)

   - Simplify cpufreq_set_cur_state() in the cpufreq_cooling thermal
     control driver (Thorsten Blum)"

* tag 'thermal-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (51 commits)
  thermal/drivers/rzg3e: Propagate reset assertion failure from suspend
  thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
  thermal/fw: Fix kernel-doc parameter names
  thermal/qcom/tsens: Add support for MSM8952 tsens
  dt-bindings: thermal: tsens: Add MSM8952
  thermal/drivers/amlogic: Switch to clk_bulk API to support multiple clocks
  dt-bindings: thermal: amlogic: describe bus clock for t7-thermal
  tools/thermal/tmon: Fix string truncation warning in optarg copy
  thermal/drivers/airoha: Register a thermal zone per AN7583 sensor
  dt-bindings: arm: airoha: Use one thermal sensor cell for AN7583
  thermal/drivers/airoha: Serialise access to the shared ADC
  thermal/drivers/airoha: Fix AN7583 ADC mux field mapping
  thermal/drivers/sprd: validate the sensor id from the device tree
  thermal/drivers/ti-soc-thermal: Cancel pending alert work on remove
  thermal/drivers/qcom-spmi-temp-alarm: Fix temp_map indexing
  thermal: gov_power_allocator: Use common error handling code in power_allocator_bind()
  tools/thermal/tmon: Fix signed shift UB in binding display
  MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
  thermal/drivers/samsung: Add Exynos ACPM TMU driver GS101
  dt-bindings: thermal: Add Google GS101 TMU
  ...
2026-10-21 14:38:01 -10:00
Rafael J. Wysocki
503bb6e70b Merge branch 'thermal-drivers'
Merge updates of assorted thermal control drivers for 7.4:

 - Add the Exynos ACPM thermal driver for Google GS101, along with
   DT bindings and a MAINTAINERS entry (Tudor Ambarus)

 - Add Renesas RZ/G3L thermal sensor support and DT bindings, and move
   default calibration values to per-SoC match data (Biju Das)

 - Add Qualcomm MSM8952 TSENS support and the corresponding DT binding
   compatible (Muzaffer Kadir)

 - Document the Qualcomm PMAU0102 Master BandGap temperature monitor
   compatible in the DT bindings (Dhruvin Rajpura)

 - Extend the QCom TSENS v2 trip temperature limits to the hardware
   range of -204°C to +204°C to prevent interrupt storms when operating
   beyond the previous software limits (Priyansh Jain)

 - Fix temperature threshold map indexing in the QCom SPMI temperature
   alarm driver to prevent out-of-bounds reads (Georgi Djakov)

 - Describe the additional bus clock required by the Amlogic T7 thermal
   sensor and switch the driver to the clk_bulk API to manage multiple
   clocks (Ronald Claveau)

 - Request the Airoha EN7581 IRQ after thermal zone registration to
   prevent the interrupt handler from accessing an unregistered or
   already freed thermal zone (Vitaliy Sochnev)

 - Fix the Airoha AN7583 ADC mux field mapping, serialize access to the
   shared ADC, and verify mux selection to avoid invalid temperature
   readings and spurious critical shutdowns (Vitaliy Sochnev)

 - Register separate thermal zones for the AN7583 bandgap, GbE and CPU
   sensors, and update the DT bindings to use one thermal sensor cell
   to select the sensor (Vitaliy Sochnev)

 - Fix signed integer overflow in the Renesas RZ/G3E temperature-to-code
   conversion, preserve compare interrupt state across runtime PM,
   and prevent overlapping temperature conversions (Ovidiu Panait)

 - Remove redundant trip window validation and runtime PM
   pm_runtime_mark_last_busy() calls from the Renesas RZ/G3E driver
   (Ovidiu Panait)

 - Propagate reset assertion failures from Renesas RZ/G3E suspend and
   attempt to restore power if the sensor was active (Pengpeng Hou)

 - Stop the TI bandgap alert IRQ before removing sensor interfaces and
   cancel pending alert work to prevent use-after-free on driver removal
   (Weigang He)

 - Validate Spreadtrum sensor IDs read from the device tree before using
   them for register offsets and array indexing (Weigang He)

 - Convert the TI OMAP bandgap DT bindings to schema and document the
   DRA752 compatible and thermal sensor cells (Bhargav Joshi)

 - Use DT property helpers matching the signed temperature and unsigned
   hysteresis types defined by the thermal zone bindings (Rob Herring)

 - Reuse common error handling code in the power allocator governor
   bind callback (Markus Elfring)

 - Constify the thermal zone device operations in the i.MX9 driver
   (Christophe JAILLET)

 - Fix kernel-doc parameter names and firmware node references in the
   cooling device registration helpers (Aryan Sinha)

 - Correct the documented return value of ti_bandgap_get_sensor_data()
   to describe validation errors and potentially NULL stored data
   (Karl Mehltretter)

 - Ensure NUL-termination when copying the cooling device command-line
   argument in tmon and fix the associated string truncation warning
   (Florian Fainelli)

 - Fix undefined behavior caused by a signed shift in the tmon thermal
   zone binding display (Liu Jing)

 - Fix wording in tmon comments (Hemanth Selam)

 - Simplify cpufreq_set_cur_state() in the cpufreq_cooling thermal
   control driver (Thorsten Blum)

* thermal-drivers: (36 commits)
  thermal/drivers/rzg3e: Propagate reset assertion failure from suspend
  thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
  thermal/fw: Fix kernel-doc parameter names
  thermal/qcom/tsens: Add support for MSM8952 tsens
  dt-bindings: thermal: tsens: Add MSM8952
  thermal/drivers/amlogic: Switch to clk_bulk API to support multiple clocks
  dt-bindings: thermal: amlogic: describe bus clock for t7-thermal
  tools/thermal/tmon: Fix string truncation warning in optarg copy
  thermal/drivers/airoha: Register a thermal zone per AN7583 sensor
  dt-bindings: arm: airoha: Use one thermal sensor cell for AN7583
  thermal/drivers/airoha: Serialise access to the shared ADC
  thermal/drivers/airoha: Fix AN7583 ADC mux field mapping
  thermal/drivers/sprd: validate the sensor id from the device tree
  thermal/drivers/ti-soc-thermal: Cancel pending alert work on remove
  thermal/drivers/qcom-spmi-temp-alarm: Fix temp_map indexing
  thermal: gov_power_allocator: Use common error handling code in power_allocator_bind()
  tools/thermal/tmon: Fix signed shift UB in binding display
  MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
  thermal/drivers/samsung: Add Exynos ACPM TMU driver GS101
  dt-bindings: thermal: Add Google GS101 TMU
  ...
2026-10-19 15:29:15 +02:00
Rafael J. Wysocki
b28d25bd1e Merge branches 'thermal-intel', 'thermal-docs' and 'thermal-misc'
Merge updates of thermal control drivers for Intel platforms, a thermal
control documentation update and two miscellaneous thermal control
updates for 7.4:

 - Make the Intel powerclamp thermal driver reject invalid window_size
   values, drop redundant clamp() from duration_set() in it, and
   simplify 4 functions in it (Thorsten Blum)

 - Add rugged Panther Lake support to the intel_tcc_cooling thermal
   driver (Srinivas Pandruvada)

 - Fix temperature selection around 0 C in the int340x thermal driver,
   drop redundant else from proc_thermal_add() in it, and simplify
   slider_def_*_set() in it (Thorsten Blum)

 - Drop unbalanced paren from cpu-idle-cooling.rst (Manuel Ebner)

 - Use %pe to print error pointers symbolically in the thermal control
   code and fix assorted typos in comments in it (Sumeet Pawnikar and
   Hemanth Selam)

* thermal-intel:
  thermal: intel: int340x: soc_slider: Simplify slider_def_*_set()
  thermal: intel: powerclamp: Simplify max_idle_set()
  thermal: intel: powerclamp: Simplify duration_get()
  thermal: intel: powerclamp: Simplify idle_inject_update()
  thermal: intel: int340x: Fix temperature selection around 0 C
  thermal: intel: powerclamp: Simplify check_invalid()
  thermal: intel: intel_tcc_cooling: Add rugged Panther Lake support
  thermal: intel: powerclamp: Drop redundant clamp() in duration_set()
  thermal: intel: int340x: Drop redundant else in proc_thermal_add()
  thermal: intel: powerclamp: Reject invalid window_size values

* thermal-docs:
  thermal: docs: cpu-idle-cooling.rst: Drop unbalanced paren

* thermal-misc:
  thermal: Use %pe to print error pointers symbolically
  thermal: fix assorted typos in comments
2026-10-19 15:19:57 +02:00
Rafael J. Wysocki
5a44bb4863 Merge branches 'acpica' and 'acpi-thermal'
Merge ACPICA updates and ACPI thermal control updates for 7.4:

 - Add IOVT IOMMU support to ACPICA (Bibo Mao)

 - Fix PCC OperationRegion command offsets in ACPICA (Sudeep Holla)

 - Fix memory leak in acpi_ds_create_field() related to the handling of
   internal_pcc_buffer allocations (Breno Leitao)

 - Fix memory leak due to leftover devm_kcalloc() argument in the ACPI
   fan driver (Rafael Wysocki)

 - Fix backlight unregistration ordering in the ACPI video bus device
   driver (Rafael Wysocki)

 - Update the thermal core to allow the registration of thermal class
   cooling devices under specific parents and convert the ACPI fan,
   ACPI processor, and ACPI video bus device drivers to do so (Rafael
   Wysocki)

 - Adjust the ACPI thermal zone driver to use thermal class cooling
   device parent information for binding cooling devices to trip points
   in thermal zones (Rafael Wysocki)

 - Use cooling device data that is a better match for a given driver
   instread of a struct acpi_device pointer that had to be used for
   this purpose previously in the ACPI fan and processor drivers (Rafael
   Wysocki)

 - Fix acpi_thermal_guess_offset() in the ACPI thermal zone driver for
   thermal zone devices with a 273.0°K offset (Hans de Goede)

 - Define a free for ACPI objects allocated by ACPICA helpers and use
   it to simplify AML error handling in the ACPI fan driver (Rafael
   Wysocki)

* acpica:
  ACPICA: actbl2.h: Add bit constants of the Flags field in the IOVT IOMMU structure
  ACPICA: Fix PCC OperationRegion command offsets
  ACPICA: Fix memory leak in acpi_ds_create_field()

* acpi-thermal:
  ACPI: fan: Use __free() to simplify AML error handling
  ACPI: thermal: Fix acpi_thermal_guess_offset() for device with a 273.0°K offset
  ACPI: fan: Use more suitable cooling device data
  ACPI: fan: Store ACPI device pointer in struct acpi_fan
  ACPI: processor: thermal: Use more suitable cooling device data
  ACPI: thermal: Use cooling device parent for thermal zone binding
  ACPI: fan: Use thermal_cooling_device_create()
  ACPI: video: Use thermal_cooling_device_create()
  ACPI: processor: thermal: Use thermal_cooling_device_create()
  thermal: core: Introduce thermal_cooling_device_create()
  ACPI: video: Fix backlight unregistration ordering
  ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument
2026-10-19 13:30:25 +02:00
Rafael J. Wysocki
e5cb7234a3 - Add the Exynos ACPM thermal driver for Google GS101, along with
DT bindings and a MAINTAINERS entry (Tudor Ambarus)
 
 - Add Renesas RZ/G3L thermal sensor support and DT bindings, and move
   default calibration values to per-SoC match data (Biju Das)
 
 - Add Qualcomm MSM8952 TSENS support and the corresponding DT binding
   compatible (Muzaffer Kadir)
 
 - Document the Qualcomm PMAU0102 Master BandGap temperature monitor
   compatible in the DT bindings (Dhruvin Rajpura)
 
 - Extend the QCom TSENS v2 trip temperature limits to the hardware
   range of -204°C to +204°C to prevent interrupt storms when operating
   beyond the previous software limits (Priyansh Jain)
 
 - Fix temperature threshold map indexing in the QCom SPMI temperature
   alarm driver to prevent out-of-bounds reads (Georgi Djakov)
 
 - Describe the additional bus clock required by the Amlogic T7 thermal
   sensor and switch the driver to the clk_bulk API to manage multiple
   clocks (Ronald Claveau)
 
 - Request the Airoha EN7581 IRQ after thermal zone registration to
   prevent the interrupt handler from accessing an unregistered or
   already freed thermal zone (Vitaliy Sochnev)
 
 - Fix the Airoha AN7583 ADC mux field mapping, serialize access to the
   shared ADC, and verify mux selection to avoid invalid temperature
   readings and spurious critical shutdowns (Vitaliy Sochnev)
 
 - Register separate thermal zones for the AN7583 bandgap, GbE and CPU
   sensors, and update the DT bindings to use one thermal sensor cell
   to select the sensor (Vitaliy Sochnev)
 
 - Fix signed integer overflow in the Renesas RZ/G3E temperature-to-code
   conversion, preserve compare interrupt state across runtime PM,
   and prevent overlapping temperature conversions (Ovidiu Panait)
 
 - Remove redundant trip window validation and runtime PM
   pm_runtime_mark_last_busy() calls from the Renesas RZ/G3E driver
   (Ovidiu Panait)
 
 - Propagate reset assertion failures from Renesas RZ/G3E suspend and
   attempt to restore power if the sensor was active (Pengpeng Hou)
 
 - Stop the TI bandgap alert IRQ before removing sensor interfaces and
   cancel pending alert work to prevent use-after-free on driver removal
   (Weigang He)
 
 - Validate Spreadtrum sensor IDs read from the device tree before using
   them for register offsets and array indexing (Weigang He)
 
 - Convert the TI OMAP bandgap DT bindings to schema and document the
   DRA752 compatible and thermal sensor cells (Bhargav Joshi)
 
 - Use DT property helpers matching the signed temperature and unsigned
   hysteresis types defined by the thermal zone bindings (Rob Herring)
 
 - Reuse common error handling code in the power allocator governor
   bind callback (Markus Elfring)
 
 - Constify the thermal zone device operations in the i.MX9 driver
   (Christophe JAILLET)
 
 - Fix kernel-doc parameter names and firmware node references in the
   cooling device registration helpers (Aryan Sinha)
 
 - Correct the documented return value of ti_bandgap_get_sensor_data()
   to describe validation errors and potentially NULL stored data
   (Karl Mehltretter)
 
 - Ensure NUL-termination when copying the cooling device command-line
   argument in tmon and fix the associated string truncation warning
   (Florian Fainelli)
 
 - Fix undefined behavior caused by a signed shift in the tmon thermal
   zone binding display (Liu Jing)
 
 - Fix wording in tmon comments (Hemanth Selam)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGn3N4YVz0WNVyHskqDIjiipP6E8FAmrPM5sACgkQqDIjiipP
 6E/cEgf+JeJ/5JE8Ad3rUX0IHiAPSr6mEfZOm4y7vjV0TZqRGvEhSCuPYmfscAJR
 LL4CCg/UwPMQItkhzffyBzAMGCjCspVFo5Buaw76yaQzygYRKi3gKRY/TCGlV4k7
 P6nbNdHRmwRxzUXt2cQXO0gyfM+EotElO0vvrGnBLXXp7SoJ7V1POH/z73x5kss7
 qu91RPcapaWRxk7YlzPTN9qwl5oeZcokbc/JzkyuMB+OwZEmVp1rpMdfEzbOofjv
 3L9b63ukW4Tytkq2afsAcL09vL7XU5dsMhwnZXni33Z5UbgI5wNFXCnOTOHv1Ywg
 cyddBYUe+cUvZrPtkLd7XLs8l/uULA==
 =4aqg
 -----END PGP SIGNATURE-----

Merge tag 'thermal-v7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux

Pull updates of thermal drivers for 7.4-rc1 from Daniel Lezcano:

"- Add the Exynos ACPM thermal driver for Google GS101, along with
   DT bindings and a MAINTAINERS entry (Tudor Ambarus)

 - Add Renesas RZ/G3L thermal sensor support and DT bindings, and move
   default calibration values to per-SoC match data (Biju Das)

 - Add Qualcomm MSM8952 TSENS support and the corresponding DT binding
   compatible (Muzaffer Kadir)

 - Document the Qualcomm PMAU0102 Master BandGap temperature monitor
   compatible in the DT bindings (Dhruvin Rajpura)

 - Extend the QCom TSENS v2 trip temperature limits to the hardware
   range of -204°C to +204°C to prevent interrupt storms when operating
   beyond the previous software limits (Priyansh Jain)

 - Fix temperature threshold map indexing in the QCom SPMI temperature
   alarm driver to prevent out-of-bounds reads (Georgi Djakov)

 - Describe the additional bus clock required by the Amlogic T7 thermal
   sensor and switch the driver to the clk_bulk API to manage multiple
   clocks (Ronald Claveau)

 - Request the Airoha EN7581 IRQ after thermal zone registration to
   prevent the interrupt handler from accessing an unregistered or
   already freed thermal zone (Vitaliy Sochnev)

 - Fix the Airoha AN7583 ADC mux field mapping, serialize access to the
   shared ADC, and verify mux selection to avoid invalid temperature
   readings and spurious critical shutdowns (Vitaliy Sochnev)

 - Register separate thermal zones for the AN7583 bandgap, GbE and CPU
   sensors, and update the DT bindings to use one thermal sensor cell
   to select the sensor (Vitaliy Sochnev)

 - Fix signed integer overflow in the Renesas RZ/G3E temperature-to-code
   conversion, preserve compare interrupt state across runtime PM,
   and prevent overlapping temperature conversions (Ovidiu Panait)

 - Remove redundant trip window validation and runtime PM
   pm_runtime_mark_last_busy() calls from the Renesas RZ/G3E driver
   (Ovidiu Panait)

 - Propagate reset assertion failures from Renesas RZ/G3E suspend and
   attempt to restore power if the sensor was active (Pengpeng Hou)

 - Stop the TI bandgap alert IRQ before removing sensor interfaces and
   cancel pending alert work to prevent use-after-free on driver removal
   (Weigang He)

 - Validate Spreadtrum sensor IDs read from the device tree before using
   them for register offsets and array indexing (Weigang He)

 - Convert the TI OMAP bandgap DT bindings to schema and document the
   DRA752 compatible and thermal sensor cells (Bhargav Joshi)

 - Use DT property helpers matching the signed temperature and unsigned
   hysteresis types defined by the thermal zone bindings (Rob Herring)

 - Reuse common error handling code in the power allocator governor
   bind callback (Markus Elfring)

 - Constify the thermal zone device operations in the i.MX9 driver
   (Christophe JAILLET)

 - Fix kernel-doc parameter names and firmware node references in the
   cooling device registration helpers (Aryan Sinha)

 - Correct the documented return value of ti_bandgap_get_sensor_data()
   to describe validation errors and potentially NULL stored data
   (Karl Mehltretter)

 - Ensure NUL-termination when copying the cooling device command-line
   argument in tmon and fix the associated string truncation warning
   (Florian Fainelli)

 - Fix undefined behavior caused by a signed shift in the tmon thermal
   zone binding display (Liu Jing)

 - Fix wording in tmon comments (Hemanth Selam)"
2026-10-14 20:31:26 +02:00
Pengpeng Hou
2dc1f296b5 thermal/drivers/rzg3e: Propagate reset assertion failure from suspend
rzg3e_thermal_suspend() powers off an active sensor and then ignores
failure to assert its reset. System sleep can therefore continue without
the clean reset state expected by resume.

Return the reset error and, when the sensor had been active, try to
restore power before failing suspend. This is best-effort recovery:
reset assertion failure may leave partial hardware state, so restoring
power is not guaranteed to succeed. Preserve the original reset error.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: dc67521c20 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20261014031814.7230-1-hppiscas@163.com
2026-10-14 09:46:07 +02:00
Karl Mehltretter
82bb005cd9 thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
ti_bandgap_get_sensor_data() returns an ERR_PTR() if the bandgap
instance or sensor ID is invalid. Otherwise it returns the stored sensor
data, which can be NULL if no data has been set or the stored value has
been cleared.

This mismatch was already present in omap_bandgap_get_sensor_data() when
the driver was introduced in staging.

Document the validation errors while retaining NULL as a possible stored
value.

Fixes: 8feaf0ce1a ("staging: OMAP4+: thermal: introduce bandgap temperature sensor")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260912062252.42762-1-kmehltretter@gmail.com
2026-10-14 09:45:41 +02:00
Aryan Sinha
379ae6766d thermal/fw: Fix kernel-doc parameter names
The kernel-doc for thermal_fwnode_cooling_device_register() still names the
old device tree arguments np and of_index, and
devm_thermal_fwnode_cooling_device_register() documents fw_index rather
than fwn_index. Rename them to match the code and reword the device tree
reference as a firmware node one.

Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
Link: https://patch.msgid.link/20261012152037.33461-1-sinha.aryan03@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
2026-10-14 09:45:41 +02:00
Muzaffer Kadir
8951eb8a78 thermal/qcom/tsens: Add support for MSM8952 tsens
Add support for tsens v1 block that exists on MSM8952 with
11 tsens sensors. Sensor Offsets are taken from downstream.

Signed-off-by: Muzaffer Kadir <muzafferkadir@mainlining.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-wear-7.0.0_r0.3/drivers/thermal/msm-tsens.c#1621
Link: https://patch.msgid.link/20261011-msm8952-initial-support-v5-4-1857074992ec@mainlining.org
2026-10-14 09:45:41 +02:00
Ronald Claveau
44b39b4fb0 thermal/drivers/amlogic: Switch to clk_bulk API to support multiple clocks
The t7-thermal variant now exposes two clocks (bus and core) in its
devicetree binding, but the driver only knows how to get and manage
a single struct clk. Using devm_clk_get() would silently ignore the
second clock, so switch to devm_clk_bulk_get_all() and the matching
clk_bulk_prepare_enable()/clk_bulk_disable_unprepare() calls. This
lets the driver transparently handle however many clocks a given
compatible declares, without needing per-variant clock-handling code,
and keeps working for existing SoCs that only have one.

Fixes: 18d65de815 ("thermal/drivers/amlogic: Add support for secure monitor calibration readout")
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260923-fix-t7-thermal-clock-v2-2-bff7a09eb487@aliel.fr
2026-10-14 09:45:41 +02:00
Vitaliy Sochnev
06a169d840 thermal/drivers/airoha: Register a thermal zone per AN7583 sensor
AN7583 has three temperature sensors and the driver has constants for
all of them, but it registers one zone and reads only the bandgap sensor.

Register a zone per sensor; the thermal sensor cell selects it. A device
tree may describe fewer zones than sensors. EN7581 still registers one
zone.

Idle and with both cores loaded on a Nokia XG-040G-MF:

  bandgap  56.9 C -> 59.3 C
  GbE      58.7 C -> 61.5 C
  CPU      57.0 C -> 61.1 C

Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-5-sochnev.v.74@gmail.com
2026-10-14 09:45:40 +02:00
Vitaliy Sochnev
b1bf55053a thermal/drivers/airoha: Serialise access to the shared ADC
A read selects the sensor and walks three diodes with a 10 ms settle on
each. The zone lock serialises reads of one zone. With a zone per AN7583
sensor, added later in this series, reads of different zones interleave
and convert samples taken at another mux position.

Mux writes are dropped silently unless PLLRG_PROTECT is lifted, and its
save and restore do not nest. The cached TADC value also skips a write
after another reader has moved the mux.

With the AN7583 sensors read as parallel zones during CPU frequency
changes, a zone crossed its critical trip on a chip at 55 C and the
board shut down.

Serialise the sequence, drop the cache, check the selection after
writing and after sampling, and return -EAGAIN if it does not hold.

Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-3-sochnev.v.74@gmail.com
2026-10-14 09:45:40 +02:00
Vitaliy Sochnev
4a0f3193c6 thermal/drivers/airoha: Fix AN7583 ADC mux field mapping
On AN7583, bits 3:1 of 0x2e4 select the sensor (0 bandgap, 5 GbE, 6 CPU)
and bits 3:2 of 0x2a0 select the diode (0 D0, 1 ZERO, 2 D1). The driver
names them the other way round: MUX_TADC is 0x2e4, MUX_SENSOR is 0x2a0.

v5 of the AN7583 series swapped the airoha_set_thermal_mux() arguments
to match these names. The diode index now goes to the sensor selector,
so the zone reads mux positions 1, 0 and 2 (PAD_AVS, bandgap, core
voltage) instead of the bandgap diodes. On a Nokia XG-040G-MF the result
crosses the critical trip and the board powers off during boot.

Swap the field definitions. MUX_TADC then selects the diode, as on
EN7581, and the existing call order is correct.

Fixes: b20d978275 ("thermal/drivers/airoha: Add support for AN7583 Thermal Sensor")
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929165209.69669-2-sochnev.v.74@gmail.com
2026-10-14 09:45:40 +02:00
Weigang He
b17d799ce4 thermal/drivers/sprd: validate the sensor id from the device tree
sprd_thm_probe() reads each sensor child node's "reg" property into
sen->id and uses it without validation: to compute the sensor's
register offsets in sprd_thm_sensor_init(), as the thermal zone id, and
finally as an index into thm->sensor[], which has SPRD_THM_MAX_SENSOR
(8) entries:

	ret = of_property_read_u32(sen_child, "reg", &sen->id);
	...
	thm->sensor[sen->id] = sen;

Only the number of sensor nodes is checked against SPRD_THM_MAX_SENSOR.
A "reg" value of 8 or more, or one that is negative once stored in the
int sen->id, makes the register offsets point outside the sensor range
and the final store land outside thm->sensor[], overwriting the fields
that follow it in struct sprd_thermal_data or other memory.

Reject an out-of-range id right after reading it, before it is used.

This does not address sparse ids, such as a single sensor with id 7:
they leave holes in thm->sensor[] that the later loops over
0..nr_sensors-1 dereference. That needs a separate fix.

Found by static analysis tool CodeQL.

Fixes: 554fdbaf19 ("thermal: sprd: Add Spreadtrum thermal driver support")
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260926042757.2109927-1-geoffreyhe2@gmail.com
2026-10-14 09:45:40 +02:00
Weigang He
aaa6c8dec4 thermal/drivers/ti-soc-thermal: Cancel pending alert work on remove
On a threshold crossing, the talert IRQ handler calls
ti_thermal_report_sensor_temperature(), which queues the work embedded
in the sensor's ti_thermal_data on the system workqueue. Nothing ever
cancels or flushes that work.

ti_bandgap_remove() frees the talert IRQ last. free_irq() waits for a
running handler, but not for the work the handler has queued. When
remove returns, devres unregisters and frees the thermal zones and then
frees the devm-allocated ti_thermal_data, so a work item that is still
pending runs ti_thermal_work() on freed memory:

	ti_thermal_work()
	  data = container_of(work, struct ti_thermal_data, thermal_wq);
	  thermal_zone_device_update(data->ti_thermal, ...);

Free the talert IRQ before removing the sensors, so that no new work
can be queued, and cancel the work in ti_thermal_remove_sensor().

This needs an OMAP4460/4470 or OMAP5 SoC (DRA7 has TALERT but no
->report_temperature, so it never queues the work), a threshold crossing
just before the driver is unbound or unloaded, and the work still
pending when devres frees the data.

Found by static analysis tool CodeQL.

Fixes: 445eaf871b ("staging: omap-thermal: common code to expose driver to thermal framework")
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Acked-by: Keerthy <j-keerthy@ti.com>
Link: https://patch.msgid.link/20260926124931.3599746-1-geoffreyhe2@gmail.com
2026-10-13 16:26:37 +02:00
Georgi Djakov
51c262cf2a thermal/drivers/qcom-spmi-temp-alarm: Fix temp_map indexing
Fix the following issue noticed when booting on the db845c-dragonboard:

BUG: KASAN: global-out-of-bounds in qpnp_tm_sync_thresholds+0x11c/0x180 [qcom_spmi_temp_alarm]
Read of size 24 at addr ffffdd2495f01200 by task (udev-worker)/371

CPU: 3 UID: 0 PID: 371 Comm: (udev-worker) Not tainted 7.3.0-rc3 #116 PREEMPT
Hardware name: Thundercomm Dragonboard 845c (DT)
Call trace:
 show_stack+0x18/0x24 (C)
 dump_stack_lvl+0xa4/0xf4
 print_report+0x1f4/0x5ac
 kasan_report+0x84/0xcc
 kasan_check_range+0xf0/0x1a4
 memcpy+0x3c/0xa4
 qpnp_tm_sync_thresholds+0x11c/0x180 [qcom_spmi_temp_alarm]
 qpnp_tm_probe+0x3dc/0xae8 [qcom_spmi_temp_alarm]
 platform_probe+0xc4/0x18c
 really_probe+0x17c/0x4fc
 ...

The buggy address belongs to the variable:
 temp_map_gen1+0x60/0xc4 [qcom_spmi_temp_alarm]

It looks like temp_map is a pointer to the complete temperature map.
Indexing it directly advances the entire map, rather than selecting a
threshold row.

Fix this by dereferencing the temp_map before indexing it to select the
requested threshold row.

Fixes: 703f13285a ("thermal/drivers/qcom-spmi-temp-alarm: Add temp alarm data struct based on HW subtype")
Fixes: 1f835c6a4c ("thermal/drivers/qcom-spmi-temp-alarm: Prepare to support additional Temp Alarm subtypes")
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260928132823.1426513-1-djakov@kernel.org
2026-10-13 16:26:37 +02:00
Markus Elfring
481860eba8 thermal: gov_power_allocator: Use common error handling code in power_allocator_bind()
Adjust labels so that a bit of exception handling can be better reused
at the end of this function implementation.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/a3dc82f0-7333-465d-85b4-8034b1591442@web.de
2026-10-13 16:26:37 +02:00
Tudor Ambarus
50a2c5d406 thermal/drivers/samsung: Add Exynos ACPM TMU driver GS101
Add driver for the Thermal Management Unit (TMU) managed via the Alive
Clock and Power Manager (ACPM), found on Samsung Exynos SoCs such as
the Google GS101.

The TMU on the GS101 utilizes a hybrid management model shared between
the Application Processor (AP) and the ACPM firmware. The driver
maintains direct memory-mapped access to the TMU interrupt pending
registers to identify thermal events, while delegating functional
tasks - such as sensor initialization, threshold configuration, and
temperature acquisition, to the ACPM firmware via the ACPM IPC
protocol.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Alexey Klimov <alexey.klimov@linaro.org>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260603-acpm-tmu-v8-2-0f1810a356e6@linaro.org
2026-10-13 16:26:16 +02:00
Rafael J. Wysocki
bc967622c2 Merge back thermal core material for 7.4 2026-09-29 12:22:20 +02:00
Rob Herring (Arm)
4f6d1a9ea1 thermal: of: Match trip property helper types
The thermal-zone binding defines "temperature" as a signed int32
value and "hysteresis" as an unsigned int32 value. Using helpers with
matching types avoids dt_property_check mismatches and preserves the
signed interpretation needed for trips below zero.

Read "temperature" with the signed helper and keep "hysteresis" on the
unsigned helper using separate typed temporaries before storing them in
the trip structure.

Assisted-by: Codex:gpt-5-5
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260612215009.1884665-1-robh@kernel.org
2026-09-28 17:54:14 +02:00
Biju Das
e856ca3013 thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
Add the renesas,r9a08g046-tsu compatible string and its default
(software) calibration constants for RZ/G3L, used when FUSE
calibration values are missing.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260925061617.127349-4-biju.das.jz@bp.renesas.com
2026-09-27 23:01:26 +02:00
Biju Das
91e5a33675 thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data
Move the default (software) calibration values SW_CALIB0_VAL and
SW_CALIB1_VAL, used when FUSE values are missing, into a new
struct rzg3s_thermal_info retrieved via of_device_get_match_data().

This allows different SoCs sharing this driver to provide their own
default calibration constants, which is needed as RZ/G3L uses
different values than RZ/G3S.

No functional change intended for RZ/G3S.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20260925061617.127349-3-biju.das.jz@bp.renesas.com
2026-09-27 23:01:10 +02:00
Priyansh Jain
eca1247443 thermal/drivers/qcom/tsens: Widen temperature limits to match hardware range
The TSENS v2 software driver currently clamps trip_min_temp and
trip_max_temp to -40°C and 120°C respectively. However, the
TSENS v2 hardware temperature threshold registers support a wider
programmable range from -204°C to +204°C.

On newer chipsets using TSENS v2, devices may legitimately operate
beyond the existing software limits (for example, up to 130°C). When a
trip temperature is programmed outside the software clamped range, it is
constrained to 120°C on the upper end or -40°C on the lower end.
If the actual temperature continues to exceed this clamped limit, the
threshold is immediately violated again, which can result in a
continuous interrupt storm.

Expand the TSENS v2 software trip temperature limits to match the full
hardware supported range (-204°C to +204°C). This avoids repeated
threshold reprogramming and ensures correct trip handling on TSENS v2
based platforms.

Signed-off-by: Priyansh Jain <priyansh.jain@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/20260508100700.772985-3-priyansh.jain@oss.qualcomm.com
2026-09-27 23:00:41 +02:00
Ovidiu Panait
c337b60bda thermal/drivers/renesas/rzg3e: Remove redundant pm_runtime_mark_last_busy() calls
pm_runtime_put_autosuspend() already calls pm_runtime_mark_last_busy()
internally, so the explicit calls are not needed. Remove them.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260916120003.87018-6-ovidiu.panait.rb@renesas.com
2026-09-27 23:00:37 +02:00
Thorsten Blum
f5f32c6c48 thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
Return freq_qos_update_request() errors directly to simplify the code.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260923202911.90464-3-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 22:13:19 +02:00
Thorsten Blum
f10f236b08 thermal: intel: int340x: soc_slider: Simplify slider_def_*_set()
Return errors directly to simplify slider_def_balance_set() and
slider_def_offset_set().

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260921143644.69381-2-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 21:57:51 +02:00
Thorsten Blum
d89c557bb0 thermal: intel: powerclamp: Simplify max_idle_set()
Use guard(mutex) and return errors directly to simplify the code.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260915221548.104852-4-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 21:19:44 +02:00
Thorsten Blum
23b16b5178 thermal: intel: powerclamp: Simplify duration_get()
Use guard(mutex) and return the result of sysfs_emit() directly to
simplify the code. Also use %u to format the unsigned duration.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260915221548.104852-3-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 21:19:44 +02:00
Sumeet Pawnikar
7f301e86d0 thermal: Use %pe to print error pointers symbolically
Replace PTR_ERR() and %ld with %pe and pass the original pointer directly
to pr_err() and dev_err(). The %pe format specifier prints a symbolic error
name (e.g. -ENOMEM) when CONFIG_SYMBOLIC_ERRNAME is enabled, otherwise it
falls back gracefully and prints the raw integer value. This makes messages
more readable without any functional change.

Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
Link: https://patch.msgid.link/20260912191156.185448-5-sumeet4linux@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 19:23:26 +02:00
Hemanth Selam
284864b1f7 thermal: fix assorted typos in comments
Fix typos in comments, reported by scripts/checkpatch.pl using the
misspelling list in scripts/spelling.txt.

Only touches comments, no code changes.

Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
[ rjw: Subject tweak ]
Link: https://patch.msgid.link/20260907064725.10686-3-hemanth.selam@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-25 19:15:15 +02:00
Ronald Claveau
dad6f7897a thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
Introduce platform name, control register and duty-cycle
levels per variant.
VIM4 uses a different register and level set (0-100)
 declared as a list (0, 30, 40, 55, 75, 100) compared
 to previous boards (0-3).

MAX_LEVEL is kept and bumped from 3 to 5 to make
the speed change more gradual with the newer MCUs.

The cooling device's state is stored as an index into levels[],
and khadas_mcu_fan_set_level() writes levels[state] to fan_reg,
rather than writing the raw state value as before.

Optionally acquire and enable a "fan" regulator supply
at probe time and on resume,
so boards that gate fan power through a regulator are handled.
The regulator is released via a devm_add_action_or_reset()
callback.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-add-mcu-fan-khadas-vim4-v12-4-497cd543a148@aliel.fr
Signed-off-by: Lee Jones <lee@kernel.org>
2026-09-23 12:01:27 +01:00
Manaf Meethalavalappu Pallikunhi
ec0d89150a thermal: gov_step_wise: Fix stale mitigation vote with non-zero lower bounds
When two or more thermal zones bind to a common cooling device and one zone
uses a non-zero instance->lower value, there is a bug where the instance
holds a stale mitigation vote even after its trip is cleared.

Problem scenario:
- thermal-zone1: Trip at 50°C, cooling-map with lower=0
- thermal-zone2: Trip at 55°C, cooling-map with lower=2
- Both zones share the same cooling device (e.g., CPU)

Issue flow:
1. Both trips trigger, zone1 requests state 5, zone2 also mitigates
2. Zone2 trip clears (temp < 53°C due to hysteresis)
3. When throttle=false and trend=THERMAL_TREND_DROPPING:
   - Current code checks: if (cur_state <= instance->lower)
     return THERMAL_NO_TARGET
   - Since cur_state (5) > instance->lower (2),
     it returns instance->lower (2)
   - This is the BUG where it returns instance->lower even though
     trip is cleared
4. Zone2's passive polling stops (tz->passive reaches 0) - no more updates
   for zone2
5. Zone2's stale vote of 2 persists indefinitely
6. Even when zone1 wants to reduce cooling to state, the cooling device
   cannot go below state 2 due to zone2's stale vote

When a trip is cleared (throttle == false), always return THERMAL_NO_TARGET
instead of instance->lower. Remove the unnecessary check comparing
cur_state with instance->lower. Since passive polling is already
deactivated when the trip is cleared, the instance should always be
deactivated regardless of its current cooling state. This ensures that
instances with non-zero lower bounds do not retain stale mitigation votes
after their trips are cleared.

Fixes: 042a3d80f1 ("thermal: core: Move passive polling management to the core")
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-step_wise_multi_zone_stale_vote_fix-v1-1-789f68dab229@oss.qualcomm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-22 21:16:11 +02:00
Ovidiu Panait
a5f1de6d78 thermal/drivers/renesas/rzg3e: Remove unneeded low/high check in set_trips()
The hardware manual doesn't specify that the trip settings must be
strictly low < high, just that when the CMPCOND bit is 0, an interrupt
will be raised when the acquired temperature data is > ULIM or < LLIM.

Also, the thermal core already guarantees low < high.

Remove the redundant check.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260916120003.87018-5-ovidiu.panait.rb@renesas.com
2026-09-21 17:48:30 +02:00
Ovidiu Panait
acd9bf8f90 thermal/drivers/renesas/rzg3e: Fix race between set_trips() and get_temp()
Datasheet section 7.11.9.2 "Conversion Start Trigger" states that a
conversion must only be started while no other conversion is in
progress:

  "Before making the setting to start conversion by software or an ELC
   trigger, check that the CONV bit of the sensor status register is 0b."

set_trips() starts a conversion at the end of the function and returns
without waiting for it to finish. A get_temp() call arriving right after
that starts a conversion while the CONV bit may still be set, violating
the requirement above.

Fix this by:
 - polling for CONV == 0 in get_temp() before starting a conversion
 - not starting a conversion at the end of set_trips() anymore

The conversion started at the end of set_trips() was supposed to check
whether the thresholds have been passed, since the hw cannot raise
interrupts on its own, but only when the temperature is read. However,
the thermal core reads the temperature and computes the trip window from
it just before calling into set_trips(), so reading the temperature again
straight away is useless.

Fixes: dc67521c20 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260916120003.87018-4-ovidiu.panait.rb@renesas.com
2026-09-21 17:48:13 +02:00
Ovidiu Panait
aa1bc39e45 thermal/drivers/renesas/rzg3e: Fix runtime PM handling of compare irq
The TSU hw is limited in the sense that lower and upper trip points can be
set, but the hw cannot raise interrupts on its own. It can only signal that
the thresholds were passed when the temperature is read, either during
polling or on a manual read. Therefore, the interrupt enable state
configured by set_trips() must remain active for the next read to trigger
an event.

Currently, runtime PM autosuspend puts the chip to sleep and clears the
compare interrupt that was enabled during set_trips(). On power up, the
compare interrupt enable is not restored, which means that it won't ever
fire.

Fix this by caching the contents of the SIER register during runtime power
off and restore it during runtime power on.

Fixes: dc67521c20 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260916120003.87018-3-ovidiu.panait.rb@renesas.com
2026-09-21 17:47:58 +02:00
Ovidiu Panait
84f0e14e62 drivers/thermal/renesas/rzg3e: Fix signed integer overflow in temp_to_code()
The thermal core passes -INT_MAX/INT_MAX as low/high trip points, which
the driver then converts to code values for programming the registers:

numerator = (temp_mc - info->temp_d_mc) * (priv->trmval1 - priv->trmval0);

Although 'numerator' is defined as s64, the arithmetic is performed as int.
Because of this, the multiplication overflows for -INT_MAX and, because
temp_d_mc is negative, the subtraction overflows for INT_MAX.

To fix this, cast the temperature to s64, so that the arithmetic is
performed as s64.

Fixes: dc67521c20 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260916120003.87018-2-ovidiu.panait.rb@renesas.com
2026-09-21 17:47:38 +02:00
Christophe JAILLET
e7cfcccd8c thermal/drivers/imx9: Constify struct thermal_zone_device_ops
'struct thermal_zone_device_ops' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   8567	   2144	      0	  10711	   29d7	drivers/thermal/imx91_thermal.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   8695	   2016	      0	  10711	   29d7	drivers/thermal/imx91_thermal.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/5cce9ea713edcf2aa3c0efd5d31e9d9fd9f40a88.1786220585.git.christophe.jaillet@wanadoo.fr
2026-09-18 12:15:51 +02:00
Vitaliy Sochnev
7efceedd23 thermal/drivers/airoha: Request the EN7581 IRQ after zone registration
The EN7581 IRQ is requested before the thermal zone is registered, and
the handler passes priv->tz to thermal_zone_device_update(). Unbind
leaves the monitor interrupt enabled, so an interrupt pending on the
next bind fires while priv->tz is NULL. On a Nokia XG-040G-MD this
oopses in thermal_zone_device_update(). On unbind, devres also frees the
zone before the IRQ.

Request the IRQ in post_probe, after zone registration.

Fixes: 42de37f40e ("thermal/drivers: Add support for Airoha EN7581 thermal sensor")
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260915194128.42508-1-sochnev.v.74@gmail.com
2026-09-18 11:23:33 +02:00
Rafael J. Wysocki
7e2c70f8a1 thermal: core: Introduce thermal_cooling_device_create()
Currently, thermal cooling devices have no parents, but it would be
generally useful to be able to create them under specific parents in
the device hierarchy (for instance, it may help to identify the device
representing the actual cooling hardware).

To make that possible, add thermal_cooling_device_create() that will
work like thermal_cooling_device_register() except that it will take
an additional parent argument (which may be NULL).

Redefine thermal_cooling_device_register() as a static inline wrapper
around thermal_cooling_device_create().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/8729484.T7Z3S40VBb@rafael.j.wysocki
2026-09-12 20:11:17 +02:00
Sumeet Pawnikar
d3515092f1 thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz()
power_allocator_update_tz() unconditionally derives the trip descriptor of
params->trip_max as below,
  const struct thermal_trip_desc *td = trip_to_trip_desc(params->trip_max);
and then walks td->thermal_instances. However, params->trip_max is allowed
to be NULL and in that case the list walk dereferences a bogus pointer
derived from NULL which oops the kernel.

get_governor_trips() picks trip_switch_on and trip_max out of the trip
table of the zone. When the zone has neither a passive nor an active trip
point, last_active is NULL and params->trip_max is left NULL. This is an
explicitly supported configuration, as documented in the function
get_governor_trips() as below,
  If there are no passive or active trip points, then the governor won't
  do anything. In fact, its throttle function won't be called at all.

Return early from power_allocator_update_tz() when params->trip_max is NULL
and only compute the trip descriptor after that check. There is nothing to
update in that case anyway, with no trip_max and there are no thermal
instances for the governor to account for, num_actors stays zero and
total_weight is irrelevant.

Fixes: 912e97c67c ("thermal: gov_power_allocator: Move memory allocation out of throttle()")
Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260822114236.15998-1-sumeet4linux@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-11 15:41:14 +02:00
Rob Herring (Arm)
d98d8b50a8 thermal: of: Match trip property helper types
The thermal-zone binding defines "temperature" as a signed int32
value and "hysteresis" as an unsigned int32 value. Using helpers with
matching types avoids dt_property_check mismatches and preserves the
signed interpretation needed for trips below zero.

Read "temperature" with the signed helper and keep "hysteresis" on the
unsigned helper using separate typed temporaries before storing them in
the trip structure.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260831194235.1182138-1-robh@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-10 20:13:53 +02:00
Thorsten Blum
bbc68b683d thermal: intel: powerclamp: Simplify idle_inject_update()
Drop the local update variable and call idle_inject_set_duration()
directly instead. Also return !should_skip directly.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260828194530.43370-2-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-04 17:52:46 +02:00
Thorsten Blum
e56e2b49c6 thermal: intel: int340x: Fix temperature selection around 0 C
Since commit 7251b9e8a0 ("thermal/intel: Fix intel_tcc_get_temp() to
support negative CPU temperature"), intel_tcc_get_temp() can report
negative temperatures.

proc_thermal_get_zone_temp() still uses *temp as the current maximum and
as an implicit "no reading yet" marker. However, this breaks when a CPU
reports 0 C, because a subsequent negative reading can overwrite it.

Use bool temp_valid to track whether a valid temperature has been read.
Initialize *temp with the first valid reading and only update it with
warmer readings.

Fixes: 7251b9e8a0 ("thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature")
Cc: 6.3+ <stable@vger.kernel.org> # 6.3+
Signed-off-by: Thorsten Blum <blum@kernel.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20260826153144.299746-3-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-04 17:52:46 +02:00
Thorsten Blum
3a6a73ea98 thermal: intel: powerclamp: Simplify check_invalid()
Return the boolean expression directly and use const for the read-only
mask parameter.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://patch.msgid.link/20260820154339.47737-2-blum@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-04 17:52:46 +02:00