From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: linux-pci@vger.kernel.org
Cc: jingoohan1@gmail.com, lpieralisi@kernel.org,
kwilczynski@kernel.org, mani@kernel.org, robh@kernel.org,
bhelgaas@google.com, krzk@kernel.org, peter.griffin@linaro.org,
alim.akhtar@samsung.com, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] PCI: exynos: Handle PHY initialization errors
Date: Thu, 29 Oct 2026 13:10:06 +0000 [thread overview]
Message-ID: <20261029131006.2744-1-sreekuttan2156239@gmail.com> (raw)
Check the return values of phy_init() and phy_power_on() to
avoid continuing PCIe host initialization when PHY setup fails.
If phy_power_on() fails, call phy_exit() to release the PHY
resources initialized by phy_init() before returning the error.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
drivers/pci/controller/dwc/pci-exynos.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c
index e3c05ade381b..5ad07c0be8e5 100644
--- a/drivers/pci/controller/dwc/pci-exynos.c
+++ b/drivers/pci/controller/dwc/pci-exynos.c
@@ -225,13 +225,21 @@ static int exynos_pcie_host_init(struct dw_pcie_rp *pp)
{
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
struct exynos_pcie *ep = to_exynos_pcie(pci);
+ int ret;
pp->bridge->ops = &exynos_pci_ops;
exynos_pcie_assert_core_reset(ep);
- phy_init(ep->phy);
- phy_power_on(ep->phy);
+ ret = phy_init(ep->phy);
+ if (ret)
+ return ret;
+
+ ret = phy_power_on(ep->phy);
+ if (ret) {
+ phy_exit(ep->phy);
+ return ret;
+ }
exynos_pcie_deassert_core_reset(ep);
exynos_pcie_enable_irq_pulse(ep);
--
2.55.0
next reply other threads:[~2026-10-29 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 13:10 Sreeraj S Kurup [this message]
2026-10-29 17:54 ` [PATCH v2] PCI: exynos: Handle PCIe " Sreeraj S Kurup
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=20261029131006.2744-1-sreekuttan2156239@gmail.com \
--to=sreekuttan2156239@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=bhelgaas@google.com \
--cc=jingoohan1@gmail.com \
--cc=krzk@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
/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
all inboxes | Powered by JetHome®