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

From: Greg KH
Date: Thu Feb 18 2021 - 05:56:13 EST


On Thu, Feb 18, 2021 at 09:04:42AM +0000, Marc Zyngier wrote:
> On Thu, 18 Feb 2021 08:54:00 +0000,
> Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> 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.

Ah, ok, you really are doing delete/re-create. Crazy. And amazing it
was working previously without the checks I just added...

Funny that you all never were even noticing that the debugfs files are
not present in the system because they are tryign to be created before
debugfs is present? Is that an issue or has no one complained?

Anyway, I'll go turn this into a real patch and get it into 5.12-rc1 so
that the irqdomain patch I sent you will not blow anything up. Feel
free to also queue it up in your tree if you want to as well.

thanks,

greg k-h