Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal fixes from Zhang Rui:
"Specifics:

- Update the help text of INT3403 Thermal driver, which was not
friendly to users. From Zhang Rui.

- The "type" sysfs attribute of x86_pkg_temp_thermal registered
thermal zones includes an instance number, which makes the
thermal-to-hwmon bridge fails to group them all in a single hwmon
device. Fixed by Jean Delvare.

- The hwmon device registered by x86_pkg_temp_thermal driver is
redundant because the temperature value reported by
x86_pkg_temp_thermal is already reported by the coretemp driver.
Fixed by Jean Delvare.

- Fix a problem that the cooling device can not be updated properly
if it is initialized at max cooling state. From Ni Wade.

- Fix a problem that OF registered thermal zones are running without
thermal governors. From Zhang Rui.

- Commit beeb5a1e0ef7 ("thermal: rcar-thermal: Enable driver
compilation with COMPILE_TEST") broke build on archs wihout io
memory. Thus make it depend on HAS_IOMEM to bypass build failures.
Fixed by Richard Weinberger"

* 'for-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
Thermal: thermal zone governor fix
Thermal: Allow first update of cooling device state
thermal,rcar_thermal: Add dependency on HAS_IOMEM
x86_pkg_temp_thermal: Fix the thermal zone type
x86_pkg_temp_thermal: Do not expose as a hwmon device
Thermal: update INT3404 thermal driver help text

+36 -15
+11 -2
drivers/thermal/Kconfig
··· 136 136 config RCAR_THERMAL 137 137 tristate "Renesas R-Car thermal driver" 138 138 depends on ARCH_SHMOBILE || COMPILE_TEST 139 + depends on HAS_IOMEM 139 140 help 140 141 Enable this to plug the R-Car thermal sensor driver into the Linux 141 142 thermal framework. ··· 211 210 tristate "ACPI INT3403 thermal driver" 212 211 depends on X86 && ACPI 213 212 help 214 - This driver uses ACPI INT3403 device objects. If present, it will 215 - register each INT3403 thermal sensor as a thermal zone. 213 + Newer laptops and tablets that use ACPI may have thermal sensors 214 + outside the core CPU/SOC for thermal safety reasons. These 215 + temperature sensors are also exposed for the OS to use via the so 216 + called INT3403 ACPI object. This driver will, on devices that have 217 + such sensors, expose the temperature information from these sensors 218 + to userspace via the normal thermal framework. This means that a wide 219 + range of applications and GUI widgets can show this information to 220 + the user or use this information for making decisions. For example, 221 + the Intel Thermal Daemon can use this information to allow the user 222 + to select his laptop to run without turning on the fans. 216 223 217 224 menu "Texas Instruments thermal drivers" 218 225 source "drivers/thermal/ti-soc-thermal/Kconfig"
+19 -8
drivers/thermal/thermal_core.c
··· 56 56 static DEFINE_MUTEX(thermal_list_lock); 57 57 static DEFINE_MUTEX(thermal_governor_lock); 58 58 59 + static struct thermal_governor *def_governor; 60 + 59 61 static struct thermal_governor *__find_governor(const char *name) 60 62 { 61 63 struct thermal_governor *pos; 64 + 65 + if (!name || !name[0]) 66 + return def_governor; 62 67 63 68 list_for_each_entry(pos, &thermal_governor_list, governor_list) 64 69 if (!strnicmp(name, pos->name, THERMAL_NAME_LENGTH)) ··· 87 82 if (__find_governor(governor->name) == NULL) { 88 83 err = 0; 89 84 list_add(&governor->governor_list, &thermal_governor_list); 85 + if (!def_governor && !strncmp(governor->name, 86 + DEFAULT_THERMAL_GOVERNOR, THERMAL_NAME_LENGTH)) 87 + def_governor = governor; 90 88 } 91 89 92 90 mutex_lock(&thermal_list_lock); 93 91 94 92 list_for_each_entry(pos, &thermal_tz_list, node) { 93 + /* 94 + * only thermal zones with specified tz->tzp->governor_name 95 + * may run with tz->govenor unset 96 + */ 95 97 if (pos->governor) 96 98 continue; 97 - if (pos->tzp) 98 - name = pos->tzp->governor_name; 99 - else 100 - name = DEFAULT_THERMAL_GOVERNOR; 99 + 100 + name = pos->tzp->governor_name; 101 + 101 102 if (!strnicmp(name, governor->name, THERMAL_NAME_LENGTH)) 102 103 pos->governor = governor; 103 104 } ··· 353 342 static void handle_non_critical_trips(struct thermal_zone_device *tz, 354 343 int trip, enum thermal_trip_type trip_type) 355 344 { 356 - if (tz->governor) 357 - tz->governor->throttle(tz, trip); 345 + tz->governor ? tz->governor->throttle(tz, trip) : 346 + def_governor->throttle(tz, trip); 358 347 } 359 348 360 349 static void handle_critical_trips(struct thermal_zone_device *tz, ··· 1118 1107 INIT_LIST_HEAD(&cdev->thermal_instances); 1119 1108 cdev->np = np; 1120 1109 cdev->ops = ops; 1121 - cdev->updated = true; 1110 + cdev->updated = false; 1122 1111 cdev->device.class = &thermal_class; 1123 1112 cdev->devdata = devdata; 1124 1113 dev_set_name(&cdev->device, "cooling_device%d", cdev->id); ··· 1544 1533 if (tz->tzp) 1545 1534 tz->governor = __find_governor(tz->tzp->governor_name); 1546 1535 else 1547 - tz->governor = __find_governor(DEFAULT_THERMAL_GOVERNOR); 1536 + tz->governor = def_governor; 1548 1537 1549 1538 mutex_unlock(&thermal_governor_lock); 1550 1539
+6 -5
drivers/thermal/x86_pkg_temp_thermal.c
··· 68 68 struct thermal_zone_device *tzone; 69 69 }; 70 70 71 + static const struct thermal_zone_params pkg_temp_tz_params = { 72 + .no_hwmon = true, 73 + }; 74 + 71 75 /* List maintaining number of package instances */ 72 76 static LIST_HEAD(phy_dev_list); 73 77 static DEFINE_MUTEX(phy_dev_list_mutex); ··· 398 394 int err; 399 395 u32 tj_max; 400 396 struct phy_dev_entry *phy_dev_entry; 401 - char buffer[30]; 402 397 int thres_count; 403 398 u32 eax, ebx, ecx, edx; 404 399 u8 *temp; ··· 443 440 phy_dev_entry->first_cpu = cpu; 444 441 phy_dev_entry->tj_max = tj_max; 445 442 phy_dev_entry->ref_cnt = 1; 446 - snprintf(buffer, sizeof(buffer), "pkg-temp-%d\n", 447 - phy_dev_entry->phys_proc_id); 448 - phy_dev_entry->tzone = thermal_zone_device_register(buffer, 443 + phy_dev_entry->tzone = thermal_zone_device_register("x86_pkg_temp", 449 444 thres_count, 450 445 (thres_count == MAX_NUMBER_OF_TRIPS) ? 451 446 0x03 : 0x01, 452 - phy_dev_entry, &tzone_ops, NULL, 0, 0); 447 + phy_dev_entry, &tzone_ops, &pkg_temp_tz_params, 0, 0); 453 448 if (IS_ERR(phy_dev_entry->tzone)) { 454 449 err = PTR_ERR(phy_dev_entry->tzone); 455 450 goto err_ret_free;