From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752820AbeBTQEG (ORCPT ); Tue, 20 Feb 2018 11:04:06 -0500 Received: from mga18.intel.com ([134.134.136.126]:7632 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbeBTQEE (ORCPT ); Tue, 20 Feb 2018 11:04:04 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,540,1511856000"; d="scan'208";a="19474387" From: Andy Shevchenko To: Thomas Gleixner , "H . Peter Anvin" , Ingo Molnar , x86@kernel.org, Eric Biederman , "Rafael J . Wysocki" , linux-acpi@vger.kernel.org, Juergen Gross , linux-kernel@vger.kernel.org Cc: Andy Shevchenko 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 Message-Id: <20180220160358.68832-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- - 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 #include +#include #include #include #include @@ -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