All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	"H . Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, Eric Biederman <ebiederm@xmission.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	linux-acpi@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v4 1/2] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init()
Date: Tue, 20 Feb 2018 18:03:57 +0200	[thread overview]
Message-ID: <20180220160358.68832-1-andriy.shevchenko@linux.intel.com> (raw)

Some platforms might take care of legacy devices on theirs own. Due to this,
export acpi_reduced_hw_init() and put it into struct x86_init_acpi.

While doing this, rename acpi_reduced_hw_init() to
acpi_reduced_hw_early_init() to show the stage at which it's called.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

- re-done based on 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/acpi.h     |  4 ++++
 arch/x86/include/asm/x86_init.h |  2 ++
 arch/x86/kernel/acpi/boot.c     | 21 ++++++++++-----------
 arch/x86/kernel/x86_init.c      |  2 ++
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 6609dd7289b5..f3f86be35fc5 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -140,6 +140,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
 	return x86_init.acpi.get_root_pointer();
 }
 
+void acpi_reduced_hw_early_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_reduced_hw_early_init(void) { }
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT	1
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 5ffa116ddb08..199e15bd3ec5 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -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);
 };
 
 /**
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index d3deae23e584..02acf1c58d3a 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1378,17 +1378,15 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
-static void __init acpi_reduced_hw_init(void)
+void __init acpi_reduced_hw_early_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;
-	}
+	/*
+	 * 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;
 }
 
 /*
@@ -1593,7 +1591,8 @@ int __init early_acpi_boot_init(void)
 	/*
 	 * Hardware-reduced ACPI mode initialization:
 	 */
-	acpi_reduced_hw_init();
+	if (acpi_gbl_reduced_hardware)
+		x86_init.acpi.reduced_hw_early_init();
 
 	return 0;
 }
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 32c288ebf870..8fd63640e764 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -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_reduced_hw_early_init,
 	},
 };
 
-- 
2.15.1

             reply	other threads:[~2018-02-20 16:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 16:03 Andy Shevchenko [this message]
2018-02-20 16:03 ` [PATCH v4 2/2] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms Andy Shevchenko
2018-02-20 16:27 ` [PATCH v4 1/2] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Rafael J. Wysocki
2018-02-20 17:25   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180220160358.68832-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.