Re: [PATCH v3] mailbox: add list of used channels to debugfs

From: Geert Uytterhoeven

Date: Tue Apr 14 2026 - 12:09:49 EST


Hi Wolfram,

On Tue, 14 Apr 2026 at 17:28, Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> >
> > Thanks for your patch, which looks useful!
>
> Glad you like it!
>
> > Can you please put it in a subdir, like all other summaries:
>
> Sadly not, because of the paragraph from above:
>
> > > Note that mailbox controllers currently can be instantiated at any
> > > initcall stage. So, per-controller debugfs handling was discarded
> > > because it is not clear when to create the root "mailbox"-debugfs entry.
> > > A central file was chosen, similar to the GPIO subsystem, which is
> > > independent of the initcall stage because it will be accessed only when
> > > userspace is available anyhow.
>
> I would need to use core_initcall for the mailbox-subsys. debugfs itself
> also uses core_initcall. Then, some drivers (e.g. hi3660-mailbox) use
> core_initcall. I don't think the subdir is worth all the potential race
> conditions and fragile solutions which usually come with it. Or do you
> know a solid solution to this problem?

I am not asking for a per-controller subdir, but a mailbox-specific
subdir. Surely you can do something like:

- debugfs_create_file("mailbox_summary", 0444, NULL, NULL, &mbox_fops);
+ mbox_debugfs = debugfs_create_dir("mailbox", NULL);
+ debugfs_create_file("mailbox_summary", 0444, mbox_debugfs,
+ NULL, &mbox_fops);

Cfr. https://elixir.bootlin.com/linux/v7.0/source/drivers/devfreq/devfreq.c#L2036

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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