From patchwork Mon Oct 18 18:39:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8902C433FE for ; Mon, 18 Oct 2021 18:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F0C861263 for ; Mon, 18 Oct 2021 18:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233200AbhJRSlt (ORCPT ); Mon, 18 Oct 2021 14:41:49 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54574 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhJRSlr (ORCPT ); Mon, 18 Oct 2021 14:41:47 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 280672072135 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Krzysztof Kozlowski , , Subject: [PATCH 01/22] usb: host: ehci-exynos: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:09 +0300 Message-ID: <20211018183930.8448-2-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 44ed240d6273 ("usb: host: ehci-exynos: Fix error check in exynos_ehci_probe()") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ehci-exynos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 1a9b7572e17f..ff4e1261801a 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -207,6 +207,10 @@ static int exynos_ehci_probe(struct platform_device *pdev) err = irq; goto fail_io; } + if (!irq) { + err = -EINVAL; + goto fail_io; + } err = exynos_ehci_phy_enable(&pdev->dev); if (err) { From patchwork Mon Oct 18 18:39:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D12C9C4332F for ; Mon, 18 Oct 2021 18:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFAB961212 for ; Mon, 18 Oct 2021 18:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233114AbhJRSls (ORCPT ); Mon, 18 Oct 2021 14:41:48 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36140 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbhJRSlr (ORCPT ); Mon, 18 Oct 2021 14:41:47 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 913C5206F602 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 02/22] usb: host: ehci-mv: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:10 +0300 Message-ID: <20211018183930.8448-3-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: a7f40c233a6b ("USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ehci-mv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 8fd27249ad25..f54ce1eeccf3 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -168,6 +168,10 @@ static int mv_ehci_probe(struct platform_device *pdev) retval = platform_get_irq(pdev, 0); if (retval < 0) goto err_disable_clk; + if (!retval) { + retval = -EINVAL; + goto err_disable_clk; + } hcd->irq = retval; ehci = hcd_to_ehci(hcd); From patchwork Mon Oct 18 18:39:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B874EC433FE for ; Mon, 18 Oct 2021 18:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A58E661212 for ; Mon, 18 Oct 2021 18:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233408AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52890 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbhJRSls (ORCPT ); Mon, 18 Oct 2021 14:41:48 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 37C31205DEE8 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Subject: [PATCH 03/22] usb: host: ehci-npcm7xx: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:11 +0300 Message-ID: <20211018183930.8448-4-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Reviewed-by: Avi Fishman --- 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. From patchwork Mon Oct 18 18:39:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C71E2C4332F for ; Mon, 18 Oct 2021 18:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF47061263 for ; Mon, 18 Oct 2021 18:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233409AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55466 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233011AbhJRSls (ORCPT ); Mon, 18 Oct 2021 14:41:48 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 9134820A88D8 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Subject: [PATCH 04/22] usb: host: ehci-omap: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:12 +0300 Message-ID: <20211018183930.8448-5-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: b33f37064b74 ("USB: host: ehci: introduce omap ehci-hcd driver") Signed-off-by: Sergey Shtylyov Reported-by: kernel test robot --- drivers/usb/host/ehci-omap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7f4a03e8647a..79cec242c025 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -117,6 +117,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; + if (!irq) + return -ENIVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(dev, res); From patchwork Mon Oct 18 18:39:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FFC2C433EF for ; Mon, 18 Oct 2021 18:39:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8F3461212 for ; Mon, 18 Oct 2021 18:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233208AbhJRSlu (ORCPT ); Mon, 18 Oct 2021 14:41:50 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55478 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233095AbhJRSls (ORCPT ); Mon, 18 Oct 2021 14:41:48 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru F0EE920A8F93 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Subject: [PATCH 05/22] usb: host: ehci-platform: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:13 +0300 Message-ID: <20211018183930.8448-6-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 7a7a4a592f42 ("USB: EHCI: Add a generic platform device driver") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ehci-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index c70f2d0b4aaf..1b20af65d799 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -265,6 +265,8 @@ static int ehci_platform_probe(struct platform_device *dev) irq = platform_get_irq(dev, 0); if (irq < 0) return irq; + if (!irq) + return -EINVAL; hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev, dev_name(&dev->dev)); From patchwork Mon Oct 18 18:39:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 386C4C43219 for ; Mon, 18 Oct 2021 18:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24B4F61263 for ; Mon, 18 Oct 2021 18:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233320AbhJRSlv (ORCPT ); Mon, 18 Oct 2021 14:41:51 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54586 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233108AbhJRSlt (ORCPT ); Mon, 18 Oct 2021 14:41:49 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 5B24E2072122 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 06/22] usb: host: ehci-spear: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:14 +0300 Message-ID: <20211018183930.8448-7-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: c8c38de9d800 ("USB host: Adding USB ehci & ohci support for spear platform") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ehci-spear.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 3694e450a11a..f4a5896900dc 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -70,6 +70,10 @@ static int spear_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. From patchwork Mon Oct 18 18:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04ED3C433F5 for ; Mon, 18 Oct 2021 18:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6AEC60F93 for ; Mon, 18 Oct 2021 18:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbhJRSlv (ORCPT ); Mon, 18 Oct 2021 14:41:51 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36150 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbhJRSlt (ORCPT ); Mon, 18 Oct 2021 14:41:49 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru C1A8B206F605 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Patrice Chotard , Subject: [PATCH 07/22] usb: host: ehci-st: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:15 +0300 Message-ID: <20211018183930.8448-8-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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"); From patchwork Mon Oct 18 18:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591B0C4321E for ; Mon, 18 Oct 2021 18:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ED3861263 for ; Mon, 18 Oct 2021 18:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233410AbhJRSlx (ORCPT ); Mon, 18 Oct 2021 14:41:53 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54606 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232909AbhJRSlu (ORCPT ); Mon, 18 Oct 2021 14:41:50 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 64E892072127 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Subject: [PATCH 08/22] usb: host: ohci-at91: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:16 +0300 Message-ID: <20211018183930.8448-9-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: fb5f1834c322 ("usb: ohci-at91: fix irq and iomem resource retrieval") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-at91.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index a24aea3d2759..6a7276a730d1 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -181,6 +181,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, dev_dbg(dev, "hcd probe: missing irq resource\n"); return irq; } + if (!irq) + return -EINVAL; hcd = usb_create_hcd(driver, dev, "at91"); if (!hcd) From patchwork Mon Oct 18 18:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0C3FC433EF for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDD0F6134F for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233485AbhJRSly (ORCPT ); Mon, 18 Oct 2021 14:41:54 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55488 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233186AbhJRSlu (ORCPT ); Mon, 18 Oct 2021 14:41:50 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru B795D20A8F94 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 09/22] usb: host: ohci-da8xx: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:17 +0300 Message-ID: <20211018183930.8448-10-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: efe7daf2231a ("USB: OHCI: DA8xx/OMAP-L1x glue layer") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-da8xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 1371b0c249ec..6d08ab2bf163 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -449,6 +449,10 @@ static int ohci_da8xx_probe(struct platform_device *pdev) error = -ENODEV; goto err; } + if (!hcd_irq) { + error = -EINVAL; + goto err; + } error = usb_add_hcd(hcd, hcd_irq, 0); if (error) From patchwork Mon Oct 18 18:39:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23F94C433EF for ; Mon, 18 Oct 2021 18:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1281361212 for ; Mon, 18 Oct 2021 18:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233560AbhJRSmE (ORCPT ); Mon, 18 Oct 2021 14:42:04 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52906 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhJRSlu (ORCPT ); Mon, 18 Oct 2021 14:41:50 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 2D18D207135B Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Krzysztof Kozlowski , , Subject: [PATCH 10/22] usb: host: ohci-exynos: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:18 +0300 Message-ID: <20211018183930.8448-11-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 1d4169834628 ("usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-exynos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 5f5e8a64c8e2..f28f28e42f43 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -175,6 +175,10 @@ static int exynos_ohci_probe(struct platform_device *pdev) err = irq; goto fail_io; } + if (!irq) { + err = -EINVAL; + goto fail_io; + } platform_set_drvdata(pdev, hcd); From patchwork Mon Oct 18 18:39:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0F07C433F5 for ; Mon, 18 Oct 2021 18:39:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A357861212 for ; Mon, 18 Oct 2021 18:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233513AbhJRSlz (ORCPT ); Mon, 18 Oct 2021 14:41:55 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54616 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbhJRSlv (ORCPT ); Mon, 18 Oct 2021 14:41:51 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 925F62072139 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Vladimir Zapolskiy , Subject: [PATCH 11/22] usb: host: ohci-at91: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:19 +0300 Message-ID: <20211018183930.8448-12-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 60bbfc84b6d9 ("USB OHCI controller support for PNX4008") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-nxp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index 85878e8ad331..afb9c2fc85c3 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -215,6 +215,10 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev) ret = -ENXIO; goto fail_resource; } + if (!irq) { + ret = -EINVAL; + goto fail_resource; + } ohci_nxp_start_hc(); platform_set_drvdata(pdev, hcd); From patchwork Mon Oct 18 18:39:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4F09C4332F for ; Mon, 18 Oct 2021 18:39:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C24DA61356 for ; Mon, 18 Oct 2021 18:39:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233535AbhJRSly (ORCPT ); Mon, 18 Oct 2021 14:41:54 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36166 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233295AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 18ADC206F609 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Subject: [PATCH 12/22] usb: host: ohci-omap: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:20 +0300 Message-ID: <20211018183930.8448-13-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-omap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index ded9738392e4..6d5f964d0995 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -309,6 +309,10 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev) retval = -ENXIO; goto err3; } + if (!irq) { + retval = -EINVAL; + goto err3; + } retval = usb_add_hcd(hcd, irq, 0); if (retval) goto err3; From patchwork Mon Oct 18 18:39:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9A0BC433FE for ; Mon, 18 Oct 2021 18:39:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3D7A60F93 for ; Mon, 18 Oct 2021 18:39:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233607AbhJRSl4 (ORCPT ); Mon, 18 Oct 2021 14:41:56 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52916 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 6BB752074A58 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 13/22] usb: host: ohci-platform: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:21 +0300 Message-ID: <20211018183930.8448-14-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: fa3364b5a2d7 ("USB: OHCI: Add a generic platform device driver") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 4a8456f12a73..ec1d38d5d140 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -113,6 +113,8 @@ static int ohci_platform_probe(struct platform_device *dev) irq = platform_get_irq(dev, 0); if (irq < 0) return irq; + if (!irq) + return -EINVAL; hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, dev_name(&dev->dev)); From patchwork Mon Oct 18 18:39:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2BF4C433F5 for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A889061212 for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233495AbhJRSl5 (ORCPT ); Mon, 18 Oct 2021 14:41:57 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55496 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru CB22C20A8F97 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 14/22] usb: host: ohci-pxa27x: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:22 +0300 Message-ID: <20211018183930.8448-15-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 84bab7393b0d ("[ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-pxa27x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 54aa5c77e549..336437277fd0 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -443,6 +443,8 @@ static int ohci_hcd_pxa27x_probe(struct platform_device *pdev) pr_err("no resource of IORESOURCE_IRQ"); return irq; } + if (!irq) + return -EINVAL; usb_clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(usb_clk)) From patchwork Mon Oct 18 18:39:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08AEFC4332F for ; Mon, 18 Oct 2021 18:39:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E30AB61263 for ; Mon, 18 Oct 2021 18:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233638AbhJRSl6 (ORCPT ); Mon, 18 Oct 2021 14:41:58 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54606 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbhJRSlw (ORCPT ); Mon, 18 Oct 2021 14:41:52 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 5334C207213B Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 15/22] usb: host: ohci-sm501: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:23 +0300 Message-ID: <20211018183930.8448-16-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: f54aab6ebcec ("usb: ohci-sm501 driver") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-sm501.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index b91d50da6127..ffb7b6645d2c 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -96,6 +96,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) irq = retval = platform_get_irq(pdev, 0); if (retval < 0) goto err0; + if (!retval) { + retval = -EINVAL; + goto err0; + } mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (mem == NULL) { From patchwork Mon Oct 18 18:39:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA2CAC433FE for ; Mon, 18 Oct 2021 18:39:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8AE7A61279 for ; Mon, 18 Oct 2021 18:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233692AbhJRSmA (ORCPT ); Mon, 18 Oct 2021 14:42:00 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36174 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233360AbhJRSlx (ORCPT ); Mon, 18 Oct 2021 14:41:53 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru C104E206F606 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 16/22] usb: host: ohci-spear: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:24 +0300 Message-ID: <20211018183930.8448-17-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: c8c38de9d800 ("USB host: Adding USB ehci & ohci support for spear platform") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-spear.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index b4cd9e6c72fd..6c5af2612c46 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -46,6 +46,10 @@ static int spear_ohci_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. From patchwork Mon Oct 18 18:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB6B4C433F5 for ; Mon, 18 Oct 2021 18:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A909361212 for ; Mon, 18 Oct 2021 18:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233561AbhJRSmE (ORCPT ); Mon, 18 Oct 2021 14:42:04 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52928 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbhJRSlx (ORCPT ); Mon, 18 Oct 2021 14:41:53 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 516872076EA8 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Patrice Chotard , Subject: [PATCH 17/22] usb: host: ohci-st: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:25 +0300 Message-ID: <20211018183930.8448-18-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: d115837259ad ("usb: host: ohci-st: Add OHCI driver support for ST STB devices") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-st.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c index ac796ccd93ef..b9200071ce6c 100644 --- a/drivers/usb/host/ohci-st.c +++ b/drivers/usb/host/ohci-st.c @@ -140,6 +140,8 @@ static int st_ohci_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) { From patchwork Mon Oct 18 18:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A04EC43217 for ; Mon, 18 Oct 2021 18:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3422A61263 for ; Mon, 18 Oct 2021 18:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233565AbhJRSmA (ORCPT ); Mon, 18 Oct 2021 14:42:00 -0400 Received: from mxout02.lancloud.ru ([45.84.86.82]:54636 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbhJRSly (ORCPT ); Mon, 18 Oct 2021 14:41:54 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru A4A0B207213F Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 18/22] usb: host: ohci-tmio: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:26 +0300 Message-ID: <20211018183930.8448-19-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-tmio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index 08ec2ab0d95a..53932e8a968f 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c @@ -204,6 +204,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) if (irq < 0) return irq; + if (!irq) + return -EINVAL; hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev)); if (!hcd) { From patchwork Mon Oct 18 18:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66B8DC433F5 for ; Mon, 18 Oct 2021 18:39:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F3D461263 for ; Mon, 18 Oct 2021 18:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233708AbhJRSmB (ORCPT ); Mon, 18 Oct 2021 14:42:01 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36184 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233471AbhJRSly (ORCPT ); Mon, 18 Oct 2021 14:41:54 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 0FEA2206F60C Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Mathias Nyman , "Greg Kroah-Hartman" Subject: [PATCH 19/22] usb: host: xhci-histb: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:27 +0300 Message-ID: <20211018183930.8448-20-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: c508f41da078 ("xhci: hisilicon: support HiSilicon STB xHCI host controller") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/xhci-histb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-histb.c b/drivers/usb/host/xhci-histb.c index 08369857686e..581952dcefe8 100644 --- a/drivers/usb/host/xhci-histb.c +++ b/drivers/usb/host/xhci-histb.c @@ -218,6 +218,8 @@ static int xhci_histb_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; + if (!irq) + return -EINVAL; histb->ctrl = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(histb->ctrl)) From patchwork Mon Oct 18 18:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4392CC433FE for ; Mon, 18 Oct 2021 18:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E9A460F93 for ; Mon, 18 Oct 2021 18:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233779AbhJRSmD (ORCPT ); Mon, 18 Oct 2021 14:42:03 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55514 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233186AbhJRSlz (ORCPT ); Mon, 18 Oct 2021 14:41:55 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 8531220A8F9B Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Mathias Nyman , "Greg Kroah-Hartman" CC: Chunfeng Yun , Matthias Brugger , , Subject: [PATCH 20/22] usb: host: xhci-mtk: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:28 +0300 Message-ID: <20211018183930.8448-21-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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") Signed-off-by: Sergey Shtylyov --- 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) + return -EINVAL; } wakeup_irq = platform_get_irq_byname_optional(pdev, "wakeup"); From patchwork Mon Oct 18 18:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D6BCC433EF for ; Mon, 18 Oct 2021 18:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A58960F93 for ; Mon, 18 Oct 2021 18:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233731AbhJRSmC (ORCPT ); Mon, 18 Oct 2021 14:42:02 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36190 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233476AbhJRSlz (ORCPT ); Mon, 18 Oct 2021 14:41:55 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru DBDF0206F614 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 21/22] usb: host: xhci-plat: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:29 +0300 Message-ID: <20211018183930.8448-22-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: 3429e91a661e ("usb: host: xhci: add platform driver support") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index c1edcc9b13ce..8f8ad82d90cd 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -205,6 +205,8 @@ static int xhci_plat_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; + if (!irq) + return -EINVAL; /* * sysdev must point to a device that is known to the system firmware From patchwork Mon Oct 18 18:39:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A782DC4332F for ; Mon, 18 Oct 2021 18:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93EB561212 for ; Mon, 18 Oct 2021 18:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233471AbhJRSmF (ORCPT ); Mon, 18 Oct 2021 14:42:05 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:36198 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233295AbhJRSl4 (ORCPT ); Mon, 18 Oct 2021 14:41:56 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 66278206F618 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Thierry Reding , Jonathan Hunter , Subject: [PATCH 22/22] usb: host: xhci-tegra: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:30 +0300 Message-ID: <20211018183930.8448-23-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: e84fce0f8837 ("usb: xhci: Add NVIDIA Tegra XUSB controller driver") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/xhci-tegra.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 1bf494b649bd..7151b1d4f876 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1439,6 +1439,8 @@ static int tegra_xusb_probe(struct platform_device *pdev) tegra->xhci_irq = platform_get_irq(pdev, 0); if (tegra->xhci_irq < 0) return tegra->xhci_irq; + if (!tegra->xhci_irq) + return -ENIVAL; tegra->mbox_irq = platform_get_irq(pdev, 1); if (tegra->mbox_irq < 0)