From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: <bhelgaas@google.com>, <lpieralisi@kernel.org>, <kw@linux.com>,
<robh@kernel.org>, <vigneshr@ti.com>, <kishon@kernel.org>,
<manivannan.sadhasivam@linaro.org>, <j-keerthy@ti.com>
Cc: <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>, <s-vadapalli@ti.com>
Subject: [PATCH 2/2] PCI: dra7xx: Fix error handling when IRQ request fails in probe
Date: Tue, 27 Aug 2024 17:54:22 +0530 [thread overview]
Message-ID: <20240827122422.985547-3-s-vadapalli@ti.com> (raw)
In-Reply-To: <20240827122422.985547-1-s-vadapalli@ti.com>
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: <stable@vger.kernel.org>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
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
next prev parent reply other threads:[~2024-08-27 12:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 12:24 [PATCH 0/2] Fixes for the PCI dra7xx driver Siddharth Vadapalli
2024-08-27 12:24 ` [PATCH 1/2] PCI: dra7xx: Fix threaded IRQ request for "dra7xx-pcie-main" IRQ Siddharth Vadapalli
2024-09-02 7:33 ` Manivannan Sadhasivam
2024-08-27 12:24 ` Siddharth Vadapalli [this message]
2024-08-27 14:00 ` [PATCH 2/2] PCI: dra7xx: Fix error handling when IRQ request fails in probe Kumar, Udit
2024-09-02 7:40 ` Manivannan Sadhasivam
2024-08-30 19:50 ` [PATCH 0/2] Fixes for the PCI dra7xx driver Kevin Hilman
2024-09-13 22:51 ` Krzysztof Wilczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240827122422.985547-3-s-vadapalli@ti.com \
--to=s-vadapalli@ti.com \
--cc=bhelgaas@google.com \
--cc=j-keerthy@ti.com \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=robh@kernel.org \
--cc=srk@ti.com \
--cc=stable@vger.kernel.org \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox