Skip to contentSkip to conversation

ACPI / x86: boot: Split out acpi_generic_reduce_hw_init() and export

PATCH In review Andy Shevchenko 4 participants 15 messages Feb 20, 2018 – Mar 12, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/3 ACPI / x86: boot: Split out acpi_generic_reduce_hw_init() and export

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

---
 arch/x86/include/asm/acpi.h |  4 ++++
 arch/x86/kernel/acpi/boot.c | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
arch/x86/include/asm/acpi.h +4 -0
index 6609dd7289b5..a303d7b7d763 100644
@@ -140,6 +140,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
 	return x86_init.acpi.get_root_pointer();
 }
 
+void acpi_generic_reduced_hw_init(void);
+
 #else /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
@@ -149,6 +151,8 @@ static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
 static inline void disable_acpi(void) { }
 
+static inline void acpi_generic_reduced_hw_init(void) { }
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT	1
arch/x86/kernel/acpi/boot.c +13 -9
index 2aa92094b59d..baa084ecffdb 100644
@@ -1376,17 +1376,21 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
+void __init acpi_generic_reduced_hw_init(void)
+{
+	/*
+	 * Override x86_init functions and bypass legacy PIC in
+	 * hardware reduced ACPI mode.
+	 */
+	x86_init.timers.timer_init	= x86_init_noop;
+	x86_init.irqs.pre_vector_init	= x86_init_noop;
+	legacy_pic			= &null_legacy_pic;
+}
+
 static void __init acpi_reduced_hw_init(void)
 {
-	if (acpi_gbl_reduced_hardware) {
-		/*
-		 * Override x86_init functions and bypass legacy pic
-		 * in Hardware-reduced ACPI mode
-		 */
-		x86_init.timers.timer_init	= x86_init_noop;
-		x86_init.irqs.pre_vector_init	= x86_init_noop;
-		legacy_pic			= &null_legacy_pic;
-	}
+	if (acpi_gbl_reduced_hardware)
+		acpi_generic_reduced_hw_init();
 }
 
 /*
Signature · 1 line
2.15.1
#1 lore raw

PATCH v5 2/3 ACPI / x86: boot: Not all platforms require acpi_generic_reduced_hw_init()

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.

---

- address Rafael's comments
- requires patches from Juergen Gross
- supposed to go via tip tree (x86/boot branch)
- tested on ASuS T100ta (HW reduced) and Intel Broxton based platforms

 arch/x86/include/asm/x86_init.h | 2 ++
 arch/x86/kernel/acpi/boot.c     | 2 +-
 arch/x86/kernel/x86_init.c      | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/x86_init.h +2 -0
index 2e2c34d2bb00..5bd45a8f5ae3 100644
@@ -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);
 };
 
 /**
arch/x86/kernel/acpi/boot.c +1 -1
index baa084ecffdb..7a37d9357bc4 100644
@@ -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();
 }
 
 /*
arch/x86/kernel/x86_init.c +2 -0
index 9e4e994a4836..03452b73e2ea 100644
@@ -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,
 	},
 };
 
Signature · 1 line
2.15.1
maintainer Reviewed-by on v5 2/3
#2 lore raw

Re: [PATCH v5 2/3] ACPI / x86: boot: Not all platforms require acpi_generic_reduced_hw_init()

Quoted 10 lines · Andy Shevchenko

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.

Quoted 68 lines

---

- address Rafael's comments
- requires patches from Juergen Gross
- supposed to go via tip tree (x86/boot branch)
- tested on ASuS T100ta (HW reduced) and Intel Broxton based platforms

 arch/x86/include/asm/x86_init.h | 2 ++
 arch/x86/kernel/acpi/boot.c     | 2 +-
 arch/x86/kernel/x86_init.c      | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/x86_init.h +2 -0
index 2e2c34d2bb00..5bd45a8f5ae3 100644
@@ -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);
 };
 
 /**
arch/x86/kernel/acpi/boot.c +1 -1
index baa084ecffdb..7a37d9357bc4 100644
@@ -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();
 }
 
 /*
arch/x86/kernel/x86_init.c +2 -1
index 9e4e994a4836..03452b73e2ea 100644
@@ -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,
        },
 };
 
--

2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

[tip:x86/mm] ACPI, x86/boot: Introduce the ->reduced_hw_early_init() ACPI callback

In reply to Andy Shevchenko
ACPI, x86/boot: Introduce the ->reduced_hw_early_init() ACPI callback
Commit-ID:  81b53e5ff21e09b42525cfa08f2b0af2b8c5f465
Gitweb:     https://git.kernel.org/tip/81b53e5ff21e09b42525cfa08f2b0af2b8c5f465
Author:     Andy Shevchenko <[email protected]>
AuthorDate: Tue, 20 Feb 2018 20:05:05 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 12 Mar 2018 12:32:57 +0100

ACPI, x86/boot: Introduce the ->reduced_hw_early_init() ACPI callback

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.

---
 arch/x86/include/asm/x86_init.h | 2 ++
 arch/x86/kernel/acpi/boot.c     | 2 +-
 arch/x86/kernel/x86_init.c      | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/x86_init.h +2 -0
index 2e2c34d2bb00..5bd45a8f5ae3 100644
@@ -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);
 };
 
 /**
arch/x86/kernel/acpi/boot.c +1 -1
index baa084ecffdb..7a37d9357bc4 100644
@@ -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();
 }
 
 /*
arch/x86/kernel/x86_init.c +2 -0
index b8cff22a8785..ac67ccffeef0 100644
@@ -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,
 	},
 };
 
#4 lore raw

PATCH v5 3/3 x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms

In reply to Andy Shevchenko

When switching to ACPI HW reduced platforms we still want to initialize timers. Override x86_init.acpi.reduced_hw_init to achieve that.

---
 arch/x86/platform/intel-mid/intel-mid.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/platform/intel-mid/intel-mid.c +6 -0
index 2c67bae6bb53..c556f1e8936e 100644
@@ -199,6 +199,12 @@ void __init x86_intel_mid_early_setup(void)
 
 	legacy_pic = &null_legacy_pic;
 
+	/*
+	 * Do nothing for now as everything needed done in
+	 * x86_intel_mid_early_setup() below.
+	 */
+	x86_init.acpi.reduced_hw_early_init = x86_init_noop;
+
 	pm_power_off = intel_mid_power_off;
 	machine_ops.emergency_restart  = intel_mid_reboot;
 
Signature · 1 line
2.15.1
maintainer Reviewed-by on v5 3/3
#5 lore raw

Re: [PATCH v5 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms

Quoted 4 lines · Andy Shevchenko

When switching to ACPI HW reduced platforms we still want to initialize timers. Override x86_init.acpi.reduced_hw_init to achieve that.

Quoted 28 lines
---
 arch/x86/platform/intel-mid/intel-mid.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/platform/intel-mid/intel-mid.c +6 -1
index 2c67bae6bb53..c556f1e8936e 100644
@@ -199,6 +199,12 @@ void __init x86_intel_mid_early_setup(void)
 
        legacy_pic = &null_legacy_pic;
 
+       /*
+        * Do nothing for now as everything needed done in
+        * x86_intel_mid_early_setup() below.
+        */
+       x86_init.acpi.reduced_hw_early_init = x86_init_noop;
+
        pm_power_off = intel_mid_power_off;
        machine_ops.emergency_restart  = intel_mid_reboot;
 
--

2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

[tip:x86/mm] x86/platform/intel-mid: Add special handling for ACPI HW reduced platforms

In reply to Andy Shevchenko
x86/platform/intel-mid: Add special handling for ACPI HW reduced platforms
Commit-ID:  02428742639bc3300c8c527b054d0ec0bdf5571d
Gitweb:     https://git.kernel.org/tip/02428742639bc3300c8c527b054d0ec0bdf5571d
Author:     Andy Shevchenko <[email protected]>
AuthorDate: Tue, 20 Feb 2018 20:05:06 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 12 Mar 2018 12:32:57 +0100

x86/platform/intel-mid: Add special handling for ACPI HW reduced platforms

When switching to ACPI HW reduced platforms we still want to initialize timers. Override x86_init.acpi.reduced_hw_init to achieve that.

---
 arch/x86/platform/intel-mid/intel-mid.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/platform/intel-mid/intel-mid.c +6 -0
index 2c67bae6bb53..c556f1e8936e 100644
@@ -199,6 +199,12 @@ void __init x86_intel_mid_early_setup(void)
 
 	legacy_pic = &null_legacy_pic;
 
+	/*
+	 * Do nothing for now as everything needed done in
+	 * x86_intel_mid_early_setup() below.
+	 */
+	x86_init.acpi.reduced_hw_early_init = x86_init_noop;
+
 	pm_power_off = intel_mid_power_off;
 	machine_ops.emergency_restart  = intel_mid_reboot;
 
maintainer Reviewed-by on v5 1/3
#7 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Quoted 69 lines
---
 arch/x86/include/asm/acpi.h |  4 ++++
 arch/x86/kernel/acpi/boot.c | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
arch/x86/include/asm/acpi.h +4 -0
index 6609dd7289b5..a303d7b7d763 100644
@@ -140,6 +140,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
        return x86_init.acpi.get_root_pointer();
 }
 
+void acpi_generic_reduced_hw_init(void);
+
 #else /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
@@ -149,6 +151,8 @@ static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
 static inline void disable_acpi(void) { }
 
+static inline void acpi_generic_reduced_hw_init(void) { }
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT    1
arch/x86/kernel/acpi/boot.c +13 -10
index 2aa92094b59d..baa084ecffdb 100644
@@ -1376,17 +1376,21 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
+void __init acpi_generic_reduced_hw_init(void)
+{
+       /*
+        * Override x86_init functions and bypass legacy PIC in
+        * hardware reduced ACPI mode.
+        */
+       x86_init.timers.timer_init      = x86_init_noop;
+       x86_init.irqs.pre_vector_init   = x86_init_noop;
+       legacy_pic                      = &null_legacy_pic;
+}
+
 static void __init acpi_reduced_hw_init(void)
 {
-       if (acpi_gbl_reduced_hardware) {
-               /*
-                * Override x86_init functions and bypass legacy pic
-                * in Hardware-reduced ACPI mode
-                */
-               x86_init.timers.timer_init      = x86_init_noop;
-               x86_init.irqs.pre_vector_init   = x86_init_noop;
-               legacy_pic                      = &null_legacy_pic;
-       }
+       if (acpi_gbl_reduced_hardware)
+               acpi_generic_reduced_hw_init();
 }
 
 /*
--

2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Thanks, Rafael!

Ingo, can it be applied?

Quoted 75 lines
Quoted 75 lines
---
 arch/x86/include/asm/acpi.h |  4 ++++
 arch/x86/kernel/acpi/boot.c | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
arch/x86/include/asm/acpi.h +2 -0
index 6609dd7289b5..a303d7b7d763 100644
@@ -140,6 +140,8 @@ static inline u64
 acpi_arch_get_root_pointer(void)
        return x86_init.acpi.get_root_pointer();
 }
 
+void acpi_generic_reduced_hw_init(void);
+
 #else /* !CONFIG_ACPI */
 

#define acpi_lapic 0

arch/x86/include/asm/acpi.h +2 -0
@@ -149,6 +151,8 @@ static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
 static inline void disable_acpi(void) { }
 
+static inline void acpi_generic_reduced_hw_init(void) { }
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT    1
arch/x86/kernel/acpi/boot.c +13 -9
index 2aa92094b59d..baa084ecffdb 100644
@@ -1376,17 +1376,21 @@ static int __init
 dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
+void __init acpi_generic_reduced_hw_init(void)
+{
+       /*
+        * Override x86_init functions and bypass legacy PIC in
+        * hardware reduced ACPI mode.
+        */
+       x86_init.timers.timer_init      = x86_init_noop;
+       x86_init.irqs.pre_vector_init   = x86_init_noop;
+       legacy_pic                      = &null_legacy_pic;
+}
+
 static void __init acpi_reduced_hw_init(void)
 {
-       if (acpi_gbl_reduced_hardware) {
-               /*
-                * Override x86_init functions and bypass legacy pic
-                * in Hardware-reduced ACPI mode
-                */
-               x86_init.timers.timer_init      = x86_init_noop;
-               x86_init.irqs.pre_vector_init   = x86_init_noop;
-               legacy_pic                      = &null_legacy_pic;
-       }
+       if (acpi_gbl_reduced_hardware)
+               acpi_generic_reduced_hw_init();
 }
 

/*
--
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux- acpi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#9 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Rafael J. Wysocki
Quoted 5 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Thanks, Rafael!

Ingo, can it be applied?

Hmm... It seems Ingo is busy with something else.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
Acked-by
#10 lore raw
Quoted 11 lines · Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Thanks, Rafael!

Ingo, can it be applied?

Hmm... It seems Ingo is busy with something else.

Sorry, it all looks good to me:

Thanks,

Ingo

#11 lore raw
Quoted 18 lines · Ingo Molnar
Quoted 15 lines · Andy Shevchenko
Quoted 14 lines · Andy Shevchenko
Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Thanks, Rafael!

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Ingo, can it be applied?

Hmm... It seems Ingo is busy with something else.

Sorry, it all looks good to me:

It depends on some material in -tip AFAICS, so can you apply it, please?

#12 lore raw
Quoted 21 lines · Rafael J. Wysocki
Quoted 20 lines · Ingo Molnar
Quoted 17 lines · Andy Shevchenko
Quoted 15 lines · Andy Shevchenko
Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Thanks, Rafael!

Ingo, can it be applied?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Hmm... It seems Ingo is busy with something else.

Sorry, it all looks good to me:

It depends on some material in -tip AFAICS, so can you apply it, please?

Sure, done!

Once they have passed testing it will live in tip:x86/mm, that's where the dependent x86/boot commits ended up in this development cycle.

Thanks,

Ingo

#13 lore raw
Quoted 28 lines · Ingo Molnar
Quoted 25 lines · Rafael J. Wysocki
Quoted 24 lines · Ingo Molnar
Quoted 11 lines · Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Thanks, Rafael!

Ingo, can it be applied?

Hmm... It seems Ingo is busy with something else.

Sorry, it all looks good to me:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

It depends on some material in -tip AFAICS, so can you apply it, please?

Sure, done!

Once they have passed testing it will live in tip:x86/mm, that's where the dependent x86/boot commits ended up in this development cycle.

Thanks!

#14 lore raw

[tip:x86/mm] ACPI, x86/boot: Split out acpi_generic_reduce_hw_init() and export

In reply to Andy Shevchenko
ACPI, x86/boot: Split out acpi_generic_reduce_hw_init() and export
Commit-ID:  50beba07a0e42ebd4454adc97515a2a2a969645b
Gitweb:     https://git.kernel.org/tip/50beba07a0e42ebd4454adc97515a2a2a969645b
Author:     Andy Shevchenko <[email protected]>
AuthorDate: Tue, 20 Feb 2018 20:05:04 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 12 Mar 2018 12:32:57 +0100

ACPI, x86/boot: Split out acpi_generic_reduce_hw_init() and export

This is a preparation patch to allow override the hardware reduced initialization on ACPI enabled platforms.

No functional change intended.

---
 arch/x86/include/asm/acpi.h |  4 ++++
 arch/x86/kernel/acpi/boot.c | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
arch/x86/include/asm/acpi.h +4 -0
index 6609dd7289b5..a303d7b7d763 100644
@@ -140,6 +140,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
 	return x86_init.acpi.get_root_pointer();
 }
 
+void acpi_generic_reduced_hw_init(void);
+
 #else /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
@@ -149,6 +151,8 @@ static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
 static inline void disable_acpi(void) { }
 
+static inline void acpi_generic_reduced_hw_init(void) { }
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT	1
arch/x86/kernel/acpi/boot.c +13 -9
index 2aa92094b59d..baa084ecffdb 100644
@@ -1376,17 +1376,21 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
+void __init acpi_generic_reduced_hw_init(void)
+{
+	/*
+	 * Override x86_init functions and bypass legacy PIC in
+	 * hardware reduced ACPI mode.
+	 */
+	x86_init.timers.timer_init	= x86_init_noop;
+	x86_init.irqs.pre_vector_init	= x86_init_noop;
+	legacy_pic			= &null_legacy_pic;
+}
+
 static void __init acpi_reduced_hw_init(void)
 {
-	if (acpi_gbl_reduced_hardware) {
-		/*
-		 * Override x86_init functions and bypass legacy pic
-		 * in Hardware-reduced ACPI mode
-		 */
-		x86_init.timers.timer_init	= x86_init_noop;
-		x86_init.irqs.pre_vector_init	= x86_init_noop;
-		legacy_pic			= &null_legacy_pic;
-	}
+	if (acpi_gbl_reduced_hardware)
+		acpi_generic_reduced_hw_init();
 }
 
 /*