Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 549608ea authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull thermal management updates from Zhang Rui:
 "This time we only have a few changes as there are no soc thermal
  changes from Eduardo.  The only big change is the introduction of
  TMON, a tool to help visualize, tune, and test the thermal subsystem.
  The rest is mostly cleanups and fixes all over.

  Specifics:

   - introduce TMON, a tool base on thermal sysfs I/F.  It can be used
     to visualize, tune and test the thermal subsystem.

   - fix a zone/cooling device binding problem, when both thermal zone
     bind parameters and .bind() callback are available"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  tools/thermal: Introduce tmon, a tool for thermal subsystem
  thermal: Fix binding problem when there is thermal zone params
  thermal: cpu_cooling: fix return value check in cpufreq_cooling_register()
  Thermal: Check for validity before doing kfree
  thermal/intel_powerclamp: Add newer CPU models
  Thermal: Tidy up error handling in powerclamp_init
  thermal: Kconfig: cosmetic fixes
  ACPI/thermal : Remove zone disabled warning
  typo in drivers/thermal/Kconfig: lpatform instead of platform
parents 2f466d33 86e0a0bd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -514,10 +514,9 @@ static void acpi_thermal_check(void *data)
{
	struct acpi_thermal *tz = data;

	if (!tz->tz_enabled) {
		pr_warn("thermal zone is disabled \n");
	if (!tz->tz_enabled)
		return;
	}

	thermal_zone_device_update(tz->thermal_zone);
}

@@ -569,9 +568,10 @@ static int thermal_set_mode(struct thermal_zone_device *thermal,
	 */
	if (mode == THERMAL_DEVICE_ENABLED)
		enable = 1;
	else if (mode == THERMAL_DEVICE_DISABLED)
	else if (mode == THERMAL_DEVICE_DISABLED) {
		enable = 0;
	else
		pr_warn("thermal zone will be disabled\n");
	} else
		return -EINVAL;

	if (enable != tz->tz_enabled) {
+4 −3
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ config THERMAL_DEFAULT_GOV_USER_SPACE
	select THERMAL_GOV_USER_SPACE
	help
	  Select this if you want to let the user space manage the
	  lpatform thermals.
	  platform thermals.

endchoice

@@ -69,6 +69,7 @@ config THERMAL_GOV_STEP_WISE
	bool "Step_wise thermal governor"
	help
	  Enable this to manage platform thermals using a simple linear
	  governor.

config THERMAL_GOV_USER_SPACE
	bool "User_space thermal governor"
@@ -116,14 +117,14 @@ config SPEAR_THERMAL
	depends on OF
	help
	  Enable this to plug the SPEAr thermal sensor driver into the Linux
	  thermal framework
	  thermal framework.

config RCAR_THERMAL
	tristate "Renesas R-Car thermal driver"
	depends on ARCH_SHMOBILE
	help
	  Enable this to plug the R-Car thermal sensor driver into the Linux
	  thermal framework
	  thermal framework.

config KIRKWOOD_THERMAL
	tristate "Temperature sensor on Marvell Kirkwood SoCs"
+2 −2
Original line number Diff line number Diff line
@@ -469,10 +469,10 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus)

	cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
						   &cpufreq_cooling_ops);
	if (!cool_dev) {
	if (IS_ERR(cool_dev)) {
		release_idr(&cpufreq_idr, cpufreq_dev->id);
		kfree(cpufreq_dev);
		return ERR_PTR(-EINVAL);
		return cool_dev;
	}
	cpufreq_dev->cool_dev = cool_dev;
	cpufreq_dev->cpufreq_state = 0;
+26 −3
Original line number Diff line number Diff line
@@ -675,6 +675,11 @@ static const struct x86_cpu_id intel_powerclamp_ids[] = {
	{ X86_VENDOR_INTEL, 6, 0x2e},
	{ X86_VENDOR_INTEL, 6, 0x2f},
	{ X86_VENDOR_INTEL, 6, 0x3a},
	{ X86_VENDOR_INTEL, 6, 0x3c},
	{ X86_VENDOR_INTEL, 6, 0x3e},
	{ X86_VENDOR_INTEL, 6, 0x3f},
	{ X86_VENDOR_INTEL, 6, 0x45},
	{ X86_VENDOR_INTEL, 6, 0x46},
	{}
};
MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids);
@@ -758,21 +763,39 @@ static int powerclamp_init(void)
	/* probe cpu features and ids here */
	retval = powerclamp_probe();
	if (retval)
		return retval;
		goto exit_free;

	/* set default limit, maybe adjusted during runtime based on feedback */
	window_size = 2;
	register_hotcpu_notifier(&powerclamp_cpu_notifier);

	powerclamp_thread = alloc_percpu(struct task_struct *);
	if (!powerclamp_thread) {
		retval = -ENOMEM;
		goto exit_unregister;
	}

	cooling_dev = thermal_cooling_device_register("intel_powerclamp", NULL,
						&powerclamp_cooling_ops);
	if (IS_ERR(cooling_dev))
		return -ENODEV;
	if (IS_ERR(cooling_dev)) {
		retval = -ENODEV;
		goto exit_free_thread;
	}

	if (!duration)
		duration = jiffies_to_msecs(DEFAULT_DURATION_JIFFIES);

	powerclamp_create_debug_files();

	return 0;

exit_free_thread:
	free_percpu(powerclamp_thread);
exit_unregister:
	unregister_hotcpu_notifier(&powerclamp_cpu_notifier);
exit_free:
	kfree(cpu_clamping_mask);
	return retval;
}
module_init(powerclamp_init);

+6 −4
Original line number Diff line number Diff line
@@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
		if (!pos->tzp && !pos->ops->bind)
			continue;

		if (!pos->tzp && pos->ops->bind) {
		if (pos->ops->bind) {
			ret = pos->ops->bind(pos, cdev);
			if (ret)
				print_bind_err_msg(pos, cdev, ret);
			continue;
		}

		tzp = pos->tzp;
@@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz)

	mutex_lock(&thermal_list_lock);

	/* If there is no platform data, try to use ops->bind */
	if (!tzp && tz->ops->bind) {
	/* If there is ops->bind, try to use ops->bind */
	if (tz->ops->bind) {
		list_for_each_entry(pos, &thermal_cdev_list, node) {
			ret = tz->ops->bind(tz, pos);
			if (ret)
@@ -1038,7 +1039,8 @@ static void thermal_release(struct device *dev)
		     sizeof("thermal_zone") - 1)) {
		tz = to_thermal_zone(dev);
		kfree(tz);
	} else {
	} else if(!strncmp(dev_name(dev), "cooling_device",
			sizeof("cooling_device") - 1)){
		cdev = to_cooling_device(dev);
		kfree(cdev);
	}
Loading