mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mrinmay Sarkar <mrinmay.sarkar@oss.qualcomm.com>
To: "Manivannan Sadhasivam" <mani@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Rama Krishna <rama.krishna@oss.qualcomm.com>,
	Nitesh Gupta <nitesh.gupta@oss.qualcomm.com>,
	Ayiluri Naga Rashmi <ayiluri.rashmi@oss.qualcomm.com>,
	Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>,
	Shazad Hussain <shazad.hussain@oss.qualcomm.com>,
	Mrinmay Sarkar <mrinmay.sarkar@oss.qualcomm.com>
Subject: [PATCH v2 2/2] PCI: qcom: Reinitialize MSI on resume for firmware-managed controllers
Date: Fri, 27 Nov 2026 20:10:50 +0530	[thread overview]
Message-ID: <20261127-pcie-controller-reset-v2-2-17467b64f5f5@oss.qualcomm.com> (raw)
In-Reply-To: <20261127-pcie-controller-reset-v2-0-17467b64f5f5@oss.qualcomm.com>

On firmware-managed PCIe controllers, hardware context is lost across
system suspend. While firmware reinitializes the controller through
the power domain framework during resume, the DesignWare MSI registers
are not preserved across the power cycle and must be reprogrammed by
the driver.

Reinitialize the DesignWare MSI configuration during resume for
firmware-managed controllers to restore MSI functionality after
the controller is power-cycled.

Signed-off-by: Mrinmay Sarkar <mrinmay.sarkar@oss.qualcomm.com>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index fe86b8fbc895..51299dfd574c 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -2325,6 +2325,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
 		bridge->msi_domain = true;
 		if (IS_ENABLED(CONFIG_PM_SLEEP))
 			bridge->reset_root_port = qcom_pcie_fw_reset_root_port;
+		dev_set_drvdata(dev, cfg);
 
 		ret = pci_host_probe(bridge);
 		if (ret)
@@ -2552,8 +2553,14 @@ static int qcom_pcie_resume_noirq(struct device *dev)
 	int ret;
 	const struct qcom_pcie_cfg *pcie_cfg = of_device_get_match_data(dev);
 
-	if (pcie_cfg && pcie_cfg->firmware_managed)
+	if (pcie_cfg && pcie_cfg->firmware_managed) {
+		struct pci_config_window *cfg = dev_get_drvdata(dev);
+
+		if (cfg && cfg->priv)
+			dw_pcie_msi_init(cfg->priv);
+
 		return 0;
+	}
 
 	pcie = dev_get_drvdata(dev);
 	if (!pcie)

-- 
2.43.0


      parent reply	other threads:[~2026-11-27 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 14:40 [PATCH v2 0/2] PCI: qcom: Add support for firmware-managed PCIe controller recovery Mrinmay Sarkar
2026-11-27 14:40 ` [PATCH v2 1/2] PCI: qcom: Implement .reset_root_port() for firmware-managed controllers Mrinmay Sarkar
2026-11-27 14:40 ` Mrinmay Sarkar [this message]

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=20261127-pcie-controller-reset-v2-2-17467b64f5f5@oss.qualcomm.com \
    --to=mrinmay.sarkar@oss.qualcomm.com \
    --cc=ayiluri.rashmi@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=krishna.chundru@oss.qualcomm.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=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=nitesh.gupta@oss.qualcomm.com \
    --cc=rama.krishna@oss.qualcomm.com \
    --cc=shazad.hussain@oss.qualcomm.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

all inboxes | Powered by JetHome®