ACPI, x86/boot: Introduce the ->reduced_hw_early_init() ACPI callback
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 20 Feb 2018 18:05:05 +0000 (20:05 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 12 Mar 2018 11:32:57 +0000 (12:32 +0100)
Some ACPI hardware reduced platforms need to initialize certain devices
defined by the ACPI hardware specification even though in principle
those devices should not be present in an ACPI hardware reduced platform.

To allow that to happen, make it possible to override the generic
x86_init callbacks and provide a custom legacy_pic value, add a new
->reduced_hw_early_init() callback to struct x86_init_acpi and make
acpi_reduced_hw_init() use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-acpi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180220180506.65523-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/x86_init.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/x86_init.c

index 2e2c34d2bb00740d120569b33413fa06f98f5800..5bd45a8f5ae3905b3a0c223228b870a13199a7e1 100644 (file)
@@ -133,9 +133,11 @@ struct x86_hyper_init {
 /**
  * struct x86_init_acpi - x86 ACPI init functions
  * @get_root_pointer:          get RSDP address
+ * @reduced_hw_early_init:     hardware reduced platform early init
  */
 struct x86_init_acpi {
        u64 (*get_root_pointer)(void);
+       void (*reduced_hw_early_init)(void);
 };
 
 /**
index baa084ecffdb34e1c03df5d13263170e665becc7..7a37d9357bc48a4f8224179c32f3c86da0e560eb 100644 (file)
@@ -1390,7 +1390,7 @@ void __init acpi_generic_reduced_hw_init(void)
 static void __init acpi_reduced_hw_init(void)
 {
        if (acpi_gbl_reduced_hardware)
-               acpi_generic_reduced_hw_init();
+               x86_init.acpi.reduced_hw_early_init();
 }
 
 /*
index b8cff22a8785fd5b507fe2a1c7764b9f7fc67998..ac67ccffeef0674389a920eea3c6eb72617a7663 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/export.h>
 #include <linux/pci.h>
 
+#include <asm/acpi.h>
 #include <asm/bios_ebda.h>
 #include <asm/paravirt.h>
 #include <asm/pci_x86.h>
@@ -95,6 +96,7 @@ struct x86_init_ops x86_init __initdata = {
 
        .acpi = {
                .get_root_pointer       = u64_x86_init_noop,
+               .reduced_hw_early_init  = acpi_generic_reduced_hw_init,
        },
 };