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.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
"Three of these are regression fixes, for two recent regressions and
one introduced during the 3.13 cycle, and the fourth one is a working
version of the fix that had to be reverted last time.

Specifics:

- A recent ACPI resources handling fix overlooked the fact that it
had to update the ACPI PNP subsystem's resources parsing too and
caused confusing warning messages to be printed during system
intialization on some systems (with arguably buggy ACPI tables).
Fix from Zhang Rui.

- Moving the early ACPI initialization before timekeeping_init()
earlier in this cycle broke fast TSC calibration on at least one
system, so it needs to be done later, but still before
efi_enter_virtual_mode() to allow the EFI initialization to refer
to ACPI.

- A change related to code duplication reduction in the cpufreq core
inadvertently caused cpufreq intialization to fail for some CPUs
handled by intel_pstate by adding checks that may fail for that
driver, but aren't even necessary when it is used. The issue is
addressed by preventing those checks from run in the configurations
in which they aren't needed.

- If the Hardware Reduced ACPI flag is set in the ACPI tables, system
suspend, hibernation and ACPI power off will only work when special
sleep control and sleep status registeres are provided (their
addresses in the ACPI tables are not zero). If those registers are
not available, the features in question have no chances to work, so
they shouldn't even be regarded as supported. That helps with
power off in particular, because alternative power off methods may
be used then and they may actually work"

* tag 'pm+acpi-3.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / sleep: Add extra checks for HW Reduced ACPI mode sleep states
ACPI / init: Invoke early ACPI initialization later
cpufreq: Skip current frequency initialization for ->setpolicy drivers
PNP / ACPI: proper handling of ACPI IO/Memory resource parsing failures

+30 -23
+15 -17
drivers/acpi/sleep.c
··· 71 71 return 0; 72 72 } 73 73 74 + static bool acpi_sleep_state_supported(u8 sleep_state) 75 + { 76 + acpi_status status; 77 + u8 type_a, type_b; 78 + 79 + status = acpi_get_sleep_type_data(sleep_state, &type_a, &type_b); 80 + return ACPI_SUCCESS(status) && (!acpi_gbl_reduced_hardware 81 + || (acpi_gbl_FADT.sleep_control.address 82 + && acpi_gbl_FADT.sleep_status.address)); 83 + } 84 + 74 85 #ifdef CONFIG_ACPI_SLEEP 75 86 static u32 acpi_target_sleep_state = ACPI_STATE_S0; 76 87 ··· 615 604 { 616 605 int i; 617 606 618 - for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) { 619 - acpi_status status; 620 - u8 type_a, type_b; 621 - 622 - status = acpi_get_sleep_type_data(i, &type_a, &type_b); 623 - if (ACPI_SUCCESS(status)) { 607 + for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) 608 + if (acpi_sleep_state_supported(i)) 624 609 sleep_states[i] = 1; 625 - } 626 - } 627 610 628 611 suspend_set_ops(old_suspend_ordering ? 629 612 &acpi_suspend_ops_old : &acpi_suspend_ops); ··· 745 740 746 741 static void acpi_sleep_hibernate_setup(void) 747 742 { 748 - acpi_status status; 749 - u8 type_a, type_b; 750 - 751 - status = acpi_get_sleep_type_data(ACPI_STATE_S4, &type_a, &type_b); 752 - if (ACPI_FAILURE(status)) 743 + if (!acpi_sleep_state_supported(ACPI_STATE_S4)) 753 744 return; 754 745 755 746 hibernation_set_ops(old_suspend_ordering ? ··· 794 793 795 794 int __init acpi_sleep_init(void) 796 795 { 797 - acpi_status status; 798 - u8 type_a, type_b; 799 796 char supported[ACPI_S_STATE_COUNT * 3 + 1]; 800 797 char *pos = supported; 801 798 int i; ··· 805 806 acpi_sleep_suspend_setup(); 806 807 acpi_sleep_hibernate_setup(); 807 808 808 - status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); 809 - if (ACPI_SUCCESS(status)) { 809 + if (acpi_sleep_state_supported(ACPI_STATE_S5)) { 810 810 sleep_states[ACPI_STATE_S5] = 1; 811 811 pm_power_off_prepare = acpi_power_off_prepare; 812 812 pm_power_off = acpi_power_off;
+2 -2
drivers/cpufreq/cpufreq.c
··· 1129 1129 per_cpu(cpufreq_cpu_data, j) = policy; 1130 1130 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 1131 1131 1132 - if (cpufreq_driver->get) { 1132 + if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { 1133 1133 policy->cur = cpufreq_driver->get(policy->cpu); 1134 1134 if (!policy->cur) { 1135 1135 pr_err("%s: ->get() failed\n", __func__); ··· 2143 2143 * BIOS might change freq behind our back 2144 2144 * -> ask driver for current freq and notify governors about a change 2145 2145 */ 2146 - if (cpufreq_driver->get) { 2146 + if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { 2147 2147 new_policy.cur = cpufreq_driver->get(cpu); 2148 2148 if (!policy->cur) { 2149 2149 pr_debug("Driver did not initialize current freq");
+12 -3
drivers/pnp/pnpacpi/rsparser.c
··· 183 183 struct resource r = {0}; 184 184 int i, flags; 185 185 186 - if (acpi_dev_resource_memory(res, &r) 187 - || acpi_dev_resource_io(res, &r) 188 - || acpi_dev_resource_address_space(res, &r) 186 + if (acpi_dev_resource_address_space(res, &r) 189 187 || acpi_dev_resource_ext_address_space(res, &r)) { 190 188 pnp_add_resource(dev, &r); 191 189 return AE_OK; ··· 215 217 } 216 218 217 219 switch (res->type) { 220 + case ACPI_RESOURCE_TYPE_MEMORY24: 221 + case ACPI_RESOURCE_TYPE_MEMORY32: 222 + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 223 + if (acpi_dev_resource_memory(res, &r)) 224 + pnp_add_resource(dev, &r); 225 + break; 226 + case ACPI_RESOURCE_TYPE_IO: 227 + case ACPI_RESOURCE_TYPE_FIXED_IO: 228 + if (acpi_dev_resource_io(res, &r)) 229 + pnp_add_resource(dev, &r); 230 + break; 218 231 case ACPI_RESOURCE_TYPE_DMA: 219 232 dma = &res->data.dma; 220 233 if (dma->channel_count > 0 && dma->channels[0] != (u8) -1)
+1 -1
init/main.c
··· 561 561 init_timers(); 562 562 hrtimers_init(); 563 563 softirq_init(); 564 - acpi_early_init(); 565 564 timekeeping_init(); 566 565 time_init(); 567 566 sched_clock_postinit(); ··· 612 613 calibrate_delay(); 613 614 pidmap_init(); 614 615 anon_vma_init(); 616 + acpi_early_init(); 615 617 #ifdef CONFIG_X86 616 618 if (efi_enabled(EFI_RUNTIME_SERVICES)) 617 619 efi_enter_virtual_mode();