Thread (2 messages) 2 messages, 2 authors, 2021-10-20

Re: [PATCH 20/22] usb: host: xhci-mtk: deny IRQ0

From: Chunfeng Yun <chunfeng.yun@mediatek.com>
Date: 2021-10-20 07:36:49
Also in: linux-mediatek, linux-usb

On Mon, 2021-10-18 at 21:39 +0300, Sergey Shtylyov 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: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host
controller")
Fixes the following patch:

04284eb74e0c usb: xhci-mtk: add support runtime PM

It introduced the 'host' irq
quoted hunk ↗ jump to hunk
Signed-off-by: Sergey Shtylyov <redacted>
---
 drivers/usb/host/xhci-mtk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
mtk.c
index c53f6f276d5c..d2dc8d9863ee 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -495,7 +495,7 @@ static int xhci_mtk_probe(struct platform_device
*pdev)
 		return ret;
 
 	irq = platform_get_irq_byname_optional(pdev, "host");
-	if (irq < 0) {
+	if (irq <= 0) {
 		if (irq == -EPROBE_DEFER)
 			return irq;
 
@@ -503,6 +503,8 @@ static int xhci_mtk_probe(struct platform_device
*pdev)
 		irq = platform_get_irq(pdev, 0);
 		if (irq < 0)
 			return irq;
+		if (!irq)
if (irq <= 0) ?

Thanks
+			return -EINVAL;
 	}
 
 	wakeup_irq = platform_get_irq_byname_optional(pdev, "wakeup");
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help