···18221822 thash_entries= [KNL,NET]18231823 Set number of hash buckets for TCP connection1824182418251825+ thermal.act= [HW,ACPI]18261826+ -1: disable all active trip points in all thermal zones18271827+ <degrees C>: override all lowest active trip points18281828+18291829+ thermal.nocrt= [HW,ACPI]18301830+ Set to disable actions on ACPI thermal zone18311831+ critical and hot trip points.18321832+18331833+ thermal.off= [HW,ACPI]18341834+ 1: disable ACPI thermal control18351835+18361836+ thermal.psv= [HW,ACPI]18371837+ -1: disable all passive trip points18381838+ <degrees C>: override all passive trip points to this value18391839+18401840+ thermal.tzp= [HW,ACPI]18411841+ Specify global default ACPI thermal zone polling rate18421842+ <deci-seconds>: poll all this frequency18431843+ 0: no polling (default)18441844+18251845 time Show timing data prefixed to each printk message line18261846 [deprecated, see 'printk.time']18271847
+129-14
drivers/acpi/thermal.c
···33333434#include <linux/kernel.h>3535#include <linux/module.h>3636+#include <linux/dmi.h>3637#include <linux/init.h>3738#include <linux/types.h>3839#include <linux/proc_fs.h>···7574MODULE_DESCRIPTION("ACPI Thermal Zone Driver");7675MODULE_LICENSE("GPL");77767777+static int act;7878+module_param(act, int, 0644);7979+MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n");8080+7881static int tzp;7979-module_param(tzp, int, 0);8282+module_param(tzp, int, 0444);8083MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");8484+8585+static int nocrt;8686+module_param(nocrt, int, 0);8787+MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n");8888+8989+static int off;9090+module_param(off, int, 0);9191+MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n");9292+9393+static int psv;9494+module_param(psv, int, 0644);9595+MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n");81968297static int acpi_thermal_add(struct acpi_device *device);8398static int acpi_thermal_remove(struct acpi_device *device, int type);···356339357340 /* Passive: Processors (optional) */358341359359- status =360360- acpi_evaluate_integer(tz->device->handle, "_PSV", NULL,361361- &tz->trips.passive.temperature);342342+ if (psv == -1) {343343+ status = AE_SUPPORT;344344+ } else if (psv > 0) {345345+ tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv);346346+ status = AE_OK;347347+ } else {348348+ status = acpi_evaluate_integer(tz->device->handle,349349+ "_PSV", NULL, &tz->trips.passive.temperature);350350+ }351351+362352 if (ACPI_FAILURE(status)) {363353 tz->trips.passive.flags.valid = 0;364354 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n"));···410386411387 char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };412388413413- status =414414- acpi_evaluate_integer(tz->device->handle, name, NULL,415415- &tz->trips.active[i].temperature);416416- if (ACPI_FAILURE(status))389389+ if (act == -1)390390+ break; /* disable all active trip points */391391+392392+ status = acpi_evaluate_integer(tz->device->handle,393393+ name, NULL, &tz->trips.active[i].temperature);394394+395395+ if (ACPI_FAILURE(status)) {396396+ if (i == 0) /* no active trip points */397397+ break;398398+ if (act <= 0) /* no override requested */399399+ break;400400+ if (i == 1) { /* 1 trip point */401401+ tz->trips.active[0].temperature =402402+ CELSIUS_TO_KELVIN(act);403403+ } else { /* multiple trips */404404+ /*405405+ * Don't allow override higher than406406+ * the next higher trip point407407+ */408408+ tz->trips.active[i - 1].temperature =409409+ (tz->trips.active[i - 2].temperature <410410+ CELSIUS_TO_KELVIN(act) ?411411+ tz->trips.active[i - 2].temperature :412412+ CELSIUS_TO_KELVIN(act));413413+ }417414 break;415415+ }418416419417 name[2] = 'L';420418 status =···473427474428static int acpi_thermal_critical(struct acpi_thermal *tz)475429{476476- if (!tz || !tz->trips.critical.flags.valid)430430+ if (!tz || !tz->trips.critical.flags.valid || nocrt)477431 return -EINVAL;478432479433 if (tz->temperature >= tz->trips.critical.temperature) {···495449496450static int acpi_thermal_hot(struct acpi_thermal *tz)497451{498498- if (!tz || !tz->trips.hot.flags.valid)452452+ if (!tz || !tz->trips.hot.flags.valid || nocrt)499453 return -EINVAL;500454501455 if (tz->temperature >= tz->trips.hot.temperature) {···870824 goto end;871825872826 if (tz->trips.critical.flags.valid)873873- seq_printf(seq, "critical (S5): %ld C\n",874874- KELVIN_TO_CELSIUS(tz->trips.critical.temperature));827827+ seq_printf(seq, "critical (S5): %ld C%s",828828+ KELVIN_TO_CELSIUS(tz->trips.critical.temperature),829829+ nocrt ? " <disabled>\n" : "\n");875830876831 if (tz->trips.hot.flags.valid)877877- seq_printf(seq, "hot (S4): %ld C\n",878878- KELVIN_TO_CELSIUS(tz->trips.hot.temperature));832832+ seq_printf(seq, "hot (S4): %ld C%s",833833+ KELVIN_TO_CELSIUS(tz->trips.hot.temperature),834834+ nocrt ? " <disabled>\n" : "\n");879835880836 if (tz->trips.passive.flags.valid) {881837 seq_printf(seq,···13291281 return AE_OK;13301282}1331128312841284+#ifdef CONFIG_DMI12851285+static int thermal_act(struct dmi_system_id *d) {12861286+12871287+ if (act == 0) {12881288+ printk(KERN_NOTICE "ACPI: %s detected: "12891289+ "disabling all active thermal trip points\n", d->ident);12901290+ act = -1;12911291+ }12921292+ return 0;12931293+}12941294+static int thermal_tzp(struct dmi_system_id *d) {12951295+12961296+ if (tzp == 0) {12971297+ printk(KERN_NOTICE "ACPI: %s detected: "12981298+ "enabling thermal zone polling\n", d->ident);12991299+ tzp = 300; /* 300 dS = 30 Seconds */13001300+ }13011301+ return 0;13021302+}13031303+static int thermal_psv(struct dmi_system_id *d) {13041304+13051305+ if (psv == 0) {13061306+ printk(KERN_NOTICE "ACPI: %s detected: "13071307+ "disabling all passive thermal trip points\n", d->ident);13081308+ psv = -1;13091309+ }13101310+ return 0;13111311+}13121312+13131313+static struct dmi_system_id thermal_dmi_table[] __initdata = {13141314+ /*13151315+ * Award BIOS on this AOpen makes thermal control almost worthless.13161316+ * http://bugzilla.kernel.org/show_bug.cgi?id=884213171317+ */13181318+ {13191319+ .callback = thermal_act,13201320+ .ident = "AOpen i915GMm-HFS",13211321+ .matches = {13221322+ DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),13231323+ DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),13241324+ },13251325+ },13261326+ {13271327+ .callback = thermal_psv,13281328+ .ident = "AOpen i915GMm-HFS",13291329+ .matches = {13301330+ DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),13311331+ DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),13321332+ },13331333+ },13341334+ {13351335+ .callback = thermal_tzp,13361336+ .ident = "AOpen i915GMm-HFS",13371337+ .matches = {13381338+ DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),13391339+ DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),13401340+ },13411341+ },13421342+ {}13431343+};13441344+#endif /* CONFIG_DMI */13451345+13321346static int __init acpi_thermal_init(void)13331347{13341348 int result = 0;1335134913501350+ dmi_check_system(thermal_dmi_table);1336135113521352+ if (off) {13531353+ printk(KERN_NOTICE "ACPI: thermal control disabled\n");13541354+ return -ENODEV;13551355+ }13371356 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);13381357 if (!acpi_thermal_dir)13391358 return -ENODEV;