aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c67
1 files changed, 56 insertions, 11 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1e06159fd9c4..bc6d5866ef98 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -77,23 +77,27 @@ MODULE_LICENSE("GPL");
77 77
78static int act; 78static int act;
79module_param(act, int, 0644); 79module_param(act, int, 0644);
80MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n"); 80MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.");
81
82static int crt;
83module_param(crt, int, 0644);
84MODULE_PARM_DESC(crt, "Disable or lower all critical trip points.");
81 85
82static int tzp; 86static int tzp;
83module_param(tzp, int, 0444); 87module_param(tzp, int, 0444);
84MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); 88MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.");
85 89
86static int nocrt; 90static int nocrt;
87module_param(nocrt, int, 0); 91module_param(nocrt, int, 0);
88MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n"); 92MODULE_PARM_DESC(nocrt, "Set to take no action upon ACPI thermal zone critical trips points.");
89 93
90static int off; 94static int off;
91module_param(off, int, 0); 95module_param(off, int, 0);
92MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); 96MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.");
93 97
94static int psv; 98static int psv;
95module_param(psv, int, 0644); 99module_param(psv, int, 0644);
96MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n"); 100MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
97 101
98static int acpi_thermal_add(struct acpi_device *device); 102static int acpi_thermal_add(struct acpi_device *device);
99static int acpi_thermal_remove(struct acpi_device *device, int type); 103static int acpi_thermal_remove(struct acpi_device *device, int type);
@@ -340,6 +344,20 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
340 tz->trips.critical.temperature)); 344 tz->trips.critical.temperature));
341 } 345 }
342 346
347 if (tz->trips.critical.flags.valid == 1) {
348 if (crt == -1) {
349 tz->trips.critical.flags.valid = 0;
350 } else if (crt > 0) {
351 unsigned long crt_k = CELSIUS_TO_KELVIN(crt);
352
353 /*
354 * Allow override to lower critical threshold
355 */
356 if (crt_k < tz->trips.critical.temperature)
357 tz->trips.critical.temperature = crt_k;
358 }
359 }
360
343 /* Critical Sleep (optional) */ 361 /* Critical Sleep (optional) */
344 362
345 status = 363 status =
@@ -485,8 +503,12 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
485 printk(KERN_EMERG 503 printk(KERN_EMERG
486 "Critical temperature reached (%ld C), shutting down.\n", 504 "Critical temperature reached (%ld C), shutting down.\n",
487 KELVIN_TO_CELSIUS(tz->temperature)); 505 KELVIN_TO_CELSIUS(tz->temperature));
488 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 506 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
489 tz->trips.critical.flags.enabled); 507 tz->trips.critical.flags.enabled);
508 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
509 tz->device->dev.bus_id,
510 ACPI_THERMAL_NOTIFY_CRITICAL,
511 tz->trips.critical.flags.enabled);
490 512
491 orderly_poweroff(true); 513 orderly_poweroff(true);
492 514
@@ -504,8 +526,12 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
504 } else if (tz->trips.hot.flags.enabled) 526 } else if (tz->trips.hot.flags.enabled)
505 tz->trips.hot.flags.enabled = 0; 527 tz->trips.hot.flags.enabled = 0;
506 528
507 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 529 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
508 tz->trips.hot.flags.enabled); 530 tz->trips.hot.flags.enabled);
531 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
532 tz->device->dev.bus_id,
533 ACPI_THERMAL_NOTIFY_HOT,
534 tz->trips.hot.flags.enabled);
509 535
510 /* TBD: Call user-mode "sleep(S4)" function */ 536 /* TBD: Call user-mode "sleep(S4)" function */
511 537
@@ -1067,9 +1093,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1067 entry->owner = THIS_MODULE; 1093 entry->owner = THIS_MODULE;
1068 } 1094 }
1069 1095
1070 /* 'trip_points' [R/W] */ 1096 /* 'trip_points' [R] */
1071 entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, 1097 entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS,
1072 S_IFREG | S_IRUGO | S_IWUSR, 1098 S_IRUGO,
1073 acpi_device_dir(device)); 1099 acpi_device_dir(device));
1074 if (!entry) 1100 if (!entry)
1075 return -ENODEV; 1101 return -ENODEV;
@@ -1149,12 +1175,16 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1149 case ACPI_THERMAL_NOTIFY_THRESHOLDS: 1175 case ACPI_THERMAL_NOTIFY_THRESHOLDS:
1150 acpi_thermal_get_trip_points(tz); 1176 acpi_thermal_get_trip_points(tz);
1151 acpi_thermal_check(tz); 1177 acpi_thermal_check(tz);
1152 acpi_bus_generate_event(device, event, 0); 1178 acpi_bus_generate_proc_event(device, event, 0);
1179 acpi_bus_generate_netlink_event(device->pnp.device_class,
1180 device->dev.bus_id, event, 0);
1153 break; 1181 break;
1154 case ACPI_THERMAL_NOTIFY_DEVICES: 1182 case ACPI_THERMAL_NOTIFY_DEVICES:
1155 if (tz->flags.devices) 1183 if (tz->flags.devices)
1156 acpi_thermal_get_devices(tz); 1184 acpi_thermal_get_devices(tz);
1157 acpi_bus_generate_event(device, event, 0); 1185 acpi_bus_generate_proc_event(device, event, 0);
1186 acpi_bus_generate_netlink_event(device->pnp.device_class,
1187 device->dev.bus_id, event, 0);
1158 break; 1188 break;
1159 default: 1189 default:
1160 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1190 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -1339,6 +1369,13 @@ static int thermal_act(struct dmi_system_id *d) {
1339 } 1369 }
1340 return 0; 1370 return 0;
1341} 1371}
1372static int thermal_nocrt(struct dmi_system_id *d) {
1373
1374 printk(KERN_NOTICE "ACPI: %s detected: "
1375 "disabling all critical thermal trip point actions.\n", d->ident);
1376 nocrt = 1;
1377 return 0;
1378}
1342static int thermal_tzp(struct dmi_system_id *d) { 1379static int thermal_tzp(struct dmi_system_id *d) {
1343 1380
1344 if (tzp == 0) { 1381 if (tzp == 0) {
@@ -1387,6 +1424,14 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = {
1387 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), 1424 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
1388 }, 1425 },
1389 }, 1426 },
1427 {
1428 .callback = thermal_nocrt,
1429 .ident = "Gigabyte GA-7ZX",
1430 .matches = {
1431 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
1432 DMI_MATCH(DMI_BOARD_NAME, "7ZX"),
1433 },
1434 },
1390 {} 1435 {}
1391}; 1436};
1392#endif /* CONFIG_DMI */ 1437#endif /* CONFIG_DMI */