Skip to content

Commit 2bac7dc

Browse files
committed
Merge tag 'thermal-6.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki: "These remove two recently added excessive lockdep assertions from the sysfs-related thermal code and fix two issues in Intel thermal drivers. Specifics: - Drop two lockdep assertions producing false positive warnings from the sysfs-related thermal core code (Rafael Wysocki) - Fix handling of two recently added module parameters in the Intel powerclamp thermal driver (David Arcari) - Fix one more deadlock in the int340x thermal driver (Srinivas Pandruvada)" * tag 'thermal-6.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: intel: powerclamp: Fix cpumask and max_idle module parameters thermal: intel: int340x: processor_thermal: Fix additional deadlock thermal: core: Drop excessive lockdep_assert_held() calls
2 parents f964333 + 896c515 commit 2bac7dc

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp
153153
cancel_delayed_work_sync(&pci_info->work);
154154
proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_INT_ENABLE_0, 0);
155155
proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0);
156-
thermal_zone_device_disable(tzd);
157156
pci_info->stored_thres = 0;
158157
return 0;
159158
}

drivers/thermal/intel/intel_powerclamp.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ static int max_idle_set(const char *arg, const struct kernel_param *kp)
235235
goto skip_limit_set;
236236
}
237237

238+
if (!cpumask_available(idle_injection_cpu_mask)) {
239+
ret = allocate_copy_idle_injection_mask(cpu_present_mask);
240+
if (ret)
241+
goto skip_limit_set;
242+
}
243+
238244
if (check_invalid(idle_injection_cpu_mask, new_max_idle)) {
239245
ret = -EINVAL;
240246
goto skip_limit_set;
@@ -791,7 +797,8 @@ static int __init powerclamp_init(void)
791797
return retval;
792798

793799
mutex_lock(&powerclamp_lock);
794-
retval = allocate_copy_idle_injection_mask(cpu_present_mask);
800+
if (!cpumask_available(idle_injection_cpu_mask))
801+
retval = allocate_copy_idle_injection_mask(cpu_present_mask);
795802
mutex_unlock(&powerclamp_lock);
796803

797804
if (retval)

drivers/thermal/thermal_sysfs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
876876
unsigned long states = cdev->max_state + 1;
877877
int var;
878878

879-
lockdep_assert_held(&cdev->lock);
880-
881879
var = sizeof(*stats);
882880
var += sizeof(*stats->time_in_state) * states;
883881
var += sizeof(*stats->trans_table) * states * states;
@@ -903,8 +901,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
903901

904902
static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev)
905903
{
906-
lockdep_assert_held(&cdev->lock);
907-
908904
kfree(cdev->stats);
909905
cdev->stats = NULL;
910906
}
@@ -931,6 +927,8 @@ void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev)
931927

932928
void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev)
933929
{
930+
lockdep_assert_held(&cdev->lock);
931+
934932
cooling_device_stats_destroy(cdev);
935933
cooling_device_stats_setup(cdev);
936934
}

0 commit comments

Comments
 (0)