Message ID | 20211210204634.8182-2-s.shtylyov@omp.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix deferred probing in the USB host/gadget drivers | expand |
On Fri, Dec 10, 2021 at 11:46:29PM +0300, Sergey Shtylyov wrote: > The driver overrides the error codes and IRQ0 returned by platform_get_irq() > to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe > permanently instead of the deferred probing. Switch to propagating the error > codes upstream. IRQ0 is no longer returned by platform_get_irq(), so we now > can safely ignore it... What commit keeps IRQ0 from being returned by platform_get_irq()?
Hello! On 12/13/21 5:11 PM, Greg Kroah-Hartman wrote: >> The driver overrides the error codes and IRQ0 returned by platform_get_irq() >> to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe >> permanently instead of the deferred probing. Switch to propagating the error >> codes upstream. IRQ0 is no longer returned by platform_get_irq(), so we now >> can safely ignore it... > > What commit keeps IRQ0 from being returned by platform_get_irq()? It's yet unmerged patch on which (as I wrote in the cover letter) the series depend: https://marc.info/?l=linux-kernel&m=163623041902285 MBR, Sergey
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c index 4b35739d3695..4aa5246a77e5 100644 --- a/drivers/usb/gadget/udc/gr_udc.c +++ b/drivers/usb/gadget/udc/gr_udc.c @@ -2136,15 +2136,15 @@ static int gr_probe(struct platform_device *pdev) return PTR_ERR(regs); dev->irq = platform_get_irq(pdev, 0); - if (dev->irq <= 0) - return -ENODEV; + if (dev->irq < 0) + return dev->irq; /* Some core configurations has separate irqs for IN and OUT events */ dev->irqi = platform_get_irq(pdev, 1); if (dev->irqi > 0) { dev->irqo = platform_get_irq(pdev, 2); - if (dev->irqo <= 0) - return -ENODEV; + if (dev->irqo < 0) + return dev->irqo; } else { dev->irqi = 0; }
The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream. IRQ0 is no longer returned by platform_get_irq(), so we now can safely ignore it... Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- Changes in version 3: - corrected the "Fixes:" tag. Changes in version 2: - updated the patch description on treating IRQ0. drivers/usb/gadget/udc/gr_udc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)