thermal: intel: int340x: processor_thermal: Fix additional deadlock
Subsystems (2)
PATCH 1/1 thermal: intel: int340x: processor_thermal: Fix additional deadlock
Commit 52f04f10b900 ("thermal: intel: int340x: processor_thermal: Fix deadlock") addressed deadlock issue during user space trip update. But it missed a case when thermal zone device is disabled when user writes 0.
Call to thermal_zone_device_disable() also causes deadlock as it also tries to lock tz->lock, which is already claimed by trip_point_temp_store() in the thermal core code.
Remove call to thermal_zone_device_disable() in the function sys_set_trip_temp(), which is called from trip_point_temp_store().
--- .../thermal/intel/int340x_thermal/processor_thermal_device_pci.c | 1 - 1 file changed, 1 deletion(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0 -1
@@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int tempcancel_delayed_work_sync (&pci_info->work);proc_thermal_mmio_write (pci_info,PROC_THERMAL_MMIO_INT_ENABLE_0 ,0 );proc_thermal_mmio_write (pci_info,PROC_THERMAL_MMIO_THRES_0 ,0 ); -thermal_zone_device_disable (tzd); pci_info->stored_thres =0 ;return 0 ; }
Signature · 1 line
2.39.1
Quoted 24 lines · Srinivas Pandruvada
Commit
52f04f10b900("thermal: intel: int340x:processor_thermal: Fix deadlock") addressed deadlock issue during user space trip update. But it missed a case when thermal zone device is disabled when user writes 0.Call to
thermal_zone_device_disable()also causes deadlock as it also tries to locktz->lock, which is already claimed bytrip_point_temp_store()in the thermal core code.Remove call to
thermal_zone_device_disable()in the functionsys_set_trip_temp(), which is called fromtrip_point_temp_store().Fixes 52f04f10b900 ("thermal: intel: int340x: processor_thermal: Fix deadlock")Signed-off-by Srinivas Pandruvada <[email protected]>Cc [email protected] # 6.2+--- .../thermal/intel/int340x_thermal/processor_thermal_device_pci.c | 1 - 1 file changed, 1 deletion(-)drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0
-0
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp
Quoted 8 lines
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +0
-2@@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int tempcancel_delayed_work_sync (&pci_info->work);proc_thermal_mmio_write (pci_info,PROC_THERMAL_MMIO_INT_ENABLE_0 ,0 );proc_thermal_mmio_write (pci_info,PROC_THERMAL_MMIO_THRES_0 ,0 ); -thermal_zone_device_disable (tzd); pci_info->stored_thres =0 ;return 0 ; } --
Applied as 6.3-rc material, thanks!