All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: bhelgaas@google.com, lorenzo.pieralisi@arm.com,
	kbusch@kernel.org, hch@lst.de
Cc: linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	svarbanov@mm-sol.com, bjorn.andersson@linaro.org, axboe@fb.com,
	quic_vbadigan@quicinc.com, quic_krichai@quicinc.com,
	quic_nitirawa@quicinc.com, vidyas@nvidia.com, sagi@grimberg.me,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [PATCH 2/3] PCI: dwc: qcom: Set suspend_poweroff flag for SC7280
Date: Fri, 13 May 2022 16:30:26 +0530	[thread overview]
Message-ID: <20220513110027.31015-3-manivannan.sadhasivam@linaro.org> (raw)
In-Reply-To: <20220513110027.31015-1-manivannan.sadhasivam@linaro.org>

For aggressive power saving on SC7280 SoCs, the power for the PCI devices
will be taken off during system suspend. Hence, notify the same to the
PCI device drivers using "suspend_poweroff" flag so that the drivers can
prepare the PCI devices to handle the poweroff and recover them during
resume.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 6ab90891801d..4b0ad2827f8f 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -199,6 +199,7 @@ struct qcom_pcie_cfg {
 	unsigned int has_ddrss_sf_tbu_clk:1;
 	unsigned int has_aggre0_clk:1;
 	unsigned int has_aggre1_clk:1;
+	unsigned int suspend_poweroff:1;
 };
 
 struct qcom_pcie {
@@ -1220,6 +1221,10 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 	if (pcie->cfg->pipe_clk_need_muxing)
 		clk_set_parent(res->pipe_clk_src, res->ref_clk_src);
 
+	/* Indicate PCI device drivers that the power will be taken off during system suspend */
+	if (pcie->cfg->suspend_poweroff)
+		pci->pp.bridge->suspend_poweroff = true;
+
 	ret = clk_bulk_prepare_enable(res->num_clks, res->clks);
 	if (ret < 0)
 		goto err_disable_regulators;
@@ -1548,6 +1553,7 @@ static const struct qcom_pcie_cfg sc7280_cfg = {
 	.ops = &ops_1_9_0,
 	.has_tbu_clk = true,
 	.pipe_clk_need_muxing = true,
+	.suspend_poweroff = true,
 };
 
 static const struct dw_pcie_ops dw_pcie_ops = {
-- 
2.25.1


  parent reply	other threads:[~2022-05-13 11:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 11:00 [PATCH 0/3] PCI: Notify PCI drivers about powerdown during suspend Manivannan Sadhasivam
2022-05-13 11:00 ` [PATCH 1/3] PCI: Add a flag to notify " Manivannan Sadhasivam
2022-05-16 20:18   ` Bjorn Helgaas
2022-05-17 15:09     ` Manivannan Sadhasivam
2022-05-17 17:24       ` Bjorn Helgaas
2022-05-18  3:59         ` Manivannan Sadhasivam
2022-05-26 20:48     ` Rob Herring
2022-05-13 11:00 ` Manivannan Sadhasivam [this message]
2022-05-16 20:19   ` [PATCH 2/3] PCI: dwc: qcom: Set suspend_poweroff flag for SC7280 Bjorn Helgaas
2022-05-17 15:11     ` Manivannan Sadhasivam
2022-05-17 17:18       ` Bjorn Helgaas
2022-05-18  3:52         ` Manivannan Sadhasivam
2022-05-18 16:50           ` Bjorn Helgaas
2022-05-18  8:43     ` Christoph Hellwig
2022-05-13 11:00 ` [PATCH 3/3] nvme-pci: Make use of "suspend_poweroff" flag during system suspend Manivannan Sadhasivam
2022-05-16  5:44 ` [PATCH 0/3] PCI: Notify PCI drivers about powerdown during suspend Christoph Hellwig
2022-05-16 20:15 ` Bjorn Helgaas

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=20220513110027.31015-3-manivannan.sadhasivam@linaro.org \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=axboe@fb.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=quic_krichai@quicinc.com \
    --cc=quic_nitirawa@quicinc.com \
    --cc=quic_vbadigan@quicinc.com \
    --cc=sagi@grimberg.me \
    --cc=svarbanov@mm-sol.com \
    --cc=vidyas@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.