diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 04:58:34 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 04:58:34 -0400 |
| commit | 478c7cf7a8ff7ad587bd76f8ce9cfeede0df45fb (patch) | |
| tree | ba287759f6b1d66e804ccab8c038897c10b53d70 | |
| parent | 23de4a7af7bc3d687f783a612b8e824865b7e6ce (diff) | |
| parent | 658a0f4e661a6c07395de318a58f9058ba2faf8f (diff) | |
Merge tag 'pm+acpi-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes from Rafael Wysocki:
"Still fixing regressions (partly by reverting commits that broke
things for people), fixing other stable-candidate bugs and adding some
blacklist entries for ACPI video and _OSI.
Two ACPICA regression fixes (one recent and one for a 3.14 commit), a
fix for an ACPI-related regression in TPM (introduced in 3.14), a
revert of the ACPI AC driver conversion in 3.13 that went wrong for an
unknown reason, two reverts of commits that attempted to remove an old
user space interface in /proc and broke some utilities, in 3.13 too, a
fix for a CPU hotplug bug in the ACPI processor driver (stable
material), two (stable candidate) fixes for intel_pstate and a few new
blacklist entries, mostly for systems that shipped with Windows 8.
Specifics:
- ACPICA fix for a stale pointer access introduced by a recent commit
in the XSDT validation code from Lv Zheng.
- ACPICA fix for the default value of the command line switch to
favor 32-bit FADT addresses (in case there's a conflict between a
64-bit and a 32-bit address). The previous default was that the
32-bit version would take precedence and we tried to change it to
the other way around and it didn't work. From Lv Zheng.
- A TPM commit related to ACPI _DSM in 3.14 caused the driver to
refuse to load if a specific _DSM was missing and that broke resume
from system suspend on Chromebooks that require the TPM hardware to
be restored to a working state during resume by the OS. Restore
the old behavior to load the driver if the _DSM in question is not
present, but prevent it from using the feature the _DSM is for.
- ACPI AC driver conversion in 3.13 broke thermal management on at
least one machine and has to be reverted. From Guenter Roeck.
- Two reverts of 3.13 commits that attempted to remove the old ACPI
battery interface in /proc, but turned out to break some utilities
still using that interface. From Lan Tianyu.
- ACPI processor driver fix to prevent acpi_processor_add() from
modifying the CPU device's .offline field which leads to breakage
if the initial online of the CPU fails. From Igor Mammedov.
- Two intel_pstate fixes, one to take a BayTrail documentation update
into account and one to avoid forcing the maximum P-state on init
which causes CPU PM trouble on systems with P-states coordination
when one of the CPU cores is initialized after an offline/online
cycle triggered by user space. Both stable candidates, from Dirk
Brandewie.
- Fix for the ACPI video DMI blacklist entry for Dell Inspiron 7520
from Aaron Lu.
- Two new ACPI video blacklist entries for machines shipping with
Win8 that need to use native backlight so that it can be controlled
in a usual way (which doesn't work otherwise due bugs in the ACPI
tables) from Hans de Goede.
- Two ACPI _OSI quirks for systems that need them to work correctly
with Linux from Edward Lin and Hans de Goede"
* tag 'pm+acpi-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / video: Revert native brightness quirk for ThinkPad T530
intel_pstate: remove setting P state to MAX on init
ACPICA: Tables: Restore old behavor to favor 32-bit FADT addresses.
ACPI / video: correct DMI tag for Dell Inspiron 7520
intel_pstate: Set turbo VID for BayTrail
ACPI / TPM: Fix resume regression on Chromebooks
ACPI / proc: Do not say when /proc interfaces will be deleted in Kconfig
ACPI / processor: do not mark present at boot but not onlined CPU as onlined
ACPI: Revert "ACPI / AC: convert ACPI ac driver to platform bus"
ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX
ACPI: blacklist win8 OSI for Dell Inspiron 7737
ACPI / video: Add use_native_backlight quirks for more systems
ACPI: Revert "ACPI / Battery: Remove battery's proc directory"
ACPI: Revert "ACPI: Remove CONFIG_ACPI_PROCFS_POWER and cm_sbsc.c"
ACPICA: Tables: Fix invalid pointer accesses in acpi_tb_parse_root_table().
| -rw-r--r-- | drivers/acpi/Kconfig | 17 | ||||
| -rw-r--r-- | drivers/acpi/Makefile | 1 | ||||
| -rw-r--r-- | drivers/acpi/ac.c | 117 | ||||
| -rw-r--r-- | drivers/acpi/acpi_platform.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/acpi_processor.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/acpica/acglobal.h | 4 | ||||
| -rw-r--r-- | drivers/acpi/acpica/tbutils.c | 7 | ||||
| -rw-r--r-- | drivers/acpi/battery.c | 329 | ||||
| -rw-r--r-- | drivers/acpi/blacklist.c | 21 | ||||
| -rw-r--r-- | drivers/acpi/cm_sbs.c | 105 | ||||
| -rw-r--r-- | drivers/acpi/video.c | 16 | ||||
| -rw-r--r-- | drivers/char/tpm/tpm_ppi.c | 8 | ||||
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 34 |
13 files changed, 568 insertions, 93 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ab686b310100..a34a22841002 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -47,6 +47,23 @@ config ACPI_SLEEP | |||
| 47 | depends on SUSPEND || HIBERNATION | 47 | depends on SUSPEND || HIBERNATION |
| 48 | default y | 48 | default y |
| 49 | 49 | ||
| 50 | config ACPI_PROCFS_POWER | ||
| 51 | bool "Deprecated power /proc/acpi directories" | ||
| 52 | depends on PROC_FS | ||
| 53 | help | ||
| 54 | For backwards compatibility, this option allows | ||
| 55 | deprecated power /proc/acpi/ directories to exist, even when | ||
| 56 | they have been replaced by functions in /sys. | ||
| 57 | The deprecated directories (and their replacements) include: | ||
| 58 | /proc/acpi/battery/* (/sys/class/power_supply/*) | ||
| 59 | /proc/acpi/ac_adapter/* (sys/class/power_supply/*) | ||
| 60 | This option has no effect on /proc/acpi/ directories | ||
| 61 | and functions, which do not yet exist in /sys | ||
| 62 | This option, together with the proc directories, will be | ||
| 63 | deleted in the future. | ||
| 64 | |||
| 65 | Say N to delete power /proc/acpi/ directories that have moved to /sys/ | ||
| 66 | |||
| 50 | config ACPI_EC_DEBUGFS | 67 | config ACPI_EC_DEBUGFS |
| 51 | tristate "EC read/write access through /sys/kernel/debug/ec" | 68 | tristate "EC read/write access through /sys/kernel/debug/ec" |
| 52 | default n | 69 | default n |
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 0331f91d56e6..bce34afadcd0 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile | |||
| @@ -47,6 +47,7 @@ acpi-y += sysfs.o | |||
| 47 | acpi-$(CONFIG_X86) += acpi_cmos_rtc.o | 47 | acpi-$(CONFIG_X86) += acpi_cmos_rtc.o |
| 48 | acpi-$(CONFIG_DEBUG_FS) += debugfs.o | 48 | acpi-$(CONFIG_DEBUG_FS) += debugfs.o |
| 49 | acpi-$(CONFIG_ACPI_NUMA) += numa.o | 49 | acpi-$(CONFIG_ACPI_NUMA) += numa.o |
| 50 | acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o | ||
| 50 | ifdef CONFIG_ACPI_VIDEO | 51 | ifdef CONFIG_ACPI_VIDEO |
| 51 | acpi-y += video_detect.o | 52 | acpi-y += video_detect.o |
| 52 | endif | 53 | endif |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 2c01c1da29ce..c67f6f5ad611 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
| @@ -52,11 +52,39 @@ MODULE_AUTHOR("Paul Diefenbaugh"); | |||
| 52 | MODULE_DESCRIPTION("ACPI AC Adapter Driver"); | 52 | MODULE_DESCRIPTION("ACPI AC Adapter Driver"); |
| 53 | MODULE_LICENSE("GPL"); | 53 | MODULE_LICENSE("GPL"); |
| 54 | 54 | ||
| 55 | static int acpi_ac_add(struct acpi_device *device); | ||
| 56 | static int acpi_ac_remove(struct acpi_device *device); | ||
| 57 | static void acpi_ac_notify(struct acpi_device *device, u32 event); | ||
| 58 | |||
| 59 | static const struct acpi_device_id ac_device_ids[] = { | ||
| 60 | {"ACPI0003", 0}, | ||
| 61 | {"", 0}, | ||
| 62 | }; | ||
| 63 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); | ||
| 64 | |||
| 65 | #ifdef CONFIG_PM_SLEEP | ||
| 66 | static int acpi_ac_resume(struct device *dev); | ||
| 67 | #endif | ||
| 68 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); | ||
| 69 | |||
| 55 | static int ac_sleep_before_get_state_ms; | 70 | static int ac_sleep_before_get_state_ms; |
| 56 | 71 | ||
| 72 | static struct acpi_driver acpi_ac_driver = { | ||
| 73 | .name = "ac", | ||
| 74 | .class = ACPI_AC_CLASS, | ||
| 75 | .ids = ac_device_ids, | ||
| 76 | .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, | ||
| 77 | .ops = { | ||
| 78 | .add = acpi_ac_add, | ||
| 79 | .remove = acpi_ac_remove, | ||
| 80 | .notify = acpi_ac_notify, | ||
| 81 | }, | ||
| 82 | .drv.pm = &acpi_ac_pm, | ||
| 83 | }; | ||
| 84 | |||
| 57 | struct acpi_ac { | 85 | struct acpi_ac { |
| 58 | struct power_supply charger; | 86 | struct power_supply charger; |
| 59 | struct platform_device *pdev; | 87 | struct acpi_device * device; |
| 60 | unsigned long long state; | 88 | unsigned long long state; |
| 61 | struct notifier_block battery_nb; | 89 | struct notifier_block battery_nb; |
| 62 | }; | 90 | }; |
| @@ -69,10 +97,12 @@ struct acpi_ac { | |||
| 69 | 97 | ||
| 70 | static int acpi_ac_get_state(struct acpi_ac *ac) | 98 | static int acpi_ac_get_state(struct acpi_ac *ac) |
| 71 | { | 99 | { |
| 72 | acpi_status status; | 100 | acpi_status status = AE_OK; |
| 73 | acpi_handle handle = ACPI_HANDLE(&ac->pdev->dev); | 101 | |
| 102 | if (!ac) | ||
| 103 | return -EINVAL; | ||
| 74 | 104 | ||
| 75 | status = acpi_evaluate_integer(handle, "_PSR", NULL, | 105 | status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, |
| 76 | &ac->state); | 106 | &ac->state); |
| 77 | if (ACPI_FAILURE(status)) { | 107 | if (ACPI_FAILURE(status)) { |
| 78 | ACPI_EXCEPTION((AE_INFO, status, | 108 | ACPI_EXCEPTION((AE_INFO, status, |
| @@ -117,10 +147,9 @@ static enum power_supply_property ac_props[] = { | |||
| 117 | Driver Model | 147 | Driver Model |
| 118 | -------------------------------------------------------------------------- */ | 148 | -------------------------------------------------------------------------- */ |
| 119 | 149 | ||
| 120 | static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data) | 150 | static void acpi_ac_notify(struct acpi_device *device, u32 event) |
| 121 | { | 151 | { |
| 122 | struct acpi_ac *ac = data; | 152 | struct acpi_ac *ac = acpi_driver_data(device); |
| 123 | struct acpi_device *adev; | ||
| 124 | 153 | ||
| 125 | if (!ac) | 154 | if (!ac) |
| 126 | return; | 155 | return; |
| @@ -143,11 +172,10 @@ static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data) | |||
| 143 | msleep(ac_sleep_before_get_state_ms); | 172 | msleep(ac_sleep_before_get_state_ms); |
| 144 | 173 | ||
| 145 | acpi_ac_get_state(ac); | 174 | acpi_ac_get_state(ac); |
| 146 | adev = ACPI_COMPANION(&ac->pdev->dev); | 175 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
| 147 | acpi_bus_generate_netlink_event(adev->pnp.device_class, | 176 | dev_name(&device->dev), event, |
| 148 | dev_name(&ac->pdev->dev), | 177 | (u32) ac->state); |
| 149 | event, (u32) ac->state); | 178 | acpi_notifier_call_chain(device, event, (u32) ac->state); |
| 150 | acpi_notifier_call_chain(adev, event, (u32) ac->state); | ||
| 151 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); | 179 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
| 152 | } | 180 | } |
| 153 | 181 | ||
| @@ -192,49 +220,39 @@ static struct dmi_system_id ac_dmi_table[] = { | |||
| 192 | {}, | 220 | {}, |
| 193 | }; | 221 | }; |
| 194 | 222 | ||
| 195 | static int acpi_ac_probe(struct platform_device *pdev) | 223 | static int acpi_ac_add(struct acpi_device *device) |
| 196 | { | 224 | { |
| 197 | int result = 0; | 225 | int result = 0; |
| 198 | struct acpi_ac *ac = NULL; | 226 | struct acpi_ac *ac = NULL; |
| 199 | struct acpi_device *adev; | ||
| 200 | 227 | ||
| 201 | if (!pdev) | ||
| 202 | return -EINVAL; | ||
| 203 | 228 | ||
| 204 | adev = ACPI_COMPANION(&pdev->dev); | 229 | if (!device) |
| 205 | if (!adev) | 230 | return -EINVAL; |
| 206 | return -ENODEV; | ||
| 207 | 231 | ||
| 208 | ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL); | 232 | ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL); |
| 209 | if (!ac) | 233 | if (!ac) |
