Re: [PATCH v1 1/1] driver core: platform: Make platform_get_irq_optional() optional

From: Andy Shevchenko
Date: Wed Apr 07 2021 - 05:40:16 EST


On Tue, Apr 06, 2021 at 12:25:14PM -0700, Guenter Roeck wrote:
> On Wed, Mar 31, 2021 at 05:45:26PM +0300, Andy Shevchenko wrote:
> > Currently the platform_get_irq_optional() returns an error code even
> > if IRQ resource sumply has not been found. It prevents caller to be
> > error code agnostic in their error handling.
> >
> > Now:
> > ret = platform_get_irq_optional(...);
> > if (ret != -ENXIO)
> > return ret; // respect deferred probe
> > if (ret > 0)
> > ...we get an IRQ...
> >
> > After proposed change:
> > ret = platform_get_irq_optional(...);
> > if (ret < 0)
> > return ret;
> > if (ret > 0)
> > ...we get an IRQ...
> >
> > Reported-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> This patch causes all my "sh" emulations to stall during boot with the
> following repeated error message.
>
> sh-sci sh-sci.1: Can't allocate rx full IRQ
>
> Reverting this patch fixes the problem (and the message is gone).
> Bisect log is attached.

I believe it reveals some "interesting" error handling there.
I'm going to propose a solution soon.

Thanks for the report!

--
With Best Regards,
Andy Shevchenko