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
Unified · Split
| @@ -153,7 +153,6 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp · 152 unmodified lines | |||
| 153 | cancel_delayed_work_sync(&pci_info->work); | 153 | cancel_delayed_work_sync(&pci_info->work); |
| 154 | proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_INT_ENABLE_0, 0); | 154 | proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_INT_ENABLE_0, 0); |
| 155 | proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0); | 155 | proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0); |
| 156 | thermal_zone_device_disable(tzd); | ||
| 157 | pci_info->stored_thres = 0; | 156 | pci_info->stored_thres = 0; |
| 158 | return 0; | 157 | return 0; |
| 159 | } | 158 | } |
| @@ -235,6 +235,12 @@ static int max_idle_set(const char *arg, const struct kernel_param *kp) · 234 unmodified lines | |||
| 235 | goto skip_limit_set; | 235 | goto skip_limit_set; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 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 | |||
| 238 | if (check_invalid(idle_injection_cpu_mask, new_max_idle)) { | 244 | if (check_invalid(idle_injection_cpu_mask, new_max_idle)) { |
| 239 | ret = -EINVAL; | 245 | ret = -EINVAL; |
| 240 | goto skip_limit_set; | 246 | goto skip_limit_set; |
| @@ -791,7 +797,8 @@ static int __init powerclamp_init(void) · 550 unmodified lines | |||
| 791 | return retval; | 797 | return retval; |
| 792 | 798 | ||
| 793 | mutex_lock(&powerclamp_lock); | 799 | 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); | ||
| 795 | mutex_unlock(&powerclamp_lock); | 802 | mutex_unlock(&powerclamp_lock); |
| 796 | 803 | ||
| 797 | if (retval) | 804 | if (retval) |
| @@ -876,8 +876,6 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev) · 875 unmodified lines | |||
| 876 | unsigned long states = cdev->max_state + 1; | 876 | unsigned long states = cdev->max_state + 1; |
| 877 | int var; | 877 | int var; |
| 878 | 878 | ||
| 879 | lockdep_assert_held(&cdev->lock); | ||
| 880 | |||
| 881 | var = sizeof(*stats); | 879 | var = sizeof(*stats); |
| 882 | var += sizeof(*stats->time_in_state) * states; | 880 | var += sizeof(*stats->time_in_state) * states; |
| 883 | var += sizeof(*stats->trans_table) * states * states; | 881 | var += sizeof(*stats->trans_table) * states * states; |
| @@ -903,8 +901,6 @@ out: · 19 unmodified lines | |||
| 903 | 901 | ||
| 904 | static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev) | 902 | static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev) |
| 905 | { | 903 | { |
| 906 | lockdep_assert_held(&cdev->lock); | ||
| 907 | |||
| 908 | kfree(cdev->stats); | 904 | kfree(cdev->stats); |
| 909 | cdev->stats = NULL; | 905 | cdev->stats = NULL; |
| 910 | } | 906 | } |
| @@ -931,6 +927,8 @@ void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev) · 20 unmodified lines | |||
| 931 | 927 | ||
| 932 | void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev) | 928 | void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev) |
| 933 | { | 929 | { |
| 930 | lockdep_assert_held(&cdev->lock); | ||
| 931 | |||
| 934 | cooling_device_stats_destroy(cdev); | 932 | cooling_device_stats_destroy(cdev); |
| 935 | cooling_device_stats_setup(cdev); | 933 | cooling_device_stats_setup(cdev); |
| 936 | } | 934 | } |