From mboxrd@z Thu Jan 1 00:00:00 1970 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 F27DEC54734 for ; Tue, 27 Aug 2024 14:02:56 +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-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ZEIfkkxyG9bAFYtC9wPW17DasVSTlWqXzVbnjgOKhY=; b=h9alIdIT1FVKYRVOAb/wq0Rucs utm7BP8yZdFTSAQ9t06nRoizIJN1b0nVZQoEPSrHRmnfuhHpviQfvuLX4W1xB1zLzdJD0oKHygxXR IzL7u+XydjcCMRCVbar/YS2XS/Bi8whuvLvDki72BgTpn1JHyhEVMmek2VfTbYmNmI7Q+M62BAjTq JehAA5Cnga4usNHy05ZF6uEbKUtkBrIhq6tYLk3gdsDyb4QxZrqsLgzDIXhlRIs80c5ZwNbRI1Y1p v3IcRjtrOsuaYRpmjEztHI0TXarYOVFfcnyCuoxvcGv/L0Th4EZ3zABqlsbt9NExNDY6nIJFU2yE9 iNu+VJsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siwmS-0000000BZ4K-3Ggz; Tue, 27 Aug 2024 14:02:44 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siwl5-0000000BYf7-3CzW for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 14:01:21 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47RE0puQ039507; Tue, 27 Aug 2024 09:00:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1724767251; bh=9ZEIfkkxyG9bAFYtC9wPW17DasVSTlWqXzVbnjgOKhY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=cCa9/KYCU5ZxksszyLamCdcrMtXjwHslW0JHn0OkEWEzAAH47H9zHJ6BNOoL1RwtE 32aI6DvEXc2o6BCqhIHIod4XbQr4lvouII8ZAtrVI8010hWpZO5RoAiVU/9sv0ry5M pVnFx2Gpl5nh2FA2aAfasRNodzooMa08NRmmp488= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47RE0p1f108182 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Aug 2024 09:00:51 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) 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 09:00:51 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE112.ent.ti.com (10.64.6.33) 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 09:00:51 -0500 Received: from [10.249.141.75] ([10.249.141.75]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47RE0kO8115169; Tue, 27 Aug 2024 09:00:47 -0500 Message-ID: <6843a1b4-e331-435d-9cc7-9b457955d3cd@ti.com> Date: Tue, 27 Aug 2024 19:30:45 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] PCI: dra7xx: Fix error handling when IRQ request fails in probe To: Siddharth Vadapalli , , , , , , , , CC: , , , , , References: <20240827122422.985547-1-s-vadapalli@ti.com> <20240827122422.985547-3-s-vadapalli@ti.com> Content-Language: en-US From: "Kumar, Udit" In-Reply-To: <20240827122422.985547-3-s-vadapalli@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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_070120_157163_124C83FB X-CRM114-Status: GOOD ( 19.02 ) 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 On 8/27/2024 5:54 PM, Siddharth Vadapalli wrote: > 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 > --- > 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); dw_pcie_ep_deinit may not be available in previous kernels Otherwise Tested-by: Udit Kumar > + > err_gpio: > err_get_sync: > pm_runtime_put(dev);