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 2913DCA0ED3 for ; Mon, 2 Sep 2024 07:42:05 +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:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yttwNUw7d3dDFgywga8u4jHUr7TP2Q6BQGVJkPnT8/Y=; b=o0dK6zXK5B+OQX5mFaEBb/8yIt mtAhRvRSBFcq19sfdxFgU6ZoJq9XOtF2HTAExg5KWIlhc+aPFGSGogIA5My5r3ajDyIWEg0lwTUvT 0A5qcb9sZgZe18VnO4RSU8HOUmLRjOYfcaTw8z4XcppqShU+stbWgIBrTgWynPA5fFpj/ppT5ZScu ybKlY5ursn8npyLzV2zwLt44cGUUCiJp2Okh/p7rgZ52/mXBOkE2vFYLFFfw+15z+ZkoB2ZvkusLO L6YOQ+5rZR5FQjGcCJCXPuqXxYSH+SvYSihzEn8zu3jH3inEnbunKV1XOxLpC0T2JV/Ul8nAlSEuM Ack2g3uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl1hB-0000000DLf9-1idw; Mon, 02 Sep 2024 07:41:53 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl1gI-0000000DLVN-2RRI for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 07:40:59 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-201d5af11a4so33702345ad.3 for ; Mon, 02 Sep 2024 00:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725262858; x=1725867658; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yttwNUw7d3dDFgywga8u4jHUr7TP2Q6BQGVJkPnT8/Y=; b=fIfwRjdxOYiVR+Yh43EP+6Z1sB64JOgrL+wy9M6uy3LjJMnlRw+i9ivzDhlzFFK7fT WFIH63OYRuhvD+fKv029PnM2PyDjKIJpEOVeRIbUd78QorzZjKJYBH704H83srn2rCOJ 5vrbU1Q5gk5ldq/npxngVfR4uz6lUdoLZ5hh83wjjbH9Zn1LAWJ+0+YDJ1DIqzsw/p5W aKiw6Z27QssCfBb67SugAxArpGN4vmQd/2mwj4PUY5dwXsEmWnIfUA1hXQw+L7fRinOt nPHukCCF46NsvxQ4g6mBZF0D7JzwPupbJyMvVryh7YiUJZeAG6Ts0pycykVNj/Qx4dDU VWYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725262858; x=1725867658; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yttwNUw7d3dDFgywga8u4jHUr7TP2Q6BQGVJkPnT8/Y=; b=m1jmqs3FjQC4HSbJanAQwYoAgdIV77KYeWbCaVQgZ+ymBB65wBq3NBnHdPOZWxdjsE czKfBI6CekaDHlnQ0erWNntqHZsuyD+mWpPOxo2OY9fxRWtWIr6KYbSe/vcCcvYPKpxY 1Imc7LeWejzswRSJQKzfDDM+GK44YKMjWs09nkOrQ39ZLo7HavWWGYOEZ25+l4WhXpuR 6b9Dq7+J/x91XbzQV426y69PFD3K5nE/siMOuGje5ieCFKgciLf9FefE25T7nCN/6awS IFl/tQh9eeFastNHdyjO0rUlN0HOHlutX5q5jM7+adC8RyQxbrG9O8SM1yhUpElHxkCT 1Tmw== X-Forwarded-Encrypted: i=1; AJvYcCXbVNuOh/krpnu488G7o0ffQB4WDFsmASVu9PWAVNYfuRbMx86q/oXpjCCQaVrx1cieDY+UoqLqmTX7I9egeL7o@lists.infradead.org X-Gm-Message-State: AOJu0Ywdu9ICpJ3EOGSrfr8djGCCVfUoWrvNtm4OD3xwr9Z+eZ6UfgPX eueMTrIp6ZRQp/5D7Amhaoh/7HbYOxJoFzZTgelhziCtGdXsbi+Nn4PcT0ZxuQ== X-Google-Smtp-Source: AGHT+IEQIMeGcVOrgzVo/cb19D0ZFZOM5enF/X/Dx2AucrfaI9oErKrbz2WEP3NOKD3AcRxNn08Tcg== X-Received: by 2002:a17:903:2348:b0:202:3469:2c78 with SMTP id d9443c01a7336-2054660159amr69405725ad.28.1725262857758; Mon, 02 Sep 2024 00:40:57 -0700 (PDT) Received: from thinkpad ([120.60.58.247]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-205155673a2sm61188095ad.303.2024.09.02.00.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 00:40:57 -0700 (PDT) Date: Mon, 2 Sep 2024 13:10:51 +0530 From: Manivannan Sadhasivam To: Siddharth Vadapalli Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, vigneshr@ti.com, kishon@kernel.org, j-keerthy@ti.com, linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, u-kumar1@ti.com, srk@ti.com Subject: Re: [PATCH 2/2] PCI: dra7xx: Fix error handling when IRQ request fails in probe Message-ID: <20240902074051.h7miwo6gazhjrgri@thinkpad> References: <20240827122422.985547-1-s-vadapalli@ti.com> <20240827122422.985547-3-s-vadapalli@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240827122422.985547-3-s-vadapalli@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_004058_644644_839B7FA5 X-CRM114-Status: GOOD ( 21.73 ) 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 Tue, Aug 27, 2024 at 05:54:22PM +0530, 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 Reviewed-by: Manivannan Sadhasivam - Mani > --- > 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); > -- > 2.40.1 > -- மணிவண்ணன் சதாசிவம்