From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753660AbbIRObn (ORCPT ); Fri, 18 Sep 2015 10:31:43 -0400 Received: from foss.arm.com ([217.140.101.70]:46652 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752342AbbIRObm (ORCPT ); Fri, 18 Sep 2015 10:31:42 -0400 Date: Fri, 18 Sep 2015 15:31:24 +0100 From: Mark Rutland To: Mark Salter Cc: Catalin Marinas , Will Deacon , Matt Fleming , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Ard Biesheuvel Subject: Re: [PATCH] arm64: dmi: initialize DMI earlier in boot Message-ID: <20150918143124.GA31683@leverpostej> References: <1442585666-14093-1-git-send-email-msalter@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442585666-14093-1-git-send-email-msalter@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2015 at 03:14:26PM +0100, Mark Salter wrote: > Currently, DMI initialization takes place in a core initcall. This > limits how early in boot the kernel can make DMI-based decisions > about firmware/hardware quirks. This patch moves DMI initialization > to setup_arch() so that DMI info is available before initcalls run. Which firmware/hardware quirks in particular necessitate moving this? > > --- > arch/arm64/include/asm/dmi.h | 19 ++++++++++++++++--- > arch/arm64/kernel/efi.c | 15 --------------- > arch/arm64/kernel/setup.c | 5 +++++ > 3 files changed, 21 insertions(+), 18 deletions(-) > > diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h > index 69d37d8..e6389fd 100644 > --- a/arch/arm64/include/asm/dmi.h > +++ b/arch/arm64/include/asm/dmi.h > @@ -16,16 +16,29 @@ > > #include > #include > +#include Nit: please keep includes ordered (given they were already). [...] > @@ -413,20 +412,6 @@ static int __init arm64_enable_runtime_services(void) > } > early_initcall(arm64_enable_runtime_services); > > -static int __init arm64_dmi_init(void) > -{ > - /* > - * On arm64, DMI depends on UEFI, and dmi_scan_machine() needs to > - * be called early because dmi_id_init(), which is an arch_initcall > - * itself, depends on dmi_scan_machine() having been called already. > - */ > - dmi_scan_machine(); > - if (dmi_available) > - dmi_set_dump_stack_arch_desc(); > - return 0; > -} > -core_initcall(arm64_dmi_init); > - > static void efi_set_pgd(struct mm_struct *mm) > { > if (mm == &init_mm) > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c > index dc9eb5f..200c2e9 100644 > --- a/arch/arm64/kernel/setup.c > +++ b/arch/arm64/kernel/setup.c > @@ -46,6 +46,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -436,6 +437,10 @@ void __init setup_arch(char **cmdline_p) > relocate_initrd(); > request_standard_resources(); > > + dmi_scan_machine(); > + if (dmi_available) > + dmi_set_dump_stack_arch_desc(); We should have a comment as to why this needs to happen so early (much like we used to). Mark.