From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: dmi: initialize DMI earlier in boot
Date: Fri, 18 Sep 2015 15:31:24 +0100 [thread overview]
Message-ID: <20150918143124.GA31683@leverpostej> (raw)
In-Reply-To: <1442585666-14093-1-git-send-email-msalter@redhat.com>
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 <linux/io.h>
> #include <linux/slab.h>
> +#include <linux/memblock.h>
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 <linux/efi.h>
> #include <linux/personality.h>
> #include <linux/psci.h>
> +#include <linux/dmi.h>
>
> #include <asm/acpi.h>
> #include <asm/fixmap.h>
> @@ -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.
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Mark Salter <msalter@redhat.com>
Cc: Catalin Marinas <Catalin.Marinas@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
Matt Fleming <matt.fleming@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] arm64: dmi: initialize DMI earlier in boot
Date: Fri, 18 Sep 2015 15:31:24 +0100 [thread overview]
Message-ID: <20150918143124.GA31683@leverpostej> (raw)
In-Reply-To: <1442585666-14093-1-git-send-email-msalter@redhat.com>
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 <linux/io.h>
> #include <linux/slab.h>
> +#include <linux/memblock.h>
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 <linux/efi.h>
> #include <linux/personality.h>
> #include <linux/psci.h>
> +#include <linux/dmi.h>
>
> #include <asm/acpi.h>
> #include <asm/fixmap.h>
> @@ -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.
next prev parent reply other threads:[~2015-09-18 14:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 14:14 [PATCH] arm64: dmi: initialize DMI earlier in boot Mark Salter
2015-09-18 14:14 ` Mark Salter
2015-09-18 14:31 ` Mark Rutland [this message]
2015-09-18 14:31 ` Mark Rutland
2015-09-18 15:26 ` Mark Salter
2015-09-18 15:26 ` Mark Salter
2015-09-18 15:37 ` Will Deacon
2015-09-18 15:37 ` Will Deacon
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=20150918143124.GA31683@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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.