From patchwork Tue Feb 20 18:05:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10230635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12494602A7 for ; Tue, 20 Feb 2018 18:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0134628841 for ; Tue, 20 Feb 2018 18:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74CE28844; Tue, 20 Feb 2018 18:05:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A5128841 for ; Tue, 20 Feb 2018 18:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbeBTSFN (ORCPT ); Tue, 20 Feb 2018 13:05:13 -0500 Received: from mga14.intel.com ([192.55.52.115]:44586 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752317AbeBTSFM (ORCPT ); Tue, 20 Feb 2018 13:05:12 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2018 10:05:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,540,1511856000"; d="scan'208";a="19029059" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 20 Feb 2018 10:05:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C3DE0E4; Tue, 20 Feb 2018 20:05:07 +0200 (EET) 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 v5 2/3] ACPI / x86: boot: Not all platforms require acpi_generic_reduced_hw_init() Date: Tue, 20 Feb 2018 20:05:05 +0200 Message-Id: <20180220180506.65523-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180220180506.65523-1-andriy.shevchenko@linux.intel.com> References: <20180220180506.65523-1-andriy.shevchenko@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Rafael J. Wysocki --- - 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(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 2e2c34d2bb00..5bd45a8f5ae3 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 baa084ecffdb..7a37d9357bc4 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -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(); } /* diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 9e4e994a4836..03452b73e2ea 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_generic_reduced_hw_init, }, };