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)