[PATCH] ARM: remove name from machine_desc for DT platforms

Rob Herring robherring2 at gmail.com
Mon Oct 28 19:58:22 EDT 2013


On 10/28/2013 02:53 PM, Stephen Warren wrote:
> On 10/26/2013 09:34 AM, Rob Herring wrote:
>> On Wed, Oct 9, 2013 at 3:55 PM, Rob Herring <robherring2 at gmail.com> wrote:
>>> From: Rob Herring <rob.herring at calxeda.com>
>>>
>>> As part of the effort to ultimately remove struct machine_desc, the
>>> machine name is not really needed. It is only used for /proc/cpuinfo
>>> "Hardware" field. Get this information from the DT instead and remove
>>> the name string in the machine descriptor for DT machine descriptors. The
>>> model or machine compatible property from the DT is used instead.
>>>
>>> This likely changes the name reported by /proc/cpuinfo. There could be
>>> some userspace dependencies on the old name. Debian libdebian-installer
>>> used to use this to determine kernel flavour, but now uses the DT
>>> directly. It is not really a good idea for userspace to depend on this
>>> anyway.
> 
>>> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
>>> index 0e1e2b3..b0747bb 100644
>>> --- a/arch/arm/kernel/setup.c
>>> +++ b/arch/arm/kernel/setup.c
>>> @@ -611,7 +611,7 @@ void __init dump_machine_table(void)
>>>
>>>         early_print("Available machine support:\n\nID (hex)\tNAME\n");
>>>         for_each_machine_desc(p)
>>> -               early_print("%08x\t%s\n", p->nr, p->name);
>>> +               early_print("%08x\t%s\n", p->nr, p->name ? p->name : *p->dt_compat);
> 
> Does it make sense to iterate over all the entries in p->dt_compat here?
> Tegra's machine descriptor supports 4 different compatible values, and I
> think that'll only print one of them.

This is simply showing which machines are built into the kernel. With
only the first string, you can figure out the other strings. It is not
much of a different lookup than before. Considering you need DEBUG_LL
enabled to see any of this to begin with, I don't think that's too much
of a hurdle.

Rob




More information about the linux-arm-kernel mailing list