[PATCH v3 12/16] pinctrl: starfive: Add pinctrl driver for StarFive SoCs

Andy Shevchenko andy.shevchenko at gmail.com
Wed Nov 3 07:13:58 PDT 2021


On Wed, Nov 03, 2021 at 01:35:23PM +0100, Emil Renner Berthing wrote:
> On Wed, 3 Nov 2021 at 10:13, Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
> > On Tue, Nov 2, 2021 at 10:35 PM Emil Renner Berthing <kernel at esmil.dk> wrote:
> > > On Tue, 2 Nov 2021 at 21:02, Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
> > > > On Tue, Nov 2, 2021 at 6:50 PM Emil Renner Berthing <kernel at esmil.dk> wrote:

...

> > > > > +               irq_set_handler_locked(d, handle_bad_irq);
> > > >
> > > > Why? You have it already in ->probe(), what's the point?
> > >
> > > So last time you asked about this, I explained a situation where
> > > userspace first grabs a GPIO, set the interrupt to edge triggered, and
> > > then later loads a driver that requests an unsupported IRQ type.
> >
> > I didn't get this scenario. Is it real?
> 
> No, it's totally made up, but I mean we even have tools like fuzzing
> to help us find bugs that would never happen in real use cases.
> 
> > > Then
> > > I'd like to set the handler back to handle_bad_irq so we don't get
> > > weird interrupts, but maybe now you know a reason why that doesn't
> > > matter or can't happen?
> >
> > In ->probe() you set _default_ handler to bad(), what do you mean by
> > 'set the handler back to bad()'? How is it otherwise if you free an
> > interrupt?
> 
> It might not be, but when not sure I thought it better to error on the
> safe side.

With a dead code?

I do not believe there is an issue since. like I said, there are plenty drivers
that don't do what you are suggesting here --> 99.99% you added a dead code.

> > So, please elaborate with call traces what the scenario / use case you
> > are talking about. If it's true what you are saying, we have a
> > situation (plenty of GPIO drivers don't do what you are suggesting
> > here).

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-riscv mailing list