Thread (36 messages) 36 messages, 6 authors, 2021-11-13

Re: [PATCH v2 07/22] usb: host: ehci-st: deny IRQ0

From: Patrice CHOTARD <patrice.chotard@foss.st.com>
Date: 2021-10-27 06:09:37
Also in: linux-arm-kernel

Hi Sergey

On 10/26/21 7:39 PM, Sergey Shtylyov wrote:
quoted hunk ↗ jump to hunk
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: e47c5a0906f9 ("usb: host: ehci-st: Add EHCI support for ST STB devices")
Signed-off-by: Sergey Shtylyov <redacted>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
Changes in version 2:
- added Alan's ACK.

 drivers/usb/host/ehci-st.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
index f74433aac948..5f53c313f943 100644
--- a/drivers/usb/host/ehci-st.c
+++ b/drivers/usb/host/ehci-st.c
@@ -160,6 +160,8 @@ static int st_ehci_platform_probe(struct platform_device *dev)
 	irq = platform_get_irq(dev, 0);
 	if (irq < 0)
 		return irq;
+	if (!irq)
+		return -EINVAL;
 	res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	if (!res_mem) {
 		dev_err(&dev->dev, "no memory resource provided");
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help