thermal: intel: intel_soc_dts_iosf: Change initialization ordering
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Aug 2023 19:13:25 +0000 (21:13 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 11 Aug 2023 16:44:45 +0000 (18:44 +0200)
commit51f2aaf0dfb1a21281e2d47c94b1a5b245b033fa
tree39de6480e9a5ce5c58448911aac574c6ffe417aa
parentcbc280570438ce0e6bcb10288048eaa00762b3db
thermal: intel: intel_soc_dts_iosf: Change initialization ordering

The initial configuration of trip points in intel_soc_dts_iosf_init()
takes place after registering the sensor thermal zones which is
potentially problematic, because it may race with the setting of trip
point temperatures via sysfs, as there is no synchronization between it
and sys_set_trip_temp().

To address this, change the initialization ordering so that the trip
points are configured prior to the registration of thermal zones.

Accordingly, change the cleanup ordering in intel_soc_dts_iosf_exit()
to remove the thermal zones before resetting the trip points.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
drivers/thermal/intel/intel_soc_dts_iosf.c