Re: [PATCH] ksysfs: Expose hardware name

From: Petr Mladek

Date: Thu Mar 12 2026 - 10:18:13 EST


On Wed 2026-02-25 04:00:59, Steven Rostedt wrote:
> On Mon, 23 Feb 2026 15:20:22 +0100 (CET)
> Richard Weinberger <richard@xxxxxx> wrote:
>
> > ----- Ursprüngliche Mail -----
> > > Von: "John Ogness" <john.ogness@xxxxxxxxxxxxx>
> > > An: "richard" <richard@xxxxxx>, "linux-kernel" <linux-kernel@xxxxxxxxxxxxxxx>
> > >
> > > It seems a bit odd to make this a dependency of CONFIG_PRINTK. Perhaps
> > > @dump_stack_arch_desc_str and dump_stack_set_arch_desc() should move out
> > > of lib/dump_stack.c if this new sysfs attribute is accepted?
> >
> > Sure. I was surprised too that lib/dump_stack.c depends on CONFIG_PRINTK.
> >
>
> Or possibly we should make dump_stack.c not depend on CONFIG_PRINTK.
> I'm guessing that it was done that way because it expects to dump the
> stack to the console?

My guess is that dump_stack.c depends on CONFIG_PRINTK because
the stack is stored using printk(). Nothing is stored when
printk() is a NOP ;-)

A clean solution would be to move dump_stack_arch_desc_str
and dump_stack_set_arch_desc() somewhere else (ksysfs.c ?)
and rename them to hardware_name and set_hardware_name().

Best Regards,
Petr