devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@linaro.org>,
	cros-qcom-dts-watchers@chromium.org,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	andersson@kernel.org, quic_vbadigan@quicinc.com,
	linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v2 7/8] PCI: qcom: Add support for host_stop_link() & host_start_link()
Date: Tue, 6 Aug 2024 14:12:03 -0500	[thread overview]
Message-ID: <20240806191203.GA73014@bhelgaas> (raw)
In-Reply-To: <20240803-qps615-v2-7-9560b7c71369@quicinc.com>

On Sat, Aug 03, 2024 at 08:52:53AM +0530, Krishna chaitanya chundru wrote:
> For the switches like QPS615 which needs to configure it before
> the PCIe link is established.
> 
> if the link is not up assert the PERST# and disable LTSSM bit so
> that PCIe controller will not participate in the link training
> as part of host_stop_link().
> 
> De-assert the PERST# and enable LTSSM bit back in host_start_link().
> 
> Introduce ltssm_disable function op to stop the link training.

pcie-qcom.c is a driver for a PCIe host controller.  Apparently QPS615
is a switch in a hierarchy that could be below any PCIe host
controller, so I'm missing the connection with pcie-qcom.c.

Does this fix a problem that only occurs with pcie-qcom.c?  What
happens if you put a QPS615 below some other controller?

> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> ---
>  drivers/pci/controller/dwc/pcie-qcom.c | 39 ++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 0180edf3310e..f4a6df53139c 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -233,6 +233,7 @@ struct qcom_pcie_ops {
>  	void (*host_post_init)(struct qcom_pcie *pcie);
>  	void (*deinit)(struct qcom_pcie *pcie);
>  	void (*ltssm_enable)(struct qcom_pcie *pcie);
> +	void (*ltssm_disable)(struct qcom_pcie *pcie);
>  	int (*config_sid)(struct qcom_pcie *pcie);
>  };
>  
> @@ -555,6 +556,41 @@ static int qcom_pcie_post_init_1_0_0(struct qcom_pcie *pcie)
>  	return 0;
>  }
>  
> +static int qcom_pcie_host_start_link(struct dw_pcie *pci)
> +{
> +	struct qcom_pcie *pcie = to_qcom_pcie(pci);
> +
> +	if (!dw_pcie_link_up(pcie->pci))  {
> +		qcom_ep_reset_deassert(pcie);
> +
> +		if (pcie->cfg->ops->ltssm_enable)
> +			pcie->cfg->ops->ltssm_enable(pcie);
> +	}
> +
> +	return 0;
> +}
> +
> +static void qcom_pcie_host_stop_link(struct dw_pcie *pci)
> +{
> +	struct qcom_pcie *pcie = to_qcom_pcie(pci);
> +
> +	if (!dw_pcie_link_up(pcie->pci))  {
> +		qcom_ep_reset_assert(pcie);
> +
> +		if (pcie->cfg->ops->ltssm_disable)
> +			pcie->cfg->ops->ltssm_disable(pcie);
> +	}
> +}
> +
> +static void qcom_pcie_2_3_2_ltssm_disable(struct qcom_pcie *pcie)
> +{
> +	u32 val;
> +
> +	val = readl(pcie->parf + PARF_LTSSM);
> +	val &= ~LTSSM_EN;
> +	writel(val, pcie->parf + PARF_LTSSM);
> +}
> +
>  static void qcom_pcie_2_3_2_ltssm_enable(struct qcom_pcie *pcie)
>  {
>  	u32 val;
> @@ -1306,6 +1342,7 @@ static const struct qcom_pcie_ops ops_1_9_0 = {
>  	.host_post_init = qcom_pcie_host_post_init_2_7_0,
>  	.deinit = qcom_pcie_deinit_2_7_0,
>  	.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
> +	.ltssm_disable = qcom_pcie_2_3_2_ltssm_disable,
>  	.config_sid = qcom_pcie_config_sid_1_9_0,
>  };
>  
> @@ -1363,6 +1400,8 @@ static const struct qcom_pcie_cfg cfg_sc8280xp = {
>  static const struct dw_pcie_ops dw_pcie_ops = {
>  	.link_up = qcom_pcie_link_up,
>  	.start_link = qcom_pcie_start_link,
> +	.host_start_link = qcom_pcie_host_start_link,
> +	.host_stop_link = qcom_pcie_host_stop_link,
>  };
>  
>  static int qcom_pcie_icc_init(struct qcom_pcie *pcie)
> 
> -- 
> 2.34.1
> 

  reply	other threads:[~2024-08-06 19:12 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-03  3:22 [PATCH v2 0/8] PCI: Enable Power and configure the QPS615 PCIe switch Krishna chaitanya chundru
2024-08-03  3:22 ` [PATCH v2 1/8] dt-bindings: PCI: Add binding for qps615 Krishna chaitanya chundru
2024-08-03  4:33   ` Rob Herring (Arm)
2024-08-03 11:00   ` Dmitry Baryshkov
2024-08-05  4:16     ` Krishna Chaitanya Chundru
2024-08-04  8:53   ` Krzysztof Kozlowski
2024-08-05  4:11     ` Krishna Chaitanya Chundru
2024-08-05  5:14       ` Krzysztof Kozlowski
2024-08-05  5:26         ` Krishna Chaitanya Chundru
2024-08-05  5:28           ` Krzysztof Kozlowski
2024-08-05  5:57             ` Krishna Chaitanya Chundru
2024-08-05 14:43               ` Krzysztof Kozlowski
2024-08-22 14:16                 ` Manivannan Sadhasivam
2024-08-23  9:01                   ` Krzysztof Kozlowski
2024-08-23  9:44                     ` Manivannan Sadhasivam
2024-08-23 13:51                       ` Krzysztof Kozlowski
2024-08-23 15:11                         ` Manivannan Sadhasivam
2024-08-05 17:07       ` Bjorn Andersson
2024-08-05 17:18         ` Krzysztof Kozlowski
2024-08-08 12:01           ` Manivannan Sadhasivam
2024-08-08 12:13             ` Krzysztof Kozlowski
2024-08-08 12:41               ` Manivannan Sadhasivam
2024-08-08 13:06                 ` Krzysztof Kozlowski
2024-08-08 13:29                   ` Manivannan Sadhasivam
2024-08-22 14:09                   ` Manivannan Sadhasivam
2024-08-23  9:06                     ` Krzysztof Kozlowski
2024-08-23  9:40                       ` Manivannan Sadhasivam
2024-08-04  8:56   ` Krzysztof Kozlowski
2024-08-05  4:02     ` Krishna Chaitanya Chundru
2024-08-05  5:12       ` Krzysztof Kozlowski
2024-08-05  5:33         ` Krishna Chaitanya Chundru
2024-08-05 16:39         ` Bjorn Andersson
2024-08-05 16:58           ` Krzysztof Kozlowski
2024-08-03  3:22 ` [PATCH v2 2/8] dt-bindings: trivial-devices: Add qcom,qps615 Krishna chaitanya chundru
2024-08-04  8:50   ` Krzysztof Kozlowski
2024-08-05  4:11     ` Krishna Chaitanya Chundru
2024-08-03  3:22 ` [PATCH v2 3/8] arm64: dts: qcom: qcs6490-rb3gen2: Add node for qps615 Krishna chaitanya chundru
2024-08-04  8:54   ` Krzysztof Kozlowski
2024-08-05  4:14     ` Krishna Chaitanya Chundru
2024-09-09 11:29   ` Caleb Connolly
2024-09-09 11:51     ` Krishna Chaitanya Chundru
2024-09-09 12:54       ` Dmitry Baryshkov
2024-08-03  3:22 ` [PATCH v2 4/8] PCI: Change the parent to correctly represent pcie hierarchy Krishna chaitanya chundru
2024-08-06 19:07   ` Bjorn Helgaas
2024-08-06 20:06     ` Bartosz Golaszewski
2024-08-13 19:15   ` Bartosz Golaszewski
2024-08-22 19:28     ` Bjorn Helgaas
2024-08-22 20:01       ` Bartosz Golaszewski
2024-08-22 21:13         ` Bjorn Helgaas
2024-08-23  8:30           ` Manivannan Sadhasivam
2024-08-23  8:31             ` Bartosz Golaszewski
2024-08-23  7:23   ` Manivannan Sadhasivam
2024-08-03  3:22 ` [PATCH v2 5/8] PCI: Add new start_link() & stop_link function ops Krishna chaitanya chundru
2024-08-03  3:22 ` [PATCH v2 6/8] PCI: dwc: Add support for new pci function op Krishna chaitanya chundru
2024-08-03  3:22 ` [PATCH v2 7/8] PCI: qcom: Add support for host_stop_link() & host_start_link() Krishna chaitanya chundru
2024-08-06 19:12   ` Bjorn Helgaas [this message]
2024-09-02  6:51     ` Krishna Chaitanya Chundru
2024-09-02 18:32       ` Dmitry Baryshkov
2024-08-03  3:22 ` [PATCH v2 8/8] PCI: pwrctl: Add power control driver for qps615 Krishna chaitanya chundru
2024-08-03 11:34   ` Dmitry Baryshkov
2024-08-05  6:14     ` Krishna Chaitanya Chundru
2024-08-08  3:30       ` Dmitry Baryshkov
2024-09-02  7:12         ` Krishna Chaitanya Chundru
2024-09-02  7:20           ` Dmitry Baryshkov
2024-09-02  8:31             ` Krishna Chaitanya Chundru
2024-09-02 10:12               ` Dmitry Baryshkov
2024-09-02 10:47                 ` Krishna Chaitanya Chundru
2024-09-02 18:37                   ` Dmitry Baryshkov
2024-10-17 15:47                     ` Krishna Chaitanya Chundru
2024-10-17 16:24                       ` Dmitry Baryshkov
2024-08-03 10:56 ` [PATCH v2 0/8] PCI: Enable Power and configure the QPS615 PCIe switch Dmitry Baryshkov
2024-08-05  4:19   ` Krishna Chaitanya Chundru
2024-08-04  8:57 ` Krzysztof Kozlowski
2024-08-05  4:18   ` Krishna Chaitanya Chundru
2024-08-05  4:34 ` Krishna Chaitanya Chundru
2024-08-05 15:00 ` Rob Herring (Arm)
2024-08-06 15:24 ` Ilpo Järvinen

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=20240806191203.GA73014@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=cros-qcom-dts-watchers@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=quic_krichai@quicinc.com \
    --cc=quic_vbadigan@quicinc.com \
    --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;
as well as URLs for NNTP newsgroup(s).