From patchwork Tue Oct 26 17: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: 12585265 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 98C15C433EF for ; Tue, 26 Oct 2021 17:41:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6466561002 for ; Tue, 26 Oct 2021 17:41:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6466561002 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CpOPplKFTdpPsz/Q0137oHv9Oxb6yYN3hOGFI19d9Pg=; b=dtn1HrFoIxMmO+ hJRRFZWlJQBgqwtrOBfkkEK2K7w9uQXzyHH7tQJx/pt+SFsu+unpO47hz/Zvsni2M0fON8U4jwWFw PCRJEdcNEMbmAUbitYyNxuIK8mc2fl8QDUPiauAa1hdiIh7J1SQCzPCHuj815Kb/hI7nZ7DnIO6d1 Z3/dr6DEJSPl5bHDzWQe5s8aJjvMI4nFgtVOG/cDHMH9otkDZsx5SAjmGNYp02g10IKBelbMDrOPd PTUo7He/lXJX9ZndCOHsq8hukL8rsN4VdphxY9svvytrCUNPStYBmcyCUKzWYmGiByJfWtFr7193m UCJmpg2v5pFR4hNphUFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQR6-002ca1-PG; Tue, 26 Oct 2021 17:40:33 +0000 Received: from mxout03.lancloud.ru ([45.84.86.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cQ3-I7 for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:40:00 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 3E95E206178B Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Krzysztof Kozlowski , , Subject: [PATCH v2 01/22] usb: host: ehci-exynos: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:22 +0300 Message-ID: <20211026173943.6829-2-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_816219_F25AB53B X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern --- Changes in version 2: - added Alan's ACK. 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 Tue Oct 26 17: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: 12585269 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 EAA38C433FE for ; Tue, 26 Oct 2021 17:42:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB22A604DA for ; Tue, 26 Oct 2021 17:42:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB22A604DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GsArJUq2+nWFlmh3PC8Gn3Y7U0otxGZycfKZOdUwqIw=; b=iUUvZR1x+PdsUc DKtVPLGn4nog151U9HCF0vxX4QYr3TZ0l2SsndquuMqVoY3HYFPxgkcXa67JNIfo2wALB5rFBvQQs 2OBxcXGE1dMP9rgC2/e0XjisPZo2Q7zR1ajAM6/6xQG0zYP1yjYt1UsPqtb4TmcOTmrhhurw+yTUI PO+zd84JsNAn0seanMILIvY8aEIRvZ0TRmJuEcSpVquWfCMPFjUpNxMl5Yw0Z15V0GDDnJ1g7SUNi oTlP/VIJEftjSIAfqR+sMscpEU52RE4+tKJdZGQ5F6+SHa7NAlZw0Rv/MUGBV1JDb6AkxaiUoDBnN LJnTmgtKHLTQVUObyGhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQRW-002ckU-LN; Tue, 26 Oct 2021 17:40:58 +0000 Received: from mxout02.lancloud.ru ([45.84.86.82]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cPx-KU for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:40:00 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 4B22920C0475 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Subject: [PATCH v2 05/22] usb: host: ehci-platform: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:26 +0300 Message-ID: <20211026173943.6829-6-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_903461_5CE4478C X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern --- Changes in version 2: - added Alan's ACK. 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 Tue Oct 26 17: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: 12585259 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 40483C433F5 for ; Tue, 26 Oct 2021 17:41:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04D7D61002 for ; Tue, 26 Oct 2021 17:41:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 04D7D61002 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PkspshvaMohL3zcEr1Hg4/pNV4TtsRqUlVED9xkg5+8=; b=suSqzLJD+PQn2H 7pIBAEb8E9VnoXD+8SW6Sjrsa54z2QaE2w2yULGMOEphKQic8VsOnJjrnWe3Q+ZPRZR35VbRsb5P6 UzPCA2LPyCB86ZJBo/ZBEDsxX0dYSFiPnBVXtuzzYwxItntrhGx5HwaXOK+tBlOCuqL5MsS17YAT8 lTk65Y6LT1owCtHAQ9HBBZ/ly9s004BU+OnkJVXgx8pLjkxDuxyTOSJGqdeIuN1zEayIux2EKs9sJ FP1BNjrB/1Fd6reW0sEv0zAvswU8rr5hafBY2i0FmrzjQ7v3FXARSn3OPqGW8maqLVgbldmZC6/G3 Z2hozBSQqiRq6665Rj+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQl-002cWX-3Z; Tue, 26 Oct 2021 17:40:11 +0000 Received: from mxout03.lancloud.ru ([45.84.86.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cQ4-I8 for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:39:58 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 10433206179C Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Patrice Chotard , Subject: [PATCH v2 07/22] usb: host: ehci-st: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:28 +0300 Message-ID: <20211026173943.6829-8-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_799867_F3E56549 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern Reviewed-by: Patrice Chotard --- 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"); From patchwork Tue Oct 26 17: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: 12585271 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 E66FDC433F5 for ; Tue, 26 Oct 2021 17:42:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B603F60551 for ; Tue, 26 Oct 2021 17:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B603F60551 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3PyHtxbkTmA2npzF1eoeicubKLfXakLRHYQxPmPz3do=; b=Uzfftgy6R7vRIR /keKomioroLWNaC7bv5/27dJwNmorAbSPr4ACaP/0KPFdmppDkCpGOtBYaEf+R5Q3QmoadR+rIrEg /qMtHbtYmRy45/i82ZuD6ZFkmn8KhtOdEs6NFKvJoPvVNI8/GlP0xlyp6qzmLVOY2pBsUL6uiXMpn 2UFfSgLjbdiuiDowvk2oLSuNJi20JrYvjjui2D74AOM07EOe11m+rqGpEu8QdWMwzMAnCiInG1UfW gF9UAgOBapava9DFofD4pzGr0eMWLhTc1EPkGY6XtTjCqXhx0OqYzZUTK2st0uwqkyo6cp7kyszoe YNA1qDy3xKgrGDfKR7CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQRl-002csF-7Z; Tue, 26 Oct 2021 17:41:13 +0000 Received: from mxout01.lancloud.ru ([45.84.86.81]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cQ2-Jp for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:40:00 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 8B454209033C Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH v2 08/22] usb: host: ohci-at91: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:29 +0300 Message-ID: <20211026173943.6829-9-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_875787_D58BCB2D X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern --- Changes in version 2: - added Alan's ACK. 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 Tue Oct 26 17:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12585263 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 EA1B8C433EF for ; Tue, 26 Oct 2021 17:41:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC96E61002 for ; Tue, 26 Oct 2021 17:41:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BC96E61002 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TBAvbpF8/LOAJPe90efZt0MAwtDsA5KDQvmqBxXchBI=; b=3A0G5Q3EV90Ddo JYSuvGd1jrLG8mVEwXnRzQ7sFT6AHOYu5PwB41T/gLz4awbA6qhic3IBPPsPaFsbo/lO+hqFfzbL/ QVIB87hlCaY1NEKH68WX1X1pYo+mfeyKtGMitRlgRzl+88uOQHvZp3y5HovFil/wF+dnUx+W3TFe1 bsDenJP9lEk/vDVcvDBbxtPPJqfQ4BgpJvUQxu+/TeoRw3bGUan1Ny7KB6+X577LVTDN2eRs0G1P9 Bj7JhS50zCdlMu/OAawKIdFnXH6Z6Ma7LoQOPqOaAEZdXx1DAEi+WnkhUiDNrVpp+aJHUbMJkg8YJ YsYCT84aCZrIRAH13f2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQw-002cXu-9Y; Tue, 26 Oct 2021 17:40:22 +0000 Received: from mxout03.lancloud.ru ([45.84.86.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cQ5-JB for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:40:00 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 804B420617A8 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Krzysztof Kozlowski , , Subject: [PATCH v2 10/22] usb: host: ohci-exynos: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:31 +0300 Message-ID: <20211026173943.6829-11-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_898290_CAFEC7BB X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern --- Changes in version 2: - added Alan's ACK. 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 Tue Oct 26 17:39:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12585261 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 57B16C433FE for ; Tue, 26 Oct 2021 17:41:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BAE76103C for ; Tue, 26 Oct 2021 17:41:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1BAE76103C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kiVhhL/RSoE70vaJkDueFyXsK79xQaJhgcmd8eIoZxg=; b=BuvXxfKTN/Ve1Z jOfTiqxf23E4pKzeeuxzDeDd6eyxLfC1SHebyntcu23O6K5bFgGdMhe0oNf5Nuv4ljQRMNwL90OzJ dto3++ft3nGmj3dAJNVjoCoR9KCpdDTGkwhTJ7tzUFZaVBUuSm+42lHTrTQAnmrkRZooiV6XZza/h x0BrZEzURLJpNaxFBz7HdytQuPouM9RwGE6CMn+5VAUZ/qxKK9vYZeKoucdEgYaE9dZehJ9TIRpRb XrooI0WvOhAoeLITnKbljy9UOnqxD1LNHb/RRu9YR+tgbnHdt58Y8y+CW3EQp07iPHQedsV9BEbE/ 7Uvv09IqbmK4zE/lvxVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQb-002cTf-Hv; Tue, 26 Oct 2021 17:40:01 +0000 Received: from mxout04.lancloud.ru ([45.84.86.114]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQW-002cQ6-H2 for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:39:58 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru E338520A74C3 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Vladimir Zapolskiy , Subject: [PATCH v2 11/22] usb: host: ohci-nxp: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:32 +0300 Message-ID: <20211026173943.6829-12-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103956_764281_19533905 X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern Acked-by: Vladimir Zapolskiy --- Changes in version 2: - fixed the subject to match the patch; - added Alan's ACK. 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 Tue Oct 26 17:39:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12585267 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 D9A98C433F5 for ; Tue, 26 Oct 2021 17:42:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A982B61002 for ; Tue, 26 Oct 2021 17:42:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A982B61002 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=39rCzIUb81YFIK9wJ3Kb5hf4eG7tV9PU7ppys4E19fk=; b=CesufUHlxLYfWZ aaZRvmgTS9gSOM2umZWsu6cjKBnt1pe2XPLEBkCkmd80+deY7POq0vVsJFOQxvcX10XsZ8mDQxX04 PyGtNg0+nRbJiSQikGyd/Kfi39N2vblWECTbUncYwxLSXvpsz3DGN1gNMPzq/uoP86lJ8b6n27+jw xvQeBNNtKvB9v2VigREp+CV2fXC0otXbqBOTNu4KP0Dtu8kZx2FTeUtYJN6lkhts61rXSUXR6Pg4Z m/dCxSWeBmoVdw1MnWW8LQaQSpU4nZn3+YbkXVYCYoX1z+h7Wi29I2nxp0ZRlFJOP7/2Z0L+Vkyz3 ulVAIP5OLypwsEcBDLiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQRK-002cfg-EI; Tue, 26 Oct 2021 17:40:46 +0000 Received: from mxout03.lancloud.ru ([45.84.86.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQY-002cQZ-CR for linux-arm-kernel@lists.infradead.org; Tue, 26 Oct 2021 17:40:00 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 467E620617BC Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" CC: Patrice Chotard , Subject: [PATCH v2 17/22] usb: host: ohci-st: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:38 +0300 Message-ID: <20211026173943.6829-18-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103958_640256_3C333F03 X-CRM114-Status: GOOD ( 11.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Alan Stern Reviewed-by: Patrice Chotard --- Changes in version 2: - added Alan's ACK. 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 Tue Oct 26 17:39:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12585273 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 39D40C433EF for ; Tue, 26 Oct 2021 17:42:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02FBC604DA for ; Tue, 26 Oct 2021 17:42:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 02FBC604DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+IY1YoJfO/pV7DTRWsXGGUk+lBDifSpjTgs7rZ2TgjM=; b=rtwxb4olVlwMt4 7EWP8YwU0pzm6YaMVQ0EuEY+QQc7+aBNsaVUBKYvWEPUTtDuqvnAfvFc7dc6t2qmpcIuOdqT5KXmG MUjHHXUUBov6m082FKaOS0HIc5l+8kL7Lq7YSI2iouTjlPdS6qUFjzG5dZ1em7K/rYqu7ITcuTGTY Q4drNHYPxAOjXcNQxp4uBC+g0AIjbU4Qe9NWwDbNOFtRy1kohRZ93+jKW/wTuyDhQquZ/SIoGhgvC FG2l2t176vPRGcOYiMxQgiPVMnIrl2TbE8bd6Xw3fLRFZ5l5ozRipl691QCl07cBk6e4h6h66wuzT ZdWhbAHgepQ8nTi0AmeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQS2-002d2k-4X; Tue, 26 Oct 2021 17:41:30 +0000 Received: from mxout01.lancloud.ru ([45.84.86.81]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfQQY-002cQh-DU; Tue, 26 Oct 2021 17:40:01 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru B67452093220 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 v2 20/22] usb: host: xhci-mtk: deny IRQ0 Date: Tue, 26 Oct 2021 20:39:41 +0300 Message-ID: <20211026173943.6829-21-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211026173943.6829-1-s.shtylyov@omp.ru> References: <20211026173943.6829-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_103958_654615_7192F273 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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");