diff options
author | Jens Axboe <axboe@fb.com> | 2014-09-22 13:57:32 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-22 13:57:32 -0400 |
commit | 6d11fb454b161a4565c57be6f1c5527235741003 (patch) | |
tree | c238ed3df2f654181c2a0746478a33b32214cc60 /drivers/acpi | |
parent | b207892b061da7608878e273ae22ba9bf9be264b (diff) | |
parent | 8b95741569eabc5eb17da71d1d3668cdb0bef86c (diff) |
Merge branch 'for-linus' into for-3.18/core
Moving patches from for-linus to 3.18 instead, pull in this changes
that will go to Linus today.
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_cmos_rtc.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 10 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsprepkg.c | 39 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 14 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 4 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 4 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 15 | ||||
-rw-r--r-- | drivers/acpi/video.c | 45 |
8 files changed, 102 insertions, 31 deletions
diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c index 2da8660262e5..81dc75033f15 100644 --- a/drivers/acpi/acpi_cmos_rtc.c +++ b/drivers/acpi/acpi_cmos_rtc.c | |||
@@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address, | |||
33 | void *handler_context, void *region_context) | 33 | void *handler_context, void *region_context) |
34 | { | 34 | { |
35 | int i; | 35 | int i; |
36 | u8 *value = (u8 *)&value64; | 36 | u8 *value = (u8 *)value64; |
37 | 37 | ||
38 | if (address > 0xff || !value64) | 38 | if (address > 0xff || !value64) |
39 | return AE_BAD_PARAMETER; | 39 | return AE_BAD_PARAMETER; |
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 9dfec48dd4e5..fddc1e86f9d0 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -610,7 +610,7 @@ static int acpi_lpss_suspend_late(struct device *dev) | |||
610 | return acpi_dev_suspend_late(dev); | 610 | return acpi_dev_suspend_late(dev); |
611 | } | 611 | } |
612 | 612 | ||
613 | static int acpi_lpss_restore_early(struct device *dev) | 613 | static int acpi_lpss_resume_early(struct device *dev) |
614 | { | 614 | { |
615 | int ret = acpi_dev_resume_early(dev); | 615 | int ret = acpi_dev_resume_early(dev); |
616 | 616 | ||
@@ -650,15 +650,15 @@ static int acpi_lpss_runtime_resume(struct device *dev) | |||
650 | static struct dev_pm_domain acpi_lpss_pm_domain = { | 650 | static struct dev_pm_domain acpi_lpss_pm_domain = { |
651 | .ops = { | 651 | .ops = { |
652 | #ifdef CONFIG_PM_SLEEP | 652 | #ifdef CONFIG_PM_SLEEP |
653 | .suspend_late = acpi_lpss_suspend_late, | ||
654 | .restore_early = acpi_lpss_restore_early, | ||
655 | .prepare = acpi_subsys_prepare, | 653 | .prepare = acpi_subsys_prepare, |
656 | .complete = acpi_subsys_complete, | 654 | .complete = acpi_subsys_complete, |
657 | .suspend = acpi_subsys_suspend, | 655 | .suspend = acpi_subsys_suspend, |
658 | .resume_early = acpi_subsys_resume_early, | 656 | .suspend_late = acpi_lpss_suspend_late, |
657 | .resume_early = acpi_lpss_resume_early, | ||
659 | .freeze = acpi_subsys_freeze, | 658 | .freeze = acpi_subsys_freeze, |
660 | .poweroff = acpi_subsys_suspend, | 659 | .poweroff = acpi_subsys_suspend, |
661 | .poweroff_late = acpi_subsys_suspend_late, | 660 | .poweroff_late = acpi_lpss_suspend_late, |
661 | .restore_early = acpi_lpss_resume_early, | ||
662 | #endif | 662 | #endif |
663 | #ifdef CONFIG_PM_RUNTIME | 663 | #ifdef CONFIG_PM_RUNTIME |
664 | .runtime_suspend = acpi_lpss_runtime_suspend, | 664 | .runtime_suspend = acpi_lpss_runtime_suspend, |
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c index 68f725839eb6..1b13b921dda9 100644 --- a/drivers/acpi/acpica/nsprepkg.c +++ b/drivers/acpi/acpica/nsprepkg.c | |||
@@ -316,6 +316,45 @@ acpi_ns_check_package(struct acpi_evaluate_info *info, | |||
316 | acpi_ns_check_package_list(info, package, elements, count); | 316 | acpi_ns_check_package_list(info, package, elements, count); |
317 | break; | 317 | break; |
318 | 318 | ||
319 | case ACPI_PTYPE2_UUID_PAIR: | ||
320 | |||
321 | /* The package must contain pairs of (UUID + type) */ | ||
322 | |||
323 | if (count & 1) { | ||
324 | expected_count = count + 1; | ||
325 | goto package_too_small; | ||
326 | } | ||
327 | |||
328 | while (count > 0) { | ||
329 | status = acpi_ns_check_object_type(info, elements, | ||
330 | package->ret_info. | ||
331 | object_type1, 0); | ||
332 | if (ACPI_FAILURE(status)) { | ||
333 | return (status); | ||
334 | } | ||
335 | |||
336 | /* Validate length of the UUID buffer */ | ||
337 | |||
338 | if ((*elements)->buffer.length != 16) { | ||
339 | ACPI_WARN_PREDEFINED((AE_INFO, | ||
340 | info->full_pathname, | ||
341 | info->node_flags, | ||
342 | "Invalid length for UUID Buffer")); | ||
343 | return (AE_AML_OPERAND_VALUE); | ||
344 | } | ||
345 | |||
346 | status = acpi_ns_check_object_type(info, elements + 1, | ||
347 | package->ret_info. | ||
348 | object_type2, 0); | ||
349 | if (ACPI_FAILURE(status)) { | ||
350 | return (status); | ||
351 | } | ||
352 | |||
353 | elements += 2; | ||
354 | count -= 2; | ||
355 | } | ||
356 | break; | ||
357 | |||
319 | default: | 358 | default: |
320 | 359 | ||
321 | /* Should not get here if predefined info table is correct */ | 360 | /* Should not get here if predefined info table is correct */ |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1c162e7be045..5fdfe65fe165 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -534,20 +534,6 @@ static int acpi_battery_get_state(struct acpi_battery *battery) | |||
534 | " invalid.\n"); | 534 | " invalid.\n"); |
535 | } | 535 | } |
536 | 536 | ||
537 | /* | ||
538 | * When fully charged, some batteries wrongly report | ||
539 | * capacity_now = design_capacity instead of = full_charge_capacity | ||
540 | */ | ||
541 | if (battery->capacity_now > battery->full_charge_capacity | ||
542 | && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) { | ||
543 | if (battery->capacity_now != battery->design_capacity) | ||
544 | printk_once(KERN_WARNING FW_BUG | ||
545 | "battery: reported current charge level (%d) " | ||
546 | "is higher than reported maximum charge level (%d).\n", | ||
547 | battery->capacity_now, battery->full_charge_capacity); | ||
548 | battery->capacity_now = battery->full_charge_capacity; | ||
549 | } | ||
550 | |||
551 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) | 537 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) |
552 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) | 538 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) |
553 | battery->capacity_now = (battery->capacity_now * | 539 | battery->capacity_now = (battery->capacity_now * |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 9922cc46b15c..cb6066c809ea 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1030,6 +1030,10 @@ static struct dmi_system_id ec_dmi_table[] __initdata = { | |||
1030 | DMI_MATCH(DMI_SYS_VENDOR, "Quanta"), | 1030 | DMI_MATCH(DMI_SYS_VENDOR, "Quanta"), |
1031 | DMI_MATCH(DMI_PRODUCT_NAME, "TW9/SW9"),}, NULL}, | 1031 | DMI_MATCH(DMI_PRODUCT_NAME, "TW9/SW9"),}, NULL}, |
1032 | { | 1032 | { |
1033 | ec_flag_msi, "Clevo W350etq", { | ||
1034 | DMI_MATCH(DMI_SYS_VENDOR, "CLEVO CO."), | ||
1035 | DMI_MATCH(DMI_PRODUCT_NAME, "W35_37ET"),}, NULL}, | ||
1036 | { | ||
1033 | ec_validate_ecdt, "ASUS hardware", { | 1037 | ec_validate_ecdt, "ASUS hardware", { |
1034 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, | 1038 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, |
1035 | { | 1039 | { |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3dca36d4ad26..17f9ec501972 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1071,9 +1071,9 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1071 | 1071 | ||
1072 | if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) { | 1072 | if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) { |
1073 | 1073 | ||
1074 | cpuidle_pause_and_lock(); | ||
1075 | /* Protect against cpu-hotplug */ | 1074 | /* Protect against cpu-hotplug */ |
1076 | get_online_cpus(); | 1075 | get_online_cpus(); |
1076 | cpuidle_pause_and_lock(); | ||
1077 | 1077 | ||
1078 | /* Disable all cpuidle devices */ | 1078 | /* Disable all cpuidle devices */ |
1079 | for_each_online_cpu(cpu) { | 1079 | for_each_online_cpu(cpu) { |
@@ -1100,8 +1100,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1100 | cpuidle_enable_device(dev); | 1100 | cpuidle_enable_device(dev); |
1101 | } | 1101 | } |
1102 | } | 1102 | } |
1103 | put_online_cpus(); | ||
1104 | cpuidle_resume_and_unlock(); | 1103 | cpuidle_resume_and_unlock(); |
1104 | put_online_cpus(); | ||
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | return 0; | 1107 | return 0; |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 9a9298994e26..3bf7764659a4 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -667,8 +667,14 @@ static ssize_t | |||
667 | acpi_device_sun_show(struct device *dev, struct device_attribute *attr, | 667 | acpi_device_sun_show(struct device *dev, struct device_attribute *attr, |
668 | char *buf) { | 668 | char *buf) { |
669 | struct acpi_device *acpi_dev = to_acpi_device(dev); | 669 | struct acpi_device *acpi_dev = to_acpi_device(dev); |
670 | acpi_status status; | ||
671 | unsigned long long sun; | ||
672 | |||
673 | status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun); | ||
674 | if (ACPI_FAILURE(status)) | ||
675 | return -ENODEV; | ||
670 | 676 | ||
671 | return sprintf(buf, "%lu\n", acpi_dev->pnp.sun); | 677 | return sprintf(buf, "%llu\n", sun); |
672 | } | 678 | } |
673 | static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL); | 679 | static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL); |
674 | 680 | ||
@@ -690,7 +696,6 @@ static int acpi_device_setup_files(struct acpi_device *dev) | |||
690 | { | 696 | { |
691 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; | 697 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; |
692 | acpi_status status; | 698 | acpi_status status; |
693 | unsigned long long sun; | ||
694 | int result = 0; | 699 | int result = 0; |
695 | 700 | ||
696 | /* | 701 | /* |
@@ -731,14 +736,10 @@ static int acpi_device_setup_files(struct acpi_device *dev) | |||
731 | if (dev->pnp.unique_id) | 736 | if (dev->pnp.unique_id) |
732 | result = device_create_file(&dev->dev, &dev_attr_uid); | 737 | result = device_create_file(&dev->dev, &dev_attr_uid); |
733 | 738 | ||
734 | status = acpi_evaluate_integer(dev->handle, "_SUN", NULL, &sun); | 739 | if (acpi_has_method(dev->handle, "_SUN")) { |
735 | if (ACPI_SUCCESS(status)) { | ||
736 | dev->pnp.sun = (unsigned long)sun; | ||
737 | result = device_create_file(&dev->dev, &dev_attr_sun); | 740 | result = device_create_file(&dev->dev, &dev_attr_sun); |
738 | if (result) | 741 | if (result) |
739 | goto end; | 742 | goto end; |
740 | } else { | ||
741 | dev->pnp.sun = (unsigned long)-1; | ||
742 | } | 743 | } |
743 | 744 | ||
744 | if (acpi_has_method(dev->handle, "_STA")) { | 745 | if (acpi_has_method(dev->handle, "_STA")) { |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 826884392e6b..fcbda105616e 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -82,9 +82,9 @@ module_param(allow_duplicates, bool, 0644); | |||
82 | * For Windows 8 systems: used to decide if video module | 82 | * For Windows 8 systems: used to decide if video module |
83 | * should skip registering backlight interface of its own. | 83 | * should skip registering backlight interface of its own. |
84 | */ | 84 | */ |
85 | static int use_native_backlight_param = 1; | 85 | static int use_native_backlight_param = -1; |
86 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); | 86 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); |
87 | static bool use_native_backlight_dmi = false; | 87 | static bool use_native_backlight_dmi = true; |
88 | 88 | ||
89 | static int register_count; | 89 | static int register_count; |
90 | static struct mutex video_list_lock; | 90 | static struct mutex video_list_lock; |
@@ -417,6 +417,12 @@ static int __init video_set_use_native_backlight(const struct dmi_system_id *d) | |||
417 | return 0; | 417 | return 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | static int __init video_disable_native_backlight(const struct dmi_system_id *d) | ||
421 | { | ||
422 | use_native_backlight_dmi = false; | ||
423 | return 0; | ||
424 | } | ||
425 | |||
420 | static struct dmi_system_id video_dmi_table[] __initdata = { | 426 | static struct dmi_system_id video_dmi_table[] __initdata = { |
421 | /* | 427 | /* |
422 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 | 428 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 |
@@ -720,6 +726,41 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
720 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | 726 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), |
721 | }, | 727 | }, |
722 | }, | 728 | }, |
729 | |||
730 | /* | ||
731 | * These models have a working acpi_video backlight control, and using | ||
732 | * native backlight causes a regression where backlight does not work | ||
733 | * when userspace is not handling brightness key events. Disable | ||
734 | * native_backlight on these to fix this: | ||
735 | * https://bugzilla.kernel.org/show_bug.cgi?id=81691 | ||
736 | */ | ||
737 | { | ||
738 | .callback = video_disable_native_backlight, | ||
739 | .ident = "ThinkPad T420", | ||
740 | .matches = { | ||
741 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
742 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T420"), | ||
743 | }, | ||
744 | }, | ||
745 | { | ||
746 | .callback = video_disable_native_backlight, | ||
747 | .ident = "ThinkPad T520", | ||
748 | .matches = { | ||
749 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
750 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T520"), | ||
751 | }, | ||
752 | }, | ||
753 | |||
754 | /* The native backlight controls do not work on some older machines */ | ||
755 | { | ||
756 | /* https://bugs.freedesktop.org/show_bug.cgi?id=81515 */ | ||
757 | .callback = video_disable_native_backlight, | ||
758 | .ident = "HP ENVY 15 Notebook", | ||
759 | .matches = { | ||
760 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
761 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY 15 Notebook PC"), | ||
762 | }, | ||
763 | }, | ||
723 | {} | 764 | {} |
724 | }; | 765 | }; |
725 | 766 | ||