Re: [PATCH] irqdomain: remove debugfs_file from struct irq_domain

Marc Zyngier
2021-02-18T10:19:25Z

On Thu, 18 Feb 2021 08:54:00 +0000,
Greg KH <gregkh@linuxfoundation.org> wrote:

[...]

> > > Wow, wait, you are removing a debugfs file _before_ debugfs is even
> > > initialized? Didn't expect that, ok, let me go try this again...
> >
> > Yeah, that's a poor man's rename (file being deleted and re-created).
>
> True, but that's not happening here, right? Some driver is being
> initialized and creates a debugfs file, and then decides to unload so it
> removes the debugfs file?

No, that's not what is happening.

The irqchip driver starts, creates an irqdomain. File gets created, at
least in theory (it fails because debugfs isn't ready, but that's not
the issue).

It then changes an attribute to the domain (the so-called bus_token),
which gets reflected in the domain name to avoid aliasing.
Delete/create follows.

> Why was it trying to create the file in the first place if it didn't
> properly bind to the hardware?

See above. We encode properties of the domain in the filename, and
reflect the change of these properties as they happen.

M.

--
Without deviation from the norm, progress is not possible.