openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/22] usb: host: ehci-npcm7xx: deny IRQ0
       [not found] <20211018183930.8448-1-s.shtylyov@omp.ru>
@ 2021-10-18 18:39 ` Sergey Shtylyov
  2021-10-19  7:11   ` Avi Fishman
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2021-10-18 18:39 UTC (permalink / raw)
  To: linux-usb, Alan Stern, Greg Kroah-Hartman
  Cc: Benjamin Fair, Avi Fishman, Patrick Venture, openbmc, Tali Perry,
	Tomer Maimon

If platform_get_irq() returns IRQ0 (considered invalid according to Linus)
the driver blithely passes it to usb_add_hcd() that treats IRQ0 as no IRQ
at all. Deny IRQ0 right away, returning -EINVAL from the probe() method...

Fixes: df44831ee2dd ("USB host: Add USB ehci support for nuvoton npcm7xx platform")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ehci-npcm7xx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7xx.c
index 6b5a7a873e01..aff3d906ced5 100644
--- a/drivers/usb/host/ehci-npcm7xx.c
+++ b/drivers/usb/host/ehci-npcm7xx.c
@@ -114,6 +114,10 @@ static int npcm7xx_ehci_hcd_drv_probe(struct platform_device *pdev)
 		retval = irq;
 		goto fail;
 	}
+	if (!irq) {
+		retval = -EINVAL;
+		goto fail;
+	}
 
 	/*
 	 * Right now device-tree probed devices don't get dma_mask set.
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 03/22] usb: host: ehci-npcm7xx: deny IRQ0
  2021-10-18 18:39 ` [PATCH 03/22] usb: host: ehci-npcm7xx: deny IRQ0 Sergey Shtylyov
@ 2021-10-19  7:11   ` Avi Fishman
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Fishman @ 2021-10-19  7:11 UTC (permalink / raw)
  To: Sergey Shtylyov
  Cc: Tomer Maimon, Patrick Venture, OpenBMC Maillist, linux-usb,
	Tali Perry, Alan Stern, Greg Kroah-Hartman, Benjamin Fair

On Mon, Oct 18, 2021 at 9:39 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> If platform_get_irq() returns IRQ0 (considered invalid according to Linus)
> the driver blithely passes it to usb_add_hcd() that treats IRQ0 as no IRQ
> at all. Deny IRQ0 right away, returning -EINVAL from the probe() method...
>
> Fixes: df44831ee2dd ("USB host: Add USB ehci support for nuvoton npcm7xx platform")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
>  drivers/usb/host/ehci-npcm7xx.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7xx.c
> index 6b5a7a873e01..aff3d906ced5 100644
> --- a/drivers/usb/host/ehci-npcm7xx.c
> +++ b/drivers/usb/host/ehci-npcm7xx.c
> @@ -114,6 +114,10 @@ static int npcm7xx_ehci_hcd_drv_probe(struct platform_device *pdev)
>                 retval = irq;
>                 goto fail;
>         }
> +       if (!irq) {
> +               retval = -EINVAL;
> +               goto fail;
> +       }
>
>         /*
>          * Right now device-tree probed devices don't get dma_mask set.
> --
> 2.26.3
>
Reviewed-by: Avi Fishman <avifishman70@gmail.com>

--
Regards,
Avi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-19  7:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211018183930.8448-1-s.shtylyov@omp.ru>
2021-10-18 18:39 ` [PATCH 03/22] usb: host: ehci-npcm7xx: deny IRQ0 Sergey Shtylyov
2021-10-19  7:11   ` Avi Fishman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).