Skip to content

thermal: Store trips table and ops in thermal_zone_device

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

Get series with b4
b4 am 4551531.LvFx2qVVIh@kreacher

Versions newest first · linked by author and title

  1. v2 Latest6 patches 14 repliesIn review
  2. v16 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6thermal: core: Store zone trips table in struct thermal_zone_devicedrivers/thermal/imx_thermal.c drivers/thermal/thermal_core.c drivers/thermal/thermal_trip.c +1 more+15 -151 reply
1/6thermal: core: Store zone trips table in struct thermal_zone_devicedrivers/thermal/imx_thermal.c drivers/thermal/thermal_core.c drivers/thermal/thermal_of.c +2 more+15 -172 replies
1/6thermal: core: Store zone trips table in struct thermal_zone_devicedrivers/thermal/imx_thermal.c drivers/thermal/thermal_core.c drivers/thermal/thermal_of.c +2 more+18 -171 reply
2/6thermal: ACPI: Discard trips table after zone registrationdrivers/acpi/thermal.c+20 -371 reply
3/6thermal: intel: Discard trip tables after zone registrationdrivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +5 more+40 -541 reply
4/6thermal: core: Store zone ops in struct thermal_zone_devicedrivers/thermal/thermal_core.c drivers/thermal/thermal_helpers.c drivers/thermal/thermal_hwmon.c +4 more+44 -546 replies
5/6thermal: ACPI: Constify acpi_thermal_zone_opsdrivers/acpi/thermal.c+1 -11 reply
6/6thermal: intel: Adjust ops handling during thermal zone registrationdrivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +4 more+11 -261 reply

Reviews trailers per patch

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

PatchStanislaw GruszkaDaniel Lezcano
1/6R-b R-b R-b R-b R-b R-b
1/6R-b R-b R-b R-b R-b R-b
1/6R-b R-b R-b R-b R-b R-b
2/6R-b A-b
3/6A-b
4/6R-b R-b
5/6A-b
6/6R-b R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/6] thermal: Store trips table and ops in thermal_zone_device

Hi Everyone,

This is an update of

https://lore.kernel.org/linux-pm/2728491.mvXUDI8C0e@kreacher/

that has been rebased on top of

https://lore.kernel.org/linux-pm/6017196.lOV4Wx5bFT@kreacher/

and includes some bug fixes.

The original series description still applies:

"This series changes the PM core to copy the trips and zone ops directly
into struct thermal_zone_device so as to allow the callers of the zone registration function to discard their own copies of those things after zone registration and/or possibly allocate them as read-only.

The first patch makes the thermal core create a copy of the trips table which is declared as a flex array to enable additional bounds checking on it. The next two patches update the ACPI thermal driver and Intel thermal drivers to take benefit of that change.

In a similar pattern, patch [4/6] makes the thermal core create an internal

 copy of the zone ops supplied by the zone creator, so as to allow the

original ops structure to be discarded after zone registration or allocated as read-only, and the next two patches update the ACPI thermal driver and Intel thermal drivers to actually do that.

The other thermal drivers need not be changed, although in principle they may be simplified a bit too in the future.

As usual, please refer to the individual patch changelogs for details."

However, the imx thermal driver is modified by patch [1/6], because it uses its local trips table and expects it to contain the current passive trip temperature value (as set via sysfs), and the thermal_of driver is modified by patch [4/6], because it uses the ops pointer from the thermal zone device to free the ops.

Thanks!