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

Pull ACPI fixes from Rafael Wysocki:
"These fix an ACPI tables management issue, an issue related to the
ACPI enumeration of devices and CPU wakeup in the ACPI processor
driver.

Specifics:

- Ensure that the memory occupied by ACPI tables on x86 will always
be reserved to prevent it from being allocated for other purposes
which was possible in some cases (Rafael Wysocki).

- Fix the ACPI device enumeration code to prevent it from attempting
to evaluate the _STA control method for devices with unmet
dependencies which is likely to fail (Hans de Goede).

- Fix the handling of CPU0 wakeup in the ACPI processor driver to
prevent CPU0 online failures from occurring (Vitaly Kuznetsov)"

* tag 'acpi-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()
ACPI: scan: Fix _STA getting called on devices with unmet dependencies
ACPI: tables: x86: Reserve memory occupied by ACPI tables

+82 -24
+1
arch/x86/include/asm/smp.h
··· 132 132 void play_dead_common(void); 133 133 void wbinvd_on_cpu(int cpu); 134 134 int wbinvd_on_all_cpus(void); 135 + bool wakeup_cpu0(void); 135 136 136 137 void native_smp_send_reschedule(int cpu); 137 138 void native_send_call_func_ipi(const struct cpumask *mask);
+12 -13
arch/x86/kernel/acpi/boot.c
··· 1554 1554 /* 1555 1555 * Initialize the ACPI boot-time table parser. 1556 1556 */ 1557 - if (acpi_table_init()) { 1557 + if (acpi_locate_initial_tables()) 1558 1558 disable_acpi(); 1559 - return; 1560 - } 1559 + else 1560 + acpi_reserve_initial_tables(); 1561 + } 1562 + 1563 + int __init early_acpi_boot_init(void) 1564 + { 1565 + if (acpi_disabled) 1566 + return 1; 1567 + 1568 + acpi_table_init_complete(); 1561 1569 1562 1570 acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); 1563 1571 ··· 1578 1570 } else { 1579 1571 printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); 1580 1572 disable_acpi(); 1581 - return; 1573 + return 1; 1582 1574 } 1583 1575 } 1584 - } 1585 - 1586 - int __init early_acpi_boot_init(void) 1587 - { 1588 - /* 1589 - * If acpi_disabled, bail out 1590 - */ 1591 - if (acpi_disabled) 1592 - return 1; 1593 1576 1594 1577 /* 1595 1578 * Process the Multiple APIC Description Table (MADT), if present
+3 -5
arch/x86/kernel/setup.c
··· 1045 1045 1046 1046 cleanup_highmap(); 1047 1047 1048 + /* Look for ACPI tables and reserve memory occupied by them. */ 1049 + acpi_boot_table_init(); 1050 + 1048 1051 memblock_set_current_limit(ISA_END_ADDRESS); 1049 1052 e820__memblock_setup(); 1050 1053 ··· 1138 1135 io_delay_init(); 1139 1136 1140 1137 early_platform_quirks(); 1141 - 1142 - /* 1143 - * Parse the ACPI tables for possible boot-time SMP configuration. 1144 - */ 1145 - acpi_boot_table_init(); 1146 1138 1147 1139 early_acpi_boot_init(); 1148 1140
+1 -1
arch/x86/kernel/smpboot.c
··· 1659 1659 local_irq_disable(); 1660 1660 } 1661 1661 1662 - static bool wakeup_cpu0(void) 1662 + bool wakeup_cpu0(void) 1663 1663 { 1664 1664 if (smp_processor_id() == 0 && enable_start_cpu0) 1665 1665 return true;
+7
drivers/acpi/processor_idle.c
··· 29 29 */ 30 30 #ifdef CONFIG_X86 31 31 #include <asm/apic.h> 32 + #include <asm/cpu.h> 32 33 #endif 33 34 34 35 #define _COMPONENT ACPI_PROCESSOR_COMPONENT ··· 542 541 wait_for_freeze(); 543 542 } else 544 543 return -ENODEV; 544 + 545 + #if defined(CONFIG_X86) && defined(CONFIG_HOTPLUG_CPU) 546 + /* If NMI wants to wake up CPU0, start CPU0. */ 547 + if (wakeup_cpu0()) 548 + start_cpu0(); 549 + #endif 545 550 } 546 551 547 552 /* Never reached */
+11 -1
drivers/acpi/scan.c
··· 1670 1670 device_initialize(&device->dev); 1671 1671 dev_set_uevent_suppress(&device->dev, true); 1672 1672 acpi_init_coherency(device); 1673 + /* Assume there are unmet deps to start with. */ 1674 + device->dep_unmet = 1; 1673 1675 } 1674 1676 1675 1677 void acpi_device_add_finalize(struct acpi_device *device) ··· 1935 1933 { 1936 1934 struct acpi_dep_data *dep; 1937 1935 1936 + adev->dep_unmet = 0; 1937 + 1938 1938 mutex_lock(&acpi_dep_list_lock); 1939 1939 1940 1940 list_for_each_entry(dep, &acpi_dep_list, node) { ··· 1984 1980 return AE_CTRL_DEPTH; 1985 1981 1986 1982 acpi_scan_init_hotplug(device); 1987 - if (!check_dep) 1983 + /* 1984 + * If check_dep is true at this point, the device has no dependencies, 1985 + * or the creation of the device object would have been postponed above. 1986 + */ 1987 + if (check_dep) 1988 + device->dep_unmet = 0; 1989 + else 1988 1990 acpi_scan_dep_init(device); 1989 1991 1990 1992 out:
+39 -3
drivers/acpi/tables.c
··· 780 780 } 781 781 782 782 /* 783 - * acpi_table_init() 783 + * acpi_locate_initial_tables() 784 784 * 785 785 * find RSDP, find and checksum SDT/XSDT. 786 786 * checksum all tables, print SDT/XSDT ··· 788 788 * result: sdt_entry[] is initialized 789 789 */ 790 790 791 - int __init acpi_table_init(void) 791 + int __init acpi_locate_initial_tables(void) 792 792 { 793 793 acpi_status status; 794 794 ··· 803 803 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); 804 804 if (ACPI_FAILURE(status)) 805 805 return -EINVAL; 806 - acpi_table_initrd_scan(); 807 806 807 + return 0; 808 + } 809 + 810 + void __init acpi_reserve_initial_tables(void) 811 + { 812 + int i; 813 + 814 + for (i = 0; i < ACPI_MAX_TABLES; i++) { 815 + struct acpi_table_desc *table_desc = &initial_tables[i]; 816 + u64 start = table_desc->address; 817 + u64 size = table_desc->length; 818 + 819 + if (!start || !size) 820 + break; 821 + 822 + pr_info("Reserving %4s table memory at [mem 0x%llx-0x%llx]\n", 823 + table_desc->signature.ascii, start, start + size - 1); 824 + 825 + memblock_reserve(start, size); 826 + } 827 + } 828 + 829 + void __init acpi_table_init_complete(void) 830 + { 831 + acpi_table_initrd_scan(); 808 832 check_multiple_madt(); 833 + } 834 + 835 + int __init acpi_table_init(void) 836 + { 837 + int ret; 838 + 839 + ret = acpi_locate_initial_tables(); 840 + if (ret) 841 + return ret; 842 + 843 + acpi_table_init_complete(); 844 + 809 845 return 0; 810 846 } 811 847
+8 -1
include/linux/acpi.h
··· 222 222 void __acpi_unmap_table(void __iomem *map, unsigned long size); 223 223 int early_acpi_boot_init(void); 224 224 int acpi_boot_init (void); 225 + void acpi_boot_table_prepare (void); 225 226 void acpi_boot_table_init (void); 226 227 int acpi_mps_check (void); 227 228 int acpi_numa_init (void); 228 229 230 + int acpi_locate_initial_tables (void); 231 + void acpi_reserve_initial_tables (void); 232 + void acpi_table_init_complete (void); 229 233 int acpi_table_init (void); 230 234 int acpi_table_parse(char *id, acpi_tbl_table_handler handler); 231 235 int __init acpi_table_parse_entries(char *id, unsigned long table_size, ··· 818 814 return 0; 819 815 } 820 816 817 + static inline void acpi_boot_table_prepare(void) 818 + { 819 + } 820 + 821 821 static inline void acpi_boot_table_init(void) 822 822 { 823 - return; 824 823 } 825 824 826 825 static inline int acpi_mps_check(void)