diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/thermal.c | 10 | ||||
-rw-r--r-- | drivers/thermal/Kconfig | 7 | ||||
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 4 | ||||
-rw-r--r-- | drivers/thermal/intel_powerclamp.c | 29 | ||||
-rw-r--r-- | drivers/thermal/thermal_core.c | 10 |
5 files changed, 43 insertions, 17 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index e600b5dbfcb6..0d9f46b5ae6d 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -514,10 +514,9 @@ static void acpi_thermal_check(void *data) | |||
514 | { | 514 | { |
515 | struct acpi_thermal *tz = data; | 515 | struct acpi_thermal *tz = data; |
516 | 516 | ||
517 | if (!tz->tz_enabled) { | 517 | if (!tz->tz_enabled) |
518 | pr_warn("thermal zone is disabled \n"); | ||
519 | return; | 518 | return; |
520 | } | 519 | |
521 | thermal_zone_device_update(tz->thermal_zone); | 520 | thermal_zone_device_update(tz->thermal_zone); |
522 | } | 521 | } |
523 | 522 | ||
@@ -569,9 +568,10 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, | |||
569 | */ | 568 | */ |
570 | if (mode == THERMAL_DEVICE_ENABLED) | 569 | if (mode == THERMAL_DEVICE_ENABLED) |
571 | enable = 1; | 570 | enable = 1; |
572 | else if (mode == THERMAL_DEVICE_DISABLED) | 571 | else if (mode == THERMAL_DEVICE_DISABLED) { |
573 | enable = 0; | 572 | enable = 0; |
574 | else | 573 | pr_warn("thermal zone will be disabled\n"); |
574 | } else | ||
575 | return -EINVAL; | 575 | return -EINVAL; |
576 | 576 | ||
577 | if (enable != tz->tz_enabled) { | 577 | if (enable != tz->tz_enabled) { |
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 5ef596765060..f35a1f75b15b 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
@@ -56,7 +56,7 @@ config THERMAL_DEFAULT_GOV_USER_SPACE | |||
56 | select THERMAL_GOV_USER_SPACE | 56 | select THERMAL_GOV_USER_SPACE |
57 | help | 57 | help |
58 | Select this if you want to let the user space manage the | 58 | Select this if you want to let the user space manage the |
59 | lpatform thermals. | 59 | platform thermals. |
60 | 60 | ||
61 | endchoice | 61 | endchoice |
62 | 62 | ||
@@ -69,6 +69,7 @@ config THERMAL_GOV_STEP_WISE | |||
69 | bool "Step_wise thermal governor" | 69 | bool "Step_wise thermal governor" |
70 | help | 70 | help |
71 | Enable this to manage platform thermals using a simple linear | 71 | Enable this to manage platform thermals using a simple linear |
72 | governor. | ||
72 | 73 | ||
73 | config THERMAL_GOV_USER_SPACE | 74 | config THERMAL_GOV_USER_SPACE |
74 | bool "User_space thermal governor" | 75 | bool "User_space thermal governor" |
@@ -116,14 +117,14 @@ config SPEAR_THERMAL | |||
116 | depends on OF | 117 | depends on OF |
117 | help | 118 | help |
118 | Enable this to plug the SPEAr thermal sensor driver into the Linux | 119 | Enable this to plug the SPEAr thermal sensor driver into the Linux |
119 | thermal framework | 120 | thermal framework. |
120 | 121 | ||
121 | config RCAR_THERMAL | 122 | config RCAR_THERMAL |
122 | tristate "Renesas R-Car thermal driver" | 123 | tristate "Renesas R-Car thermal driver" |
123 | depends on ARCH_SHMOBILE | 124 | depends on ARCH_SHMOBILE |
124 | help | 125 | help |
125 | Enable this to plug the R-Car thermal sensor driver into the Linux | 126 | Enable this to plug the R-Car thermal sensor driver into the Linux |
126 | thermal framework | 127 | thermal framework. |
127 | 128 | ||
128 | config KIRKWOOD_THERMAL | 129 | config KIRKWOOD_THERMAL |
129 | tristate "Temperature sensor on Marvell Kirkwood SoCs" | 130 | tristate "Temperature sensor on Marvell Kirkwood SoCs" |
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index d17902886c3f..02a46f23d14c 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
@@ -469,10 +469,10 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus) | |||
469 | 469 | ||
470 | cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev, | 470 | cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev, |
471 | &cpufreq_cooling_ops); | 471 | &cpufreq_cooling_ops); |
472 | if (!cool_dev) { | 472 | if (IS_ERR(cool_dev)) { |
473 | release_idr(&cpufreq_idr, cpufreq_dev->id); | 473 | release_idr(&cpufreq_idr, cpufreq_dev->id); |
474 | kfree(cpufreq_dev); | 474 | kfree(cpufreq_dev); |
475 | return ERR_PTR(-EINVAL); | 475 | return cool_dev; |
476 | } | 476 | } |
477 | cpufreq_dev->cool_dev = cool_dev; | 477 | cpufreq_dev->cool_dev = cool_dev; |
478 | cpufreq_dev->cpufreq_state = 0; | 478 | cpufreq_dev->cpufreq_state = 0; |
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index b40b37cd25e0..8f181b3f842b 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c | |||
@@ -675,6 +675,11 @@ static const struct x86_cpu_id intel_powerclamp_ids[] = { | |||
675 | { X86_VENDOR_INTEL, 6, 0x2e}, | 675 | { X86_VENDOR_INTEL, 6, 0x2e}, |
676 | { X86_VENDOR_INTEL, 6, 0x2f}, | 676 | { X86_VENDOR_INTEL, 6, 0x2f}, |
677 | { X86_VENDOR_INTEL, 6, 0x3a}, | 677 | { X86_VENDOR_INTEL, 6, 0x3a}, |
678 | { X86_VENDOR_INTEL, 6, 0x3c}, | ||
679 | { X86_VENDOR_INTEL, 6, 0x3e}, | ||
680 | { X86_VENDOR_INTEL, 6, 0x3f}, | ||
681 | { X86_VENDOR_INTEL, 6, 0x45}, | ||
682 | { X86_VENDOR_INTEL, 6, 0x46}, | ||
678 | {} | 683 | {} |
679 | }; | 684 | }; |
680 | MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); | 685 | MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); |
@@ -758,21 +763,39 @@ static int powerclamp_init(void) | |||
758 | /* probe cpu features and ids here */ | 763 | /* probe cpu features and ids here */ |
759 | retval = powerclamp_probe(); | 764 | retval = powerclamp_probe(); |
760 | if (retval) | 765 | if (retval) |
761 | return retval; | 766 | goto exit_free; |
767 | |||
762 | /* set default limit, maybe adjusted during runtime based on feedback */ | 768 | /* set default limit, maybe adjusted during runtime based on feedback */ |
763 | window_size = 2; | 769 | window_size = 2; |
764 | register_hotcpu_notifier(&powerclamp_cpu_notifier); | 770 | register_hotcpu_notifier(&powerclamp_cpu_notifier); |
771 | |||
765 | powerclamp_thread = alloc_percpu(struct task_struct *); | 772 | powerclamp_thread = alloc_percpu(struct task_struct *); |
773 | if (!powerclamp_thread) { | ||
774 | retval = -ENOMEM; | ||
775 | goto exit_unregister; | ||
776 | } | ||
777 | |||
766 | cooling_dev = thermal_cooling_device_register("intel_powerclamp", NULL, | 778 | cooling_dev = thermal_cooling_device_register("intel_powerclamp", NULL, |
767 | &powerclamp_cooling_ops); | 779 | &powerclamp_cooling_ops); |
768 | if (IS_ERR(cooling_dev)) | 780 | if (IS_ERR(cooling_dev)) { |
769 | return -ENODEV; | 781 | retval = -ENODEV; |
782 | goto exit_free_thread; | ||
783 | } | ||
770 | 784 | ||
771 | if (!duration) | 785 | if (!duration) |
772 | duration = jiffies_to_msecs(DEFAULT_DURATION_JIFFIES); | 786 | duration = jiffies_to_msecs(DEFAULT_DURATION_JIFFIES); |
787 | |||
773 | powerclamp_create_debug_files(); | 788 | powerclamp_create_debug_files(); |
774 | 789 | ||
775 | return 0; | 790 | return 0; |
791 | |||
792 | exit_free_thread: | ||
793 | free_percpu(powerclamp_thread); | ||
794 | exit_unregister: | ||
795 | unregister_hotcpu_notifier(&powerclamp_cpu_notifier); | ||
796 | exit_free: | ||
797 | kfree(cpu_clamping_mask); | ||
798 | return retval; | ||
776 | } | 799 | } |
777 | module_init(powerclamp_init); | 800 | module_init(powerclamp_init); |
778 | 801 | ||
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 4962a6aaf295..03a567199bbe 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c | |||
@@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev) | |||
247 | if (!pos->tzp && !pos->ops->bind) | 247 | if (!pos->tzp && !pos->ops->bind) |
248 | continue; | 248 | continue; |
249 | 249 | ||
250 | if (!pos->tzp && pos->ops->bind) { | 250 | if (pos->ops->bind) { |
251 | ret = pos->ops->bind(pos, cdev); | 251 | ret = pos->ops->bind(pos, cdev); |
252 | if (ret) | 252 | if (ret) |
253 | print_bind_err_msg(pos, cdev, ret); | 253 | print_bind_err_msg(pos, cdev, ret); |
254 | continue; | ||
254 | } | 255 | } |
255 | 256 | ||
256 | tzp = pos->tzp; | 257 | tzp = pos->tzp; |
@@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz) | |||
282 | 283 | ||
283 | mutex_lock(&thermal_list_lock); | 284 | mutex_lock(&thermal_list_lock); |
284 | 285 | ||
285 | /* If there is no platform data, try to use ops->bind */ | 286 | /* If there is ops->bind, try to use ops->bind */ |
286 | if (!tzp && tz->ops->bind) { | 287 | if (tz->ops->bind) { |
287 | list_for_each_entry(pos, &thermal_cdev_list, node) { | 288 | list_for_each_entry(pos, &thermal_cdev_list, node) { |
288 | ret = tz->ops->bind(tz, pos); | 289 | ret = tz->ops->bind(tz, pos); |
289 | if (ret) | 290 | if (ret) |
@@ -1038,7 +1039,8 @@ static void thermal_release(struct device *dev) | |||
1038 | sizeof("thermal_zone") - 1)) { | 1039 | sizeof("thermal_zone") - 1)) { |
1039 | tz = to_thermal_zone(dev); | 1040 | tz = to_thermal_zone(dev); |
1040 | kfree(tz); | 1041 | kfree(tz); |
1041 | } else { | 1042 | } else if(!strncmp(dev_name(dev), "cooling_device", |
1043 | sizeof("cooling_device") - 1)){ | ||
1042 | cdev = to_cooling_device(dev); | 1044 | cdev = to_cooling_device(dev); |
1043 | kfree(cdev); | 1045 | kfree(cdev); |
1044 | } | 1046 | } |