linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: Print DT machine model in setup_machine_fdt()
@ 2017-04-27 12:33 Geert Uytterhoeven
  2017-04-28 14:57 ` Will Deacon
  2017-04-28 16:14 ` Catalin Marinas
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-04-27 12:33 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Kevin Hilman, Mark Brown, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, Geert Uytterhoeven

On arm32, the machine model specified in the device tree is printed
during boot-up, courtesy of of_flat_dt_match_machine().

On arm64, of_flat_dt_match_machine() is not called, and the machine
model information is not available from the kernel log.

Print the machine model to make it easier to derive the machine model
from an arbitrary kernel boot log.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
I have scripts to save kernel boot logs, and compare logs[*] for
subsequent boots on the same machine.  Having a way to extract the
machine model from an arbitrary kernel boot log makes this easier.

Yes, I'm also a big fan of CONFIG_LOCALVERSION_AUTO and
CONFIG_LOCALVERSION.

[*] and clock and PM domain lists...
---
 arch/arm64/kernel/setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 28855ec1be95e113..2c822ef94f341417 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -180,6 +180,7 @@ static void __init smp_build_mpidr_hash(void)
 static void __init setup_machine_fdt(phys_addr_t dt_phys)
 {
 	void *dt_virt = fixmap_remap_fdt(dt_phys);
+	const char *name;
 
 	if (!dt_virt || !early_init_dt_scan(dt_virt)) {
 		pr_crit("\n"
@@ -192,7 +193,9 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
 			cpu_relax();
 	}
 
-	dump_stack_set_arch_desc("%s (DT)", of_flat_dt_get_machine_name());
+	name = of_flat_dt_get_machine_name();
+	pr_info("Machine model: %s\n", name);
+	dump_stack_set_arch_desc("%s (DT)", name);
 }
 
 static void __init request_standard_resources(void)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Print DT machine model in setup_machine_fdt()
  2017-04-27 12:33 [PATCH] arm64: Print DT machine model in setup_machine_fdt() Geert Uytterhoeven
@ 2017-04-28 14:57 ` Will Deacon
  2017-04-28 16:16   ` Geert Uytterhoeven
  2017-04-28 16:14 ` Catalin Marinas
  1 sibling, 1 reply; 6+ messages in thread
From: Will Deacon @ 2017-04-28 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Catalin Marinas, Kevin Hilman, Mark Brown, Arnd Bergmann,
	linux-arm-kernel, linux-kernel

On Thu, Apr 27, 2017 at 02:33:05PM +0200, Geert Uytterhoeven wrote:
> On arm32, the machine model specified in the device tree is printed
> during boot-up, courtesy of of_flat_dt_match_machine().
> 
> On arm64, of_flat_dt_match_machine() is not called, and the machine
> model information is not available from the kernel log.
> 
> Print the machine model to make it easier to derive the machine model
> from an arbitrary kernel boot log.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> I have scripts to save kernel boot logs, and compare logs[*] for
> subsequent boots on the same machine.  Having a way to extract the
> machine model from an arbitrary kernel boot log makes this easier.
> 
> Yes, I'm also a big fan of CONFIG_LOCALVERSION_AUTO and
> CONFIG_LOCALVERSION.
> 
> [*] and clock and PM domain lists...
> ---
>  arch/arm64/kernel/setup.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index 28855ec1be95e113..2c822ef94f341417 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -180,6 +180,7 @@ static void __init smp_build_mpidr_hash(void)
>  static void __init setup_machine_fdt(phys_addr_t dt_phys)
>  {
>  	void *dt_virt = fixmap_remap_fdt(dt_phys);
> +	const char *name;
>  
>  	if (!dt_virt || !early_init_dt_scan(dt_virt)) {
>  		pr_crit("\n"
> @@ -192,7 +193,9 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
>  			cpu_relax();
>  	}
>  
> -	dump_stack_set_arch_desc("%s (DT)", of_flat_dt_get_machine_name());
> +	name = of_flat_dt_get_machine_name();
> +	pr_info("Machine model: %s\n", name);
> +	dump_stack_set_arch_desc("%s (DT)", name);
>  }

I think your use-case is slightly questionable (e.g. for ACPI, we print
something different, and this isn't generally considered to be ABI), but
the patch is harmless and if you find it useful then:

Acked-by: Will Deacon <will.deacon@arm.com>

Will

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Print DT machine model in setup_machine_fdt()
  2017-04-27 12:33 [PATCH] arm64: Print DT machine model in setup_machine_fdt() Geert Uytterhoeven
  2017-04-28 14:57 ` Will Deacon
@ 2017-04-28 16:14 ` Catalin Marinas
  1 sibling, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2017-04-28 16:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Will Deacon, Arnd Bergmann, Kevin Hilman, linux-kernel,
	Mark Brown, linux-arm-kernel

On Thu, Apr 27, 2017 at 02:33:05PM +0200, Geert Uytterhoeven wrote:
> On arm32, the machine model specified in the device tree is printed
> during boot-up, courtesy of of_flat_dt_match_machine().
> 
> On arm64, of_flat_dt_match_machine() is not called, and the machine
> model information is not available from the kernel log.
> 
> Print the machine model to make it easier to derive the machine model
> from an arbitrary kernel boot log.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Applied. Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Print DT machine model in setup_machine_fdt()
  2017-04-28 14:57 ` Will Deacon
@ 2017-04-28 16:16   ` Geert Uytterhoeven
  2017-04-28 16:52     ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-04-28 16:16 UTC (permalink / raw)
  To: Will Deacon
  Cc: Geert Uytterhoeven, Catalin Marinas, Kevin Hilman, Mark Brown,
	Arnd Bergmann, linux-arm-kernel, linux-kernel

Hi Will,

On Fri, Apr 28, 2017 at 4:57 PM, Will Deacon <will.deacon@arm.com> wrote:
> On Thu, Apr 27, 2017 at 02:33:05PM +0200, Geert Uytterhoeven wrote:
>> On arm32, the machine model specified in the device tree is printed
>> during boot-up, courtesy of of_flat_dt_match_machine().
>>
>> On arm64, of_flat_dt_match_machine() is not called, and the machine
>> model information is not available from the kernel log.
>>
>> Print the machine model to make it easier to derive the machine model
>> from an arbitrary kernel boot log.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> I have scripts to save kernel boot logs, and compare logs[*] for
>> subsequent boots on the same machine.  Having a way to extract the
>> machine model from an arbitrary kernel boot log makes this easier.

> I think your use-case is slightly questionable (e.g. for ACPI, we print
> something different, and this isn't generally considered to be ABI), but
> the patch is harmless and if you find it useful then:

Not having access to an ARM ACPI system, what does it print for example?

I don't consider it ABI, though, just informational.

> Acked-by: Will Deacon <will.deacon@arm.com>

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Print DT machine model in setup_machine_fdt()
  2017-04-28 16:16   ` Geert Uytterhoeven
@ 2017-04-28 16:52     ` Will Deacon
  2017-04-28 17:30       ` Sudeep Holla
  0 siblings, 1 reply; 6+ messages in thread
From: Will Deacon @ 2017-04-28 16:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Catalin Marinas, Kevin Hilman, Mark Brown,
	Arnd Bergmann, linux-arm-kernel, linux-kernel

On Fri, Apr 28, 2017 at 06:16:46PM +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 28, 2017 at 4:57 PM, Will Deacon <will.deacon@arm.com> wrote:
> > On Thu, Apr 27, 2017 at 02:33:05PM +0200, Geert Uytterhoeven wrote:
> >> On arm32, the machine model specified in the device tree is printed
> >> during boot-up, courtesy of of_flat_dt_match_machine().
> >>
> >> On arm64, of_flat_dt_match_machine() is not called, and the machine
> >> model information is not available from the kernel log.
> >>
> >> Print the machine model to make it easier to derive the machine model
> >> from an arbitrary kernel boot log.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >> I have scripts to save kernel boot logs, and compare logs[*] for
> >> subsequent boots on the same machine.  Having a way to extract the
> >> machine model from an arbitrary kernel boot log makes this easier.
> 
> > I think your use-case is slightly questionable (e.g. for ACPI, we print
> > something different, and this isn't generally considered to be ABI), but
> > the patch is harmless and if you find it useful then:
> 
> Not having access to an ARM ACPI system, what does it print for example?

It's supposed to print out some stuff from DMI, but my Juno just says:

  DMI not present or invalid.

Luckily, it's not really an issue because I don't get to a prompt after USB
fails to come up and it times out mounting the rootfs.

Will

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Print DT machine model in setup_machine_fdt()
  2017-04-28 16:52     ` Will Deacon
@ 2017-04-28 17:30       ` Sudeep Holla
  0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2017-04-28 17:30 UTC (permalink / raw)
  To: Will Deacon, Geert Uytterhoeven
  Cc: Sudeep Holla, Geert Uytterhoeven, Arnd Bergmann, Kevin Hilman,
	Catalin Marinas, linux-kernel, Mark Brown, linux-arm-kernel



On 28/04/17 17:52, Will Deacon wrote:
> On Fri, Apr 28, 2017 at 06:16:46PM +0200, Geert Uytterhoeven wrote:
>> On Fri, Apr 28, 2017 at 4:57 PM, Will Deacon <will.deacon@arm.com> wrote:
>>> On Thu, Apr 27, 2017 at 02:33:05PM +0200, Geert Uytterhoeven wrote:
>>>> On arm32, the machine model specified in the device tree is printed
>>>> during boot-up, courtesy of of_flat_dt_match_machine().
>>>>
>>>> On arm64, of_flat_dt_match_machine() is not called, and the machine
>>>> model information is not available from the kernel log.
>>>>
>>>> Print the machine model to make it easier to derive the machine model
>>>> from an arbitrary kernel boot log.
>>>>
>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>>> ---
>>>> I have scripts to save kernel boot logs, and compare logs[*] for
>>>> subsequent boots on the same machine.  Having a way to extract the
>>>> machine model from an arbitrary kernel boot log makes this easier.
>>
>>> I think your use-case is slightly questionable (e.g. for ACPI, we print
>>> something different, and this isn't generally considered to be ABI), but
>>> the patch is harmless and if you find it useful then:
>>
>> Not having access to an ARM ACPI system, what does it print for example?
> 
> It's supposed to print out some stuff from DMI, but my Juno just says:
> 
>   DMI not present or invalid.
> 

With latest firmware, I get something like:

DMI: ARM LTD ARM Juno Development Platform/ARM Juno Development
Platform, BIOS EDK II ...

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-28 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 12:33 [PATCH] arm64: Print DT machine model in setup_machine_fdt() Geert Uytterhoeven
2017-04-28 14:57 ` Will Deacon
2017-04-28 16:16   ` Geert Uytterhoeven
2017-04-28 16:52     ` Will Deacon
2017-04-28 17:30       ` Sudeep Holla
2017-04-28 16:14 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).