Skip to content

thermal: core: Remove thermal zones during unregistration

Rafael J. Wysocki linux-acpi linux-pm lkml 1 version In review

Get series with b4
b4 am 1880915.tdWV9SEqCh@kreacher

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3thermal: core: Make thermal_zone_device_unregister() return after freeing the zonedrivers/thermal/thermal_core.c include/linux/thermal.h+7 -14 replies
2/3thermal: Drop redundant and confusing device_is_registered() checksdrivers/thermal/thermal_core.c drivers/thermal/thermal_helpers.c drivers/thermal/thermal_hwmon.c +1 more+7 -723 replies
3/3thermal: core: Rework thermal zone availability checkdrivers/thermal/thermal_core.c+12 -31 reply

Reviews trailers per patch

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

PatchLukasz LubaDaniel Lezcano
SeriesReviewed-and-tested-by
1/3A-b
2/3A-b
3/3A-b

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

Read the v1 thread

Cover letter [PATCH v1 0/3] thermal: core: Remove thermal zones during unregistration

Hi All,

This patch series adds a mechanism to guarantee that thermal_zone_device_unregister() will not return until all of the active references to the thermal zone device object in question have been dropped and it has been deleted (patch [1/3]).

This supersedes the approach used so far in which all thermal zone sysfs attribute callbacks check if the zone device is still registered under the zone lock, so as to return early if that is not the case, as it means that device_del() has been called for the thermal zone in question (and returned). It is not necessary to do that any more after patch [1/3], so patch [2/3] removes those checks from the code and drops zone locking that is not necessary any more either.

Patch [3/3] uses the observation that the thermal subsystem does not need to check if a thermal zone device is registered at all, because it can use its own data to determine whether or not the thermal zone is going away and so it may not be worth updating it, for example.

Please refer to the patch changelogs for details.

The series depends on new thermal material in linux-next, but it should not substantially depend on any changes that have not made it into linux-next yet.

Thanks!