Commit 2bac7dc1 authored by Linus Torvalds's avatar Linus Torvalds

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
parents f9643331 896c5150
...@@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp ...@@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp
cancel_delayed_work_sync(&pci_info->work); cancel_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_INT_ENABLE_0, 0);
proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0); proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0);
thermal_zone_device_disable(tzd);
pci_info->stored_thres = 0; pci_info->stored_thres = 0;
return 0; return 0;
} }
......
...@@ -235,6 +235,12 @@ static int max_idle_set(const char *arg, const struct kernel_param *kp) ...@@ -235,6 +235,12 @@ static int max_idle_set(const char *arg, const struct kernel_param *kp)
goto skip_limit_set; goto skip_limit_set;
} }
if (!cpumask_available(idle_injection_cpu_mask)) {
ret = allocate_copy_idle_injection_mask(cpu_present_mask);
if (ret)
goto skip_limit_set;
}
if (check_invalid(idle_injection_cpu_mask, new_max_idle)) { if (check_invalid(idle_injection_cpu_mask, new_max_idle)) {
ret = -EINVAL; ret = -EINVAL;
goto skip_limit_set; goto skip_limit_set;
...@@ -791,7 +797,8 @@ static int __init powerclamp_init(void) ...@@ -791,7 +797,8 @@ static int __init powerclamp_init(void)
return retval; return retval;
mutex_lock(&powerclamp_lock); mutex_lock(&powerclamp_lock);
retval = allocate_copy_idle_injection_mask(cpu_present_mask); if (!cpumask_available(idle_injection_cpu_mask))
retval = allocate_copy_idle_injection_mask(cpu_present_mask);
mutex_unlock(&powerclamp_lock); mutex_unlock(&powerclamp_lock);
if (retval) if (retval)
......
...@@ -876,8 +876,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev) ...@@ -876,8 +876,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
unsigned long states = cdev->max_state + 1; unsigned long states = cdev->max_state + 1;
int var; int var;
lockdep_assert_held(&cdev->lock);
var = sizeof(*stats); var = sizeof(*stats);
var += sizeof(*stats->time_in_state) * states; var += sizeof(*stats->time_in_state) * states;
var += sizeof(*stats->trans_table) * states * states; var += sizeof(*stats->trans_table) * states * states;
...@@ -903,8 +901,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev) ...@@ -903,8 +901,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev) static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev)
{ {
lockdep_assert_held(&cdev->lock);
kfree(cdev->stats); kfree(cdev->stats);
cdev->stats = NULL; cdev->stats = NULL;
} }
...@@ -931,6 +927,8 @@ void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev) ...@@ -931,6 +927,8 @@ void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev)
void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev) void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev)
{ {
lockdep_assert_held(&cdev->lock);
cooling_device_stats_destroy(cdev); cooling_device_stats_destroy(cdev);
cooling_device_stats_setup(cdev); cooling_device_stats_setup(cdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment