devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Johan Hovold <johan@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Johan Hovold <johan+linaro@kernel.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>
Subject: Re: [PATCH 1/3] arm64: dts: qcom: sc8280xp: Fix PCIe PHY power-domains
Date: Fri, 29 Dec 2023 22:33:34 +0530	[thread overview]
Message-ID: <20231229170334.GA9098@thinkpad> (raw)
In-Reply-To: <ZY6sh8nlEUyEfL0u@hovoldconsulting.com>

On Fri, Dec 29, 2023 at 12:24:55PM +0100, Johan Hovold wrote:
> On Wed, Dec 27, 2023 at 11:28:26PM +0100, Konrad Dybcio wrote:
> > The PCIe GDSCs are only related to the RCs. The PCIe PHYs on the other
> > hand, are powered by VDD_MX and their specific VDDA_PHY/PLL regulators.
> 
> No, that does not seem to be entirely correct. I added the power-domains
> here precisely because they were needed to enable the PHYs.
> 
> This is something I stumbled over when trying to figure out how to
> add support for the second lane pair (i.e. four-lane mode), and I just
> went back and confirmed that this is still the case.
> 
> If you try to enable one of these PHYs without the corresponding GDSC
> being enabled, you end up with:
> 
> [   37.709324] ------------[ cut here ]------------
> [   37.718196] gcc_pcie_3b_aux_clk status stuck at 'off'
> [   37.718205] WARNING: CPU: 4 PID: 482 at drivers/clk/qcom/clk-branch.c:86 clk_branch_wait+0x144/0x15c
> 	

Technically this patch is correct. PHYs are backed by MX domain only and not
GDSCs. Only the controllers (PCIe, UFS, USB) are backed by GDSCs. The fact that
you are seeing issue with PCIe Aux clock suggests me that this clock may not be
applicable to the PHY but it needs to be enabled for working of the PHY somehow.
I'll try to find the details on how exactly it is needed.

But if I get the answer like, "This clock is also sourced to PHY directly", then
we may need to add dual power domain for PHY (both GDSC and MX).

> Now, you may or may not want to describe the above in the devicetree,
> but this makes it sound like you're trying to work around an issue with
> the current Linux implementation.
> 

Adding MX domain to PHY in devicetree is definitely not a workaround. It is the
actual hardware representation. MX is the always on domain, and when CX collapse
happens during suspend state, it will ensure that all the analog components
(like PHY) are kept powered on. Otherwise, we will see link down issues.

But, I heard from Qcom that _only_ on this platform, MX is not backing the PCIe
PHY. I can correlate that with my encounter with PCIe issues after forcing CX
power collapse.

I haven't looked in detail on how this series fixes that issue though.

- Mani

> > Fix the power-domains assignment to stop potentially toggling the GDSC
> > unnecessarily.
> 
> Nothing is being toggled unnecessarily, and generally this is just
> another use count increment.
> 
> > Fixes: 813e83157001 ("arm64: dts: qcom: sc8280xp/sa8540p: add PCIe2-4 nodes")
> 
> So not sure a Fixes tag is warranted either.
> 
> > @@ -1895,7 +1895,7 @@ pcie3b_phy: phy@1c0e000 {
> >  			assigned-clocks = <&gcc GCC_PCIE3B_PHY_RCHNG_CLK>;
> >  			assigned-clock-rates = <100000000>;
> >  
> > -			power-domains = <&gcc PCIE_3B_GDSC>;
> > +			power-domains = <&rpmhpd SC8280XP_MX>;
> >  
> >  			resets = <&gcc GCC_PCIE_3B_PHY_BCR>;
> >  			reset-names = "phy";
> 
> Johan
> 

-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2023-12-29 17:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 22:28 [PATCH 0/3] SC8280XP preparatory PCIe fixes Konrad Dybcio
2023-12-27 22:28 ` [PATCH 1/3] arm64: dts: qcom: sc8280xp: Fix PCIe PHY power-domains Konrad Dybcio
2023-12-29 11:24   ` Johan Hovold
2023-12-29 13:08     ` Konrad Dybcio
2023-12-29 13:20       ` Johan Hovold
2023-12-29 17:03     ` Manivannan Sadhasivam [this message]
2023-12-30 12:28       ` Konrad Dybcio
2024-01-02  9:05       ` Johan Hovold
2024-01-22 17:25       ` Manivannan Sadhasivam
2024-01-22 17:36         ` Johan Hovold
2024-01-23 17:06           ` Manivannan Sadhasivam
2024-01-23 18:41             ` Konrad Dybcio
2024-01-24  7:31             ` Johan Hovold
2023-12-27 22:28 ` [PATCH 2/3] arm64: dts: qcom: sc8280xp: Correct USB PHY power domains Konrad Dybcio
2023-12-29 13:01   ` Johan Hovold
2023-12-29 13:06     ` Konrad Dybcio
2023-12-29 13:25       ` Johan Hovold
2023-12-29 15:05         ` Konrad Dybcio
2023-12-29 15:43           ` Johan Hovold
2023-12-29 17:10     ` Manivannan Sadhasivam
2024-01-02  8:55       ` Johan Hovold
2023-12-27 22:28 ` [PATCH 3/3] arm64: dts: qcom: sc8280xp-crd: Add PCIe CLKREQ# sleep state Konrad Dybcio
2023-12-29 12:55   ` Johan Hovold
2023-12-30 14:11     ` Konrad Dybcio
2023-12-29 17:14   ` Manivannan Sadhasivam
2023-12-30 14:10     ` Konrad Dybcio

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=20231229170334.GA9098@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=johan@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=robh+dt@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).