From patchwork Tue Aug 27 12:24:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13779443 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D7D15C54735 for ; Tue, 27 Aug 2024 12:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=sO3DIbNT467egR5G/HnowhddSJHnw0sif6k+DnCg3s8=; b=SVQjFKS597BCCQ0MuTtF5iozHd +XnnZ1ybcikmtqNrYkFHbAAKRUpZQhAZpBi7qBfP6Pfh+mzQ+bBi9GeARKzLpX+I2CWw8dlRckxYD ZLSlL4Vtd/W2qF+9b7XBaZMDwxqsj4aHksK7MgSkZ1ctJly7ioz4h+bT30J1z2ZjZNVlTjbY2Hci8 1xuXBsDtM9m+1LVmoXc7i7uF5pQZsepdCo3BvTGw34xkiOt7tCzAyEEAFQMHFQ0HC9sX47vByoJyQ u0OjohzwFv+zqxtDxltGE9J9UtXXqRvRfP8c35fpEDa2ihTHJwyhWMxBBBf4HVXuD7pB9kMhRM02S ydSRNGaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sivGY-0000000BD2R-1zVB; Tue, 27 Aug 2024 12:25:42 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sivFj-0000000BCnJ-215R for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 12:24:52 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47RCOYgn036679; Tue, 27 Aug 2024 07:24:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1724761474; bh=sO3DIbNT467egR5G/HnowhddSJHnw0sif6k+DnCg3s8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=QKqi8h4W+IFdQfxLJrFhBzHnt6rxz3qT0uyy5vYRvh18Zl4nqh2Lkge8MaVf9Ci9P l5IBFVJBTeqFMri39mGP2BGf996j0TxwvbxHGb/LXRCfRWlChebn+Ao8OKjuw8qb4U f6vKBay8cjpnTuHcYX3ofzJx59CPlbd4lbzhDKXI= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47RCOYKB025983 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Aug 2024 07:24:34 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 27 Aug 2024 07:24:33 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 27 Aug 2024 07:24:34 -0500 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [10.24.72.81]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47RCONYD011388; Tue, 27 Aug 2024 07:24:29 -0500 From: Siddharth Vadapalli To: , , , , , , , CC: , , , , , , , Subject: [PATCH 1/2] PCI: dra7xx: Fix threaded IRQ request for "dra7xx-pcie-main" IRQ Date: Tue, 27 Aug 2024 17:54:21 +0530 Message-ID: <20240827122422.985547-2-s-vadapalli@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240827122422.985547-1-s-vadapalli@ti.com> References: <20240827122422.985547-1-s-vadapalli@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_052451_627628_3771F32C X-CRM114-Status: GOOD ( 12.43 ) 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 Commit da87d35a6e51 ("PCI: dra7xx: Use threaded IRQ handler for "dra7xx-pcie-main" IRQ") switched from devm_request_irq() to devm_request_threaded_irq() for the "dra7xx-pcie-main" interrupt. Since the primary handler was set to NULL, the "IRQF_ONESHOT" flag should have also been set. Fix this. Fixes: da87d35a6e51 ("PCI: dra7xx: Use threaded IRQ handler for "dra7xx-pcie-main" IRQ") Cc: Reported-by: Udit Kumar Suggested-by: Vignesh Raghavendra Signed-off-by: Siddharth Vadapalli Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-dra7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index 4fe3b0cb72ec..20fb50741f3d 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -850,7 +850,8 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) dra7xx->mode = mode; ret = devm_request_threaded_irq(dev, irq, NULL, dra7xx_pcie_irq_handler, - IRQF_SHARED, "dra7xx-pcie-main", dra7xx); + IRQF_SHARED | IRQF_ONESHOT, + "dra7xx-pcie-main", dra7xx); if (ret) { dev_err(dev, "failed to request irq\n"); goto err_gpio; From patchwork Tue Aug 27 12:24:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13779445 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EF335C54735 for ; Tue, 27 Aug 2024 12:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=Jxki9UuRPZGgt+9UKSYU76B9FROiegSaoeKr9g9BOz4=; b=U7GPOTCT5OMyFblUsN0U3sJZvJ zmOvLzzEvM+LjPY5wMV0S0XRS4/k5ZFpz+AgDxsiBlE2Px4OmkBkRyzaYRNUt7mfKhRMqt2p4cBry N8ensi/5oTprw7hBdq1sxQVPpDoHfJ6NYzNTKTjcWWb/DyzANmuB4iyiC8Bilu3AVFaU6frnMLwZg 22Nf24cXd6Ih/m2tW4Op+t+e6aGeHiykbtG9eYzge0Hgp15UtNv0YJxdT8ZwggHIO890vN4haKBy+ FWX/Rk3qiFWC5rGvd4do+xJ6/Nl1HhK+shBV63WcE+7zXmj1QIPsKvKncIuZ1Rp96+PiDWaqKAH7o n/D7thOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sivI8-0000000BDaO-2E7Z; Tue, 27 Aug 2024 12:27:20 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sivFm-0000000BCot-2kAB for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 12:24:55 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47RCOecH092068; Tue, 27 Aug 2024 07:24:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1724761480; bh=Jxki9UuRPZGgt+9UKSYU76B9FROiegSaoeKr9g9BOz4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aKG8e5HmJLcG0AdEFGK6Nx9YhpT/Jn6ycieCkLnedh8WtcxdRnwzOcA+hbwjJAOrp W/cvjWzlWtbrjXA8iFltjB/5sqZT++5bL7cttTSO8lcGxnrakYgZdbSYwDo1Z4h0Ft 5eMOs6jNZ5ZKqbzmhcxbssiCJsX+fmnQkHYnWTN4= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47RCOeL7051182 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Aug 2024 07:24:40 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 27 Aug 2024 07:24:39 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 27 Aug 2024 07:24:40 -0500 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [10.24.72.81]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47RCONYE011388; Tue, 27 Aug 2024 07:24:34 -0500 From: Siddharth Vadapalli To: , , , , , , , CC: , , , , , , , Subject: [PATCH 2/2] PCI: dra7xx: Fix error handling when IRQ request fails in probe Date: Tue, 27 Aug 2024 17:54:22 +0530 Message-ID: <20240827122422.985547-3-s-vadapalli@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240827122422.985547-1-s-vadapalli@ti.com> References: <20240827122422.985547-1-s-vadapalli@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_052454_802118_09EFB568 X-CRM114-Status: GOOD ( 13.84 ) 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 Commit d4c7d1a089d6 ("PCI: dwc: dra7xx: Push request_irq() call to the bottom of probe") moved the IRQ request for "dra7xx-pcie-main" towards the end of dra7xx_pcie_probe(). However, the error handling does not take into account the initialization performed by either dra7xx_add_pcie_port() or dra7xx_add_pcie_ep(), depending on the mode of operation. Fix the error handling to address this. Fixes: d4c7d1a089d6 ("PCI: dwc: dra7xx: Push request_irq() call to the bottom of probe") Cc: Signed-off-by: Siddharth Vadapalli Tested-by: Udit Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-dra7xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index 20fb50741f3d..5c62e1a3ba52 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -854,11 +854,17 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) "dra7xx-pcie-main", dra7xx); if (ret) { dev_err(dev, "failed to request irq\n"); - goto err_gpio; + goto err_deinit; } return 0; +err_deinit: + if (dra7xx->mode == DW_PCIE_RC_TYPE) + dw_pcie_host_deinit(&dra7xx->pci->pp); + else + dw_pcie_ep_deinit(&dra7xx->pci->ep); + err_gpio: err_get_sync: pm_runtime_put(dev);