Commit 0a84c2e4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 9314a0e9 91463ebf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ void native_play_dead(void);
void play_dead_common(void);
void wbinvd_on_cpu(int cpu);
int wbinvd_on_all_cpus(void);
bool wakeup_cpu0(void);

void native_smp_send_reschedule(int cpu);
void native_send_call_func_ipi(const struct cpumask *mask);
+12 −13
Original line number Diff line number Diff line
@@ -1554,11 +1554,19 @@ void __init acpi_boot_table_init(void)
	/*
	 * Initialize the ACPI boot-time table parser.
	 */
	if (acpi_table_init()) {
	if (acpi_locate_initial_tables())
		disable_acpi();
		return;
	else
		acpi_reserve_initial_tables();
}

int __init early_acpi_boot_init(void)
{
	if (acpi_disabled)
		return 1;

	acpi_table_init_complete();

	acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);

	/*
@@ -1570,19 +1578,10 @@ void __init acpi_boot_table_init(void)
		} else {
			printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
			disable_acpi();
			return;
		}
			return 1;
		}
	}

int __init early_acpi_boot_init(void)
{
	/*
	 * If acpi_disabled, bail out
	 */
	if (acpi_disabled)
		return 1;

	/*
	 * Process the Multiple APIC Description Table (MADT), if present
	 */
+3 −5
Original line number Diff line number Diff line
@@ -1045,6 +1045,9 @@ void __init setup_arch(char **cmdline_p)

	cleanup_highmap();

	/* Look for ACPI tables and reserve memory occupied by them. */
	acpi_boot_table_init();

	memblock_set_current_limit(ISA_END_ADDRESS);
	e820__memblock_setup();

@@ -1136,11 +1139,6 @@ void __init setup_arch(char **cmdline_p)

	early_platform_quirks();

	/*
	 * Parse the ACPI tables for possible boot-time SMP configuration.
	 */
	acpi_boot_table_init();

	early_acpi_boot_init();

	initmem_init();
+1 −1
Original line number Diff line number Diff line
@@ -1659,7 +1659,7 @@ void play_dead_common(void)
	local_irq_disable();
}

static bool wakeup_cpu0(void)
bool wakeup_cpu0(void)
{
	if (smp_processor_id() == 0 && enable_start_cpu0)
		return true;
+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
 */
#ifdef CONFIG_X86
#include <asm/apic.h>
#include <asm/cpu.h>
#endif

#define _COMPONENT              ACPI_PROCESSOR_COMPONENT
@@ -541,6 +542,12 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
			wait_for_freeze();
		} else
			return -ENODEV;

#if defined(CONFIG_X86) && defined(CONFIG_HOTPLUG_CPU)
		/* If NMI wants to wake up CPU0, start CPU0. */
		if (wakeup_cpu0())
			start_cpu0();
#endif
	}

	/* Never reached */
Loading