Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm+acpi-3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
"These are regression fixes (ACPI sysfs, ACPI video, suspend test),
ACPI cpuidle deadlock fix, missing runtime validation of ACPI _DSD
output, a fix and a new CPU ID for the RAPL driver, new blacklist
entry for the ACPI EC driver and a couple of trivial cleanups
(intel_pstate and generic PM domains).

Specifics:

- Fix for recently broken test_suspend= command line argument (Rafael
Wysocki).

- Fixes for regressions related to the ACPI video driver caused by
switching the default to native backlight handling in 3.16 from
Hans de Goede.

- Fix for a sysfs attribute of ACPI device objects that returns stale
values sometimes due to the fact that they are cached instead of
executing the appropriate method (_SUN) every time (broken in
3.14). From Yasuaki Ishimatsu.

- Fix for a deadlock between cpuidle_lock and cpu_hotplug.lock in the
ACPI processor driver from Jiri Kosina.

- Runtime output validation for the ACPI _DSD device configuration
object missing from the support for it that has been introduced
recently. From Mika Westerberg.

- Fix for an unuseful and misleading RAPL (Running Average Power
Limit) domain detection message in the RAPL driver from Jacob Pan.

- New Intel Haswell CPU ID for the RAPL driver from Jason Baron.

- New Clevo W350etq blacklist entry for the ACPI EC driver from Lan
Tianyu.

- Cleanup for the intel_pstate driver and the core generic PM domains
code from Gabriele Mazzotta and Geert Uytterhoeven"

* tag 'pm+acpi-3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / cpuidle: fix deadlock between cpuidle_lock and cpu_hotplug.lock
ACPI / scan: not cache _SUN value in struct acpi_device_pnp
cpufreq: intel_pstate: Remove unneeded variable
powercap / RAPL: change domain detection message
powercap / RAPL: add support for CPU model 0x3f
PM / domains: Make generic_pm_domain.name const
PM / sleep: Fix test_suspend= command line option
ACPI / EC: Add msi quirk for Clevo W350etq
ACPI / video: Disable native_backlight on HP ENVY 15 Notebook PC
ACPI / video: Add a disable_native_backlight quirk
ACPI / video: Fix use_native_backlight selection logic
ACPICA: ACPI 5.1: Add support for runtime validation of _DSD package.

+122 -34
+39
drivers/acpi/acpica/nsprepkg.c
··· 316 316 acpi_ns_check_package_list(info, package, elements, count); 317 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 358 default: 320 359 321 360 /* Should not get here if predefined info table is correct */
+4
drivers/acpi/ec.c
··· 1030 1030 DMI_MATCH(DMI_SYS_VENDOR, "Quanta"), 1031 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 1037 ec_validate_ecdt, "ASUS hardware", { 1034 1038 DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, 1035 1039 {
+2 -2
drivers/acpi/processor_idle.c
··· 1071 1071 1072 1072 if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) { 1073 1073 1074 - cpuidle_pause_and_lock(); 1075 1074 /* Protect against cpu-hotplug */ 1076 1075 get_online_cpus(); 1076 + cpuidle_pause_and_lock(); 1077 1077 1078 1078 /* Disable all cpuidle devices */ 1079 1079 for_each_online_cpu(cpu) { ··· 1100 1100 cpuidle_enable_device(dev); 1101 1101 } 1102 1102 } 1103 - put_online_cpus(); 1104 1103 cpuidle_resume_and_unlock(); 1104 + put_online_cpus(); 1105 1105 } 1106 1106 1107 1107 return 0;
+8 -7
drivers/acpi/scan.c
··· 667 667 acpi_device_sun_show(struct device *dev, struct device_attribute *attr, 668 668 char *buf) { 669 669 struct acpi_device *acpi_dev = to_acpi_device(dev); 670 + acpi_status status; 671 + unsigned long long sun; 670 672 671 - return sprintf(buf, "%lu\n", acpi_dev->pnp.sun); 673 + status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun); 674 + if (ACPI_FAILURE(status)) 675 + return -ENODEV; 676 + 677 + return sprintf(buf, "%llu\n", sun); 672 678 } 673 679 static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL); 674 680 ··· 696 690 { 697 691 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 698 692 acpi_status status; 699 - unsigned long long sun; 700 693 int result = 0; 701 694 702 695 /* ··· 736 731 if (dev->pnp.unique_id) 737 732 result = device_create_file(&dev->dev, &dev_attr_uid); 738 733 739 - status = acpi_evaluate_integer(dev->handle, "_SUN", NULL, &sun); 740 - if (ACPI_SUCCESS(status)) { 741 - dev->pnp.sun = (unsigned long)sun; 734 + if (acpi_has_method(dev->handle, "_SUN")) { 742 735 result = device_create_file(&dev->dev, &dev_attr_sun); 743 736 if (result) 744 737 goto end; 745 - } else { 746 - dev->pnp.sun = (unsigned long)-1; 747 738 } 748 739 749 740 if (acpi_has_method(dev->handle, "_STA")) {
+43 -2
drivers/acpi/video.c
··· 82 82 * For Windows 8 systems: used to decide if video module 83 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 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 89 static int register_count; 90 90 static struct mutex video_list_lock; ··· 417 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 426 static struct dmi_system_id video_dmi_table[] __initdata = { 421 427 /* 422 428 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 ··· 724 718 .matches = { 725 719 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 726 720 DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), 721 + }, 722 + }, 723 + 724 + /* 725 + * These models have a working acpi_video backlight control, and using 726 + * native backlight causes a regression where backlight does not work 727 + * when userspace is not handling brightness key events. Disable 728 + * native_backlight on these to fix this: 729 + * https://bugzilla.kernel.org/show_bug.cgi?id=81691 730 + */ 731 + { 732 + .callback = video_disable_native_backlight, 733 + .ident = "ThinkPad T420", 734 + .matches = { 735 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 736 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T420"), 737 + }, 738 + }, 739 + { 740 + .callback = video_disable_native_backlight, 741 + .ident = "ThinkPad T520", 742 + .matches = { 743 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 744 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T520"), 745 + }, 746 + }, 747 + 748 + /* The native backlight controls do not work on some older machines */ 749 + { 750 + /* https://bugs.freedesktop.org/show_bug.cgi?id=81515 */ 751 + .callback = video_disable_native_backlight, 752 + .ident = "HP ENVY 15 Notebook", 753 + .matches = { 754 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 755 + DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY 15 Notebook PC"), 727 756 }, 728 757 }, 729 758 {}
-4
drivers/cpufreq/intel_pstate.c
··· 708 708 709 709 static int intel_pstate_set_policy(struct cpufreq_policy *policy) 710 710 { 711 - struct cpudata *cpu; 712 - 713 - cpu = all_cpu_data[policy->cpu]; 714 - 715 711 if (!policy->cpuinfo.max_freq) 716 712 return -ENODEV; 717 713
+4 -4
drivers/powercap/intel_rapl.c
··· 953 953 { X86_VENDOR_INTEL, 6, 0x3a},/* Ivy Bridge */ 954 954 { X86_VENDOR_INTEL, 6, 0x3c},/* Haswell */ 955 955 { X86_VENDOR_INTEL, 6, 0x3d},/* Broadwell */ 956 + { X86_VENDOR_INTEL, 6, 0x3f},/* Haswell */ 956 957 { X86_VENDOR_INTEL, 6, 0x45},/* Haswell ULT */ 957 958 /* TODO: Add more CPU IDs after testing */ 958 959 {} ··· 1167 1166 1168 1167 for (i = 0; i < RAPL_DOMAIN_MAX; i++) { 1169 1168 /* use physical package id to read counters */ 1170 - if (!rapl_check_domain(cpu, i)) 1169 + if (!rapl_check_domain(cpu, i)) { 1171 1170 rp->domain_map |= 1 << i; 1172 - else 1173 - pr_warn("RAPL domain %s detection failed\n", 1174 - rapl_domain_names[i]); 1171 + pr_info("Found RAPL domain %s\n", rapl_domain_names[i]); 1172 + } 1175 1173 } 1176 1174 rp->nr_domains = bitmap_weight(&rp->domain_map, RAPL_DOMAIN_MAX); 1177 1175 if (!rp->nr_domains) {
-1
include/acpi/acpi_bus.h
··· 246 246 acpi_device_name device_name; /* Driver-determined */ 247 247 acpi_device_class device_class; /* " */ 248 248 union acpi_object *str_obj; /* unicode string for _STR method */ 249 - unsigned long sun; /* _SUN */ 250 249 }; 251 250 252 251 #define acpi_device_bid(d) ((d)->pnp.bus_id)
+1 -1
include/linux/pm_domain.h
··· 60 60 struct mutex lock; 61 61 struct dev_power_governor *gov; 62 62 struct work_struct power_off_work; 63 - char *name; 63 + const char *name; 64 64 unsigned int in_progress; /* Number of devices being suspended now */ 65 65 atomic_t sd_count; /* Number of subdomains with power "on" */ 66 66 enum gpd_status status; /* Current state of the domain */
+1
kernel/power/power.h
··· 179 179 180 180 #ifdef CONFIG_SUSPEND 181 181 /* kernel/power/suspend.c */ 182 + extern const char *pm_labels[]; 182 183 extern const char *pm_states[]; 183 184 184 185 extern int suspend_devices_and_enter(suspend_state_t state);
+1 -1
kernel/power/suspend.c
··· 31 31 32 32 #include "power.h" 33 33 34 - static const char *pm_labels[] = { "mem", "standby", "freeze", }; 34 + const char *pm_labels[] = { "mem", "standby", "freeze", NULL }; 35 35 const char *pm_states[PM_SUSPEND_MAX]; 36 36 37 37 static const struct platform_suspend_ops *suspend_ops;
+19 -12
kernel/power/suspend_test.c
··· 129 129 * at startup time. They're normally disabled, for faster boot and because 130 130 * we can't know which states really work on this particular system. 131 131 */ 132 - static suspend_state_t test_state __initdata = PM_SUSPEND_ON; 132 + static const char *test_state_label __initdata; 133 133 134 134 static char warn_bad_state[] __initdata = 135 135 KERN_WARNING "PM: can't test '%s' suspend state\n"; 136 136 137 137 static int __init setup_test_suspend(char *value) 138 138 { 139 - suspend_state_t i; 139 + int i; 140 140 141 141 /* "=mem" ==> "mem" */ 142 142 value++; 143 - for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++) 144 - if (!strcmp(pm_states[i], value)) { 145 - test_state = i; 143 + for (i = 0; pm_labels[i]; i++) 144 + if (!strcmp(pm_labels[i], value)) { 145 + test_state_label = pm_labels[i]; 146 146 return 0; 147 147 } 148 148 ··· 158 158 159 159 struct rtc_device *rtc = NULL; 160 160 struct device *dev; 161 + suspend_state_t test_state; 161 162 162 163 /* PM is initialized by now; is that state testable? */ 163 - if (test_state == PM_SUSPEND_ON) 164 - goto done; 165 - if (!pm_states[test_state]) { 166 - printk(warn_bad_state, pm_states[test_state]); 167 - goto done; 164 + if (!test_state_label) 165 + return 0; 166 + 167 + for (test_state = PM_SUSPEND_MIN; test_state < PM_SUSPEND_MAX; test_state++) { 168 + const char *state_label = pm_states[test_state]; 169 + 170 + if (state_label && !strcmp(test_state_label, state_label)) 171 + break; 172 + } 173 + if (test_state == PM_SUSPEND_MAX) { 174 + printk(warn_bad_state, test_state_label); 175 + return 0; 168 176 } 169 177 170 178 /* RTCs have initialized by now too ... can we use one? */ ··· 181 173 rtc = rtc_class_open(dev_name(dev)); 182 174 if (!rtc) { 183 175 printk(warn_no_rtc); 184 - goto done; 176 + return 0; 185 177 } 186 178 187 179 /* go for it */ 188 180 test_wakealarm(rtc, test_state); 189 181 rtc_class_close(rtc); 190 - done: 191 182 return 0; 192 183 } 193 184 late_initcall(test_suspend);