From 0fe0dbf8bbca6a7c3522c7f9d142479eac8cf211 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Fri, 4 Nov 2011 03:33:46 +0100 Subject: [PATCH] --- yaml --- r: 275027 b: refs/heads/master c: 362b646062b2073bd5c38efb42171d86e4f717e6 h: refs/heads/master i: 275025: 04d69c1a4d78e3da02d1b9010f210251d3897aad 275023: 773910f5fc16af31b58631092f429820dc467c00 v: v3 --- [refs] | 2 +- .../ABI/stable/sysfs-acpi-pmprofile | 22 +++++++++++++++++++ trunk/drivers/acpi/bus.c | 8 +++++-- trunk/drivers/acpi/scan.c | 3 ++- trunk/drivers/acpi/sysfs.c | 14 +++++++++++- trunk/drivers/thermal/thermal_sys.c | 4 ++-- trunk/include/acpi/acpi_drivers.h | 2 +- trunk/include/acpi/actypes.h | 1 + 8 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 trunk/Documentation/ABI/stable/sysfs-acpi-pmprofile diff --git a/[refs] b/[refs] index d8a58617aa7f..26729fc4121b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c1056b42a87b59375f8f81a92ef029165f44fcce +refs/heads/master: 362b646062b2073bd5c38efb42171d86e4f717e6 diff --git a/trunk/Documentation/ABI/stable/sysfs-acpi-pmprofile b/trunk/Documentation/ABI/stable/sysfs-acpi-pmprofile new file mode 100644 index 000000000000..964c7a8afb26 --- /dev/null +++ b/trunk/Documentation/ABI/stable/sysfs-acpi-pmprofile @@ -0,0 +1,22 @@ +What: /sys/firmware/acpi/pm_profile +Date: 03-Nov-2011 +KernelVersion: v3.2 +Contact: linux-acpi@vger.kernel.org +Description: The ACPI pm_profile sysfs interface exports the platform + power management (and performance) requirement expectations + as provided by BIOS. The integer value is directly passed as + retrieved from the FADT ACPI table. +Values: For possible values see ACPI specification: + 5.2.9 Fixed ACPI Description Table (FADT) + Field: Preferred_PM_Profile + + Currently these values are defined by spec: + 0 Unspecified + 1 Desktop + 2 Mobile + 3 Workstation + 4 Enterprise Server + 5 SOHO Server + 6 Appliance PC + 7 Performance Server + >7 Reserved diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index 9ecec98bc76e..437ddbf0c49a 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -911,7 +911,10 @@ void __init acpi_early_init(void) } #endif - status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE); + status = + acpi_enable_subsystem(~ + (ACPI_NO_HARDWARE_INIT | + ACPI_NO_ACPI_ENABLE)); if (ACPI_FAILURE(status)) { printk(KERN_ERR PREFIX "Unable to enable ACPI\n"); goto error0; @@ -932,7 +935,8 @@ static int __init acpi_bus_init(void) acpi_os_initialize1(); - status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE); + status = + acpi_enable_subsystem(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE); if (ACPI_FAILURE(status)) { printk(KERN_ERR PREFIX "Unable to start the ACPI Interpreter\n"); diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index 8ab80bafe3f1..449c556274c0 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -1062,12 +1062,13 @@ static void acpi_add_id(struct acpi_device *device, const char *dev_id) if (!id) return; - id->id = kstrdup(dev_id, GFP_KERNEL); + id->id = kmalloc(strlen(dev_id) + 1, GFP_KERNEL); if (!id->id) { kfree(id); return; } + strcpy(id->id, dev_id); list_add_tail(&id->list, &device->pnp.ids); } diff --git a/trunk/drivers/acpi/sysfs.c b/trunk/drivers/acpi/sysfs.c index c538d0ef10ff..9f66181c814e 100644 --- a/trunk/drivers/acpi/sysfs.c +++ b/trunk/drivers/acpi/sysfs.c @@ -706,11 +706,23 @@ static void __exit interrupt_stats_exit(void) return; } +static ssize_t +acpi_show_profile(struct device *dev, struct device_attribute *attr, + char *buf) +{ + return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile); +} + +static const struct device_attribute pm_profile_attr = + __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL); + int __init acpi_sysfs_init(void) { int result; result = acpi_tables_sysfs_init(); - + if (result) + return result; + result = sysfs_create_file(acpi_kobj, &pm_profile_attr.attr); return result; } diff --git a/trunk/drivers/thermal/thermal_sys.c b/trunk/drivers/thermal/thermal_sys.c index dd9a5743fa99..708f8e92771a 100644 --- a/trunk/drivers/thermal/thermal_sys.c +++ b/trunk/drivers/thermal/thermal_sys.c @@ -678,10 +678,10 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, return; if (delay > 1000) - queue_delayed_work(system_freezable_wq, &(tz->poll_queue), + schedule_delayed_work(&(tz->poll_queue), round_jiffies(msecs_to_jiffies(delay))); else - queue_delayed_work(system_freezable_wq, &(tz->poll_queue), + schedule_delayed_work(&(tz->poll_queue), msecs_to_jiffies(delay)); } diff --git a/trunk/include/acpi/acpi_drivers.h b/trunk/include/acpi/acpi_drivers.h index bb145e4b935e..e49c36d38d7e 100644 --- a/trunk/include/acpi/acpi_drivers.h +++ b/trunk/include/acpi/acpi_drivers.h @@ -144,7 +144,7 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) { } static inline int register_hotplug_dock_device(acpi_handle handle, - const struct acpi_dock_ops *ops, + struct acpi_dock_ops *ops, void *context) { return -ENODEV; diff --git a/trunk/include/acpi/actypes.h b/trunk/include/acpi/actypes.h index ed73f6705c86..b67231bef632 100644 --- a/trunk/include/acpi/actypes.h +++ b/trunk/include/acpi/actypes.h @@ -470,6 +470,7 @@ typedef u64 acpi_integer; */ #define ACPI_FULL_INITIALIZATION 0x00 #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 +#define ACPI_NO_HARDWARE_INIT 0x02 #define ACPI_NO_EVENT_INIT 0x04 #define ACPI_NO_HANDLER_INIT 0x08 #define ACPI_NO_ACPI_ENABLE 0x10