From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: "Vinod Koul" <vkoul@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Subject: [PATCH 2/5] PCI: dwc: Add support for retaining link during host init
Date: Fri, 09 Jan 2026 12:51:07 +0530 [thread overview]
Message-ID: <20260109-link_retain-v1-2-7e6782230f4b@oss.qualcomm.com> (raw)
In-Reply-To: <20260109-link_retain-v1-0-7e6782230f4b@oss.qualcomm.com>
Some platforms keep the PCIe link up across bootloader and kernel
handoff. In such cases, reinitializing the root complex is unnecessary
if the DWC glue drivers wants to retain the PCIe link.
Introduce a link_retain flag in struct dw_pcie_rp to indicate that
the link should be preserved. When this flag is set by DWC glue drivers,
skip dw_pcie_setup_rc() and only initialize MSI, avoiding redundant
configuration steps.
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 11 ++++++++---
drivers/pci/controller/dwc/pcie-designware.h | 1 +
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 372207c33a857b4c98572bb1e9b61fa0080bc871..d050df3f22e9507749a8f2fedd4c24fca43fb410 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -655,9 +655,14 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
if (ret)
goto err_free_msi;
- ret = dw_pcie_setup_rc(pp);
- if (ret)
- goto err_remove_edma;
+ if (!pp->link_retain) {
+ ret = dw_pcie_setup_rc(pp);
+ if (ret)
+ goto err_remove_edma;
+ } else {
+ dw_pcie_msi_init(pp);
+ }
+
if (!dw_pcie_link_up(pci)) {
ret = dw_pcie_start_link(pci);
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 31685951a080456b8834aab2bf79a36c78f46639..8acab751b66a06e8322e027ab55dc0ecfdcf634c 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -439,6 +439,7 @@ struct dw_pcie_rp {
struct pci_config_window *cfg;
bool ecam_enabled;
bool native_ecam;
+ bool link_retain;
};
struct dw_pcie_ep_ops {
--
2.34.1
next prev parent reply other threads:[~2026-01-09 7:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 7:21 [PATCH 0/5] PCI: qcom: Add link retention support Krishna Chaitanya Chundru
2026-01-09 7:21 ` [PATCH 1/5] phy: qcom: qmp-pcie: Skip PHY reset if already up Krishna Chaitanya Chundru
2026-01-09 9:23 ` Abel Vesa
2026-01-09 13:08 ` Dmitry Baryshkov
2026-01-09 13:10 ` Neil Armstrong
2026-01-09 14:03 ` Dmitry Baryshkov
2026-01-14 9:36 ` Vinod Koul
2026-02-16 14:53 ` Manivannan Sadhasivam
2026-02-16 14:56 ` Konrad Dybcio
2026-01-09 7:21 ` Krishna Chaitanya Chundru [this message]
2026-01-09 15:53 ` [PATCH 2/5] PCI: dwc: Add support for retaining link during host init Bjorn Helgaas
2026-01-12 11:29 ` Konrad Dybcio
2026-01-22 8:55 ` Krishna Chaitanya Chundru
2026-01-09 7:21 ` [PATCH 3/5] PCI: qcom: Keep PERST# GPIO state as-is during probe Krishna Chaitanya Chundru
2026-01-09 11:14 ` Konrad Dybcio
2026-02-16 14:58 ` Manivannan Sadhasivam
2026-01-09 7:21 ` [PATCH 4/5] PCI: qcom: Add link retention support Krishna Chaitanya Chundru
2026-02-16 15:08 ` Manivannan Sadhasivam
2026-01-09 7:21 ` [PATCH 5/5] PCI: qcom: enable Link retain logic for Hamoa Krishna Chaitanya Chundru
2026-01-09 13:09 ` Dmitry Baryshkov
2026-01-22 8:59 ` Krishna Chaitanya Chundru
2026-01-15 2:16 ` [PATCH 0/5] PCI: qcom: Add link retention support Qiang Yu
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=20260109-link_retain-v1-2-7e6782230f4b@oss.qualcomm.com \
--to=krishna.chundru@oss.qualcomm.com \
--cc=bhelgaas@google.com \
--cc=jingoohan1@gmail.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=vkoul@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