Pull bugzilla-8842 into release branch

Len Brown d8dd3cbc fc0dc4d3

+149 -14
+20
Documentation/kernel-parameters.txt
··· 1822 thash_entries= [KNL,NET] 1823 Set number of hash buckets for TCP connection 1824 1825 time Show timing data prefixed to each printk message line 1826 [deprecated, see 'printk.time'] 1827
··· 1822 thash_entries= [KNL,NET] 1823 Set number of hash buckets for TCP connection 1824 1825 + thermal.act= [HW,ACPI] 1826 + -1: disable all active trip points in all thermal zones 1827 + <degrees C>: override all lowest active trip points 1828 + 1829 + thermal.nocrt= [HW,ACPI] 1830 + Set to disable actions on ACPI thermal zone 1831 + critical and hot trip points. 1832 + 1833 + thermal.off= [HW,ACPI] 1834 + 1: disable ACPI thermal control 1835 + 1836 + thermal.psv= [HW,ACPI] 1837 + -1: disable all passive trip points 1838 + <degrees C>: override all passive trip points to this value 1839 + 1840 + thermal.tzp= [HW,ACPI] 1841 + Specify global default ACPI thermal zone polling rate 1842 + <deci-seconds>: poll all this frequency 1843 + 0: no polling (default) 1844 + 1845 time Show timing data prefixed to each printk message line 1846 [deprecated, see 'printk.time'] 1847
+129 -14
drivers/acpi/thermal.c
··· 33 34 #include <linux/kernel.h> 35 #include <linux/module.h> 36 #include <linux/init.h> 37 #include <linux/types.h> 38 #include <linux/proc_fs.h> ··· 75 MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); 76 MODULE_LICENSE("GPL"); 77 78 static int tzp; 79 - module_param(tzp, int, 0); 80 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); 81 82 static int acpi_thermal_add(struct acpi_device *device); 83 static int acpi_thermal_remove(struct acpi_device *device, int type); ··· 356 357 /* Passive: Processors (optional) */ 358 359 - status = 360 - acpi_evaluate_integer(tz->device->handle, "_PSV", NULL, 361 - &tz->trips.passive.temperature); 362 if (ACPI_FAILURE(status)) { 363 tz->trips.passive.flags.valid = 0; 364 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n")); ··· 410 411 char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; 412 413 - status = 414 - acpi_evaluate_integer(tz->device->handle, name, NULL, 415 - &tz->trips.active[i].temperature); 416 - if (ACPI_FAILURE(status)) 417 break; 418 419 name[2] = 'L'; 420 status = ··· 473 474 static int acpi_thermal_critical(struct acpi_thermal *tz) 475 { 476 - if (!tz || !tz->trips.critical.flags.valid) 477 return -EINVAL; 478 479 if (tz->temperature >= tz->trips.critical.temperature) { ··· 495 496 static int acpi_thermal_hot(struct acpi_thermal *tz) 497 { 498 - if (!tz || !tz->trips.hot.flags.valid) 499 return -EINVAL; 500 501 if (tz->temperature >= tz->trips.hot.temperature) { ··· 870 goto end; 871 872 if (tz->trips.critical.flags.valid) 873 - seq_printf(seq, "critical (S5): %ld C\n", 874 - KELVIN_TO_CELSIUS(tz->trips.critical.temperature)); 875 876 if (tz->trips.hot.flags.valid) 877 - seq_printf(seq, "hot (S4): %ld C\n", 878 - KELVIN_TO_CELSIUS(tz->trips.hot.temperature)); 879 880 if (tz->trips.passive.flags.valid) { 881 seq_printf(seq, ··· 1329 return AE_OK; 1330 } 1331 1332 static int __init acpi_thermal_init(void) 1333 { 1334 int result = 0; 1335 1336 1337 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); 1338 if (!acpi_thermal_dir) 1339 return -ENODEV;
··· 33 34 #include <linux/kernel.h> 35 #include <linux/module.h> 36 + #include <linux/dmi.h> 37 #include <linux/init.h> 38 #include <linux/types.h> 39 #include <linux/proc_fs.h> ··· 74 MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); 75 MODULE_LICENSE("GPL"); 76 77 + static int act; 78 + module_param(act, int, 0644); 79 + MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n"); 80 + 81 static int tzp; 82 + module_param(tzp, int, 0444); 83 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); 84 + 85 + static int nocrt; 86 + module_param(nocrt, int, 0); 87 + MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n"); 88 + 89 + static int off; 90 + module_param(off, int, 0); 91 + MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); 92 + 93 + static int psv; 94 + module_param(psv, int, 0644); 95 + MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n"); 96 97 static int acpi_thermal_add(struct acpi_device *device); 98 static int acpi_thermal_remove(struct acpi_device *device, int type); ··· 339 340 /* Passive: Processors (optional) */ 341 342 + if (psv == -1) { 343 + status = AE_SUPPORT; 344 + } else if (psv > 0) { 345 + tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv); 346 + status = AE_OK; 347 + } else { 348 + status = acpi_evaluate_integer(tz->device->handle, 349 + "_PSV", NULL, &tz->trips.passive.temperature); 350 + } 351 + 352 if (ACPI_FAILURE(status)) { 353 tz->trips.passive.flags.valid = 0; 354 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n")); ··· 386 387 char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; 388 389 + if (act == -1) 390 + break; /* disable all active trip points */ 391 + 392 + status = acpi_evaluate_integer(tz->device->handle, 393 + name, NULL, &tz->trips.active[i].temperature); 394 + 395 + if (ACPI_FAILURE(status)) { 396 + if (i == 0) /* no active trip points */ 397 + break; 398 + if (act <= 0) /* no override requested */ 399 + break; 400 + if (i == 1) { /* 1 trip point */ 401 + tz->trips.active[0].temperature = 402 + CELSIUS_TO_KELVIN(act); 403 + } else { /* multiple trips */ 404 + /* 405 + * Don't allow override higher than 406 + * the next higher trip point 407 + */ 408 + tz->trips.active[i - 1].temperature = 409 + (tz->trips.active[i - 2].temperature < 410 + CELSIUS_TO_KELVIN(act) ? 411 + tz->trips.active[i - 2].temperature : 412 + CELSIUS_TO_KELVIN(act)); 413 + } 414 break; 415 + } 416 417 name[2] = 'L'; 418 status = ··· 427 428 static int acpi_thermal_critical(struct acpi_thermal *tz) 429 { 430 + if (!tz || !tz->trips.critical.flags.valid || nocrt) 431 return -EINVAL; 432 433 if (tz->temperature >= tz->trips.critical.temperature) { ··· 449 450 static int acpi_thermal_hot(struct acpi_thermal *tz) 451 { 452 + if (!tz || !tz->trips.hot.flags.valid || nocrt) 453 return -EINVAL; 454 455 if (tz->temperature >= tz->trips.hot.temperature) { ··· 824 goto end; 825 826 if (tz->trips.critical.flags.valid) 827 + seq_printf(seq, "critical (S5): %ld C%s", 828 + KELVIN_TO_CELSIUS(tz->trips.critical.temperature), 829 + nocrt ? " <disabled>\n" : "\n"); 830 831 if (tz->trips.hot.flags.valid) 832 + seq_printf(seq, "hot (S4): %ld C%s", 833 + KELVIN_TO_CELSIUS(tz->trips.hot.temperature), 834 + nocrt ? " <disabled>\n" : "\n"); 835 836 if (tz->trips.passive.flags.valid) { 837 seq_printf(seq, ··· 1281 return AE_OK; 1282 } 1283 1284 + #ifdef CONFIG_DMI 1285 + static int thermal_act(struct dmi_system_id *d) { 1286 + 1287 + if (act == 0) { 1288 + printk(KERN_NOTICE "ACPI: %s detected: " 1289 + "disabling all active thermal trip points\n", d->ident); 1290 + act = -1; 1291 + } 1292 + return 0; 1293 + } 1294 + static int thermal_tzp(struct dmi_system_id *d) { 1295 + 1296 + if (tzp == 0) { 1297 + printk(KERN_NOTICE "ACPI: %s detected: " 1298 + "enabling thermal zone polling\n", d->ident); 1299 + tzp = 300; /* 300 dS = 30 Seconds */ 1300 + } 1301 + return 0; 1302 + } 1303 + static int thermal_psv(struct dmi_system_id *d) { 1304 + 1305 + if (psv == 0) { 1306 + printk(KERN_NOTICE "ACPI: %s detected: " 1307 + "disabling all passive thermal trip points\n", d->ident); 1308 + psv = -1; 1309 + } 1310 + return 0; 1311 + } 1312 + 1313 + static struct dmi_system_id thermal_dmi_table[] __initdata = { 1314 + /* 1315 + * Award BIOS on this AOpen makes thermal control almost worthless. 1316 + * http://bugzilla.kernel.org/show_bug.cgi?id=8842 1317 + */ 1318 + { 1319 + .callback = thermal_act, 1320 + .ident = "AOpen i915GMm-HFS", 1321 + .matches = { 1322 + DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), 1323 + DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), 1324 + }, 1325 + }, 1326 + { 1327 + .callback = thermal_psv, 1328 + .ident = "AOpen i915GMm-HFS", 1329 + .matches = { 1330 + DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), 1331 + DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), 1332 + }, 1333 + }, 1334 + { 1335 + .callback = thermal_tzp, 1336 + .ident = "AOpen i915GMm-HFS", 1337 + .matches = { 1338 + DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), 1339 + DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), 1340 + }, 1341 + }, 1342 + {} 1343 + }; 1344 + #endif /* CONFIG_DMI */ 1345 + 1346 static int __init acpi_thermal_init(void) 1347 { 1348 int result = 0; 1349 1350 + dmi_check_system(thermal_dmi_table); 1351 1352 + if (off) { 1353 + printk(KERN_NOTICE "ACPI: thermal control disabled\n"); 1354 + return -ENODEV; 1355 + } 1356 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); 1357 if (!acpi_thermal_dir) 1358 return -ENODEV;