|
@@ -40,6 +40,7 @@
|
|
#include <linux/jiffies.h>
|
|
#include <linux/jiffies.h>
|
|
#include <linux/kmod.h>
|
|
#include <linux/kmod.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/seq_file.h>
|
|
|
|
+#include <linux/reboot.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
|
|
|
|
#include <acpi/acpi_bus.h>
|
|
#include <acpi/acpi_bus.h>
|
|
@@ -59,7 +60,6 @@
|
|
#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0
|
|
#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0
|
|
#define ACPI_THERMAL_NOTIFY_HOT 0xF1
|
|
#define ACPI_THERMAL_NOTIFY_HOT 0xF1
|
|
#define ACPI_THERMAL_MODE_ACTIVE 0x00
|
|
#define ACPI_THERMAL_MODE_ACTIVE 0x00
|
|
-#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff"
|
|
|
|
|
|
|
|
#define ACPI_THERMAL_MAX_ACTIVE 10
|
|
#define ACPI_THERMAL_MAX_ACTIVE 10
|
|
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
|
|
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
|
|
@@ -419,26 +419,6 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int acpi_thermal_call_usermode(char *path)
|
|
|
|
-{
|
|
|
|
- char *argv[2] = { NULL, NULL };
|
|
|
|
- char *envp[3] = { NULL, NULL, NULL };
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (!path)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
- argv[0] = path;
|
|
|
|
-
|
|
|
|
- /* minimal command environment */
|
|
|
|
- envp[0] = "HOME=/";
|
|
|
|
- envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
|
|
|
|
-
|
|
|
|
- call_usermodehelper(argv[0], argv, envp, 0);
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int acpi_thermal_critical(struct acpi_thermal *tz)
|
|
static int acpi_thermal_critical(struct acpi_thermal *tz)
|
|
{
|
|
{
|
|
if (!tz || !tz->trips.critical.flags.valid)
|
|
if (!tz || !tz->trips.critical.flags.valid)
|
|
@@ -456,7 +436,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
|
|
acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
|
|
acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
|
|
tz->trips.critical.flags.enabled);
|
|
tz->trips.critical.flags.enabled);
|
|
|
|
|
|
- acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
|
|
|
|
|
|
+ orderly_poweroff(true);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|