Skip to content

thermal: core/ACPI: Fix processor cooling device regression

Rafael J. Wysocki linux-acpi linux-pm lkml 3 versions – In review

Get series with b4
b4 am 2678096.mvXUDI8C0e@kreacher

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 7 repliesSuperseded
  3. v14 patches 14 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ACPI: processor: Reorder acpi_processor_driver_init()drivers/acpi/processor_driver.c+6 -60 replies
2/4thermal: core: Introduce thermal_cooling_device_present()drivers/thermal/thermal_core.c+15 -60 replies
3/4thermal: core: Introduce thermal_cooling_device_update()drivers/thermal/thermal_core.c drivers/thermal/thermal_core.h drivers/thermal/thermal_sysfs.c +1 more+149 -92 replies
4/4ACPI: processor: thermal: Update CPU cooling devices on cpufreq policy changesdrivers/acpi/processor_thermal.c+11 -30 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchZhang Rui
1/4T-b R-b
2/4T-b R-b
3/4T-b R-b
4/4T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] thermal: core/ACPI: Fix processor cooling device regression

Hi All,

The two previous revisions of this patch series was posted as

https://lore.kernel.org/linux-pm/2148907.irdbgypaU6@kreacher/
https://lore.kernel.org/linux-acpi/2692681.mvXUDI8C0e@kreacher/

As reported by Rui in this thread:

some recent changes in the thermal core cause the CPU cooling devices registered by the ACPI processor driver to become unusable in some cases and somewhat crippled in general.

The problem is that the ACPI processor driver changes its ->get_max_state() callback return value depending on whether or not cpufreq is available and there is a cpufreq policy for a given CPU. However, the thermal core has always assumed that the return value of that callback will not change, which in fact is relied on by the cooling device statistics code. In particular, when the ->get_max_state() grows, the memory buffer allocated for storing the statistics will be too small and corruption may ensue as a result.

For this reason, the issue needs to be addressed in the ACPI processor driver and not in the thermal core, but the core needs to help somewhat too. Namely, it needs to provide a helper allowing an interested driver to update the max_state value for an already registered cooling device in certain situations which will also cause the statistics to be rebuilt.

This series implements the above and for details please refer to the individual patch chagelogs.

Thanks!