Message ID | 20231227-topic-8280_pcie_dts-v1-1-13d12b1698ff@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1695623dyb; Wed, 27 Dec 2023 14:29:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGurmgAh/Py1QLppVh9w7STAfjJUfatyLlf1FghrpubgNIkiHhxAN7dcjut2ew4f8ONu0Z0 X-Received: by 2002:a05:6a20:2590:b0:196:4b1f:a9c2 with SMTP id k16-20020a056a20259000b001964b1fa9c2mr57643pzd.89.1703716152973; Wed, 27 Dec 2023 14:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703716152; cv=none; d=google.com; s=arc-20160816; b=zG9deNN9Rw5CPxB0hbzWjISSqO5Go71clM5i0sviFtpRRw1MPC7ZoKM1k9qVozqQkb jDQJhk4UUYPzjseTInO/CogmJenbyrLaA80eTUsJKh6ObnzxFHAIbNwlQFBgoDcKQq19 B6TR+W86xUxxcDw53wJRk3yJf5iRFJT4bGO8g4fSHJ7v4JPUnIDpaLrbkP1dMu/pzj2Y UEpB1jyMQAW6CUu8AM3lo1JQhrEmgVGZVdg5Kroj3kfvctbUzb6RCF+azf7ho4b/EbNs di5jxeD6JMm5M8pMOpvyl21xiyyT2+3kKTNtXKARZF+D3sqy1VDR5Apzbb/z/oGVQPXl O0Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=JWBf1IzDI4te1Z7yJaMLFE48TcXMDUCVA44V+FdpVh4=; fh=KLeS/c16yOJ1FS6Ho4w0J6IIxO2ziXCSDgX2W9R+at0=; b=hWD+YRwu4pTS8DircSHOiaXa5h+EyCTS9vD2QkHgIDDV2K9DI4s3/07A+8DkfaIBFH +wGoDJ0cUphzvB81Bw1zfMfeODlL/iiDkzvSHiqghNi9zVW3yK0ow6LRDxqCgo4XMf/b HDz/ta6YVzp7ZoXVhyrpAYfE7YHHoY81ngV7gVLZ9EQHxKdlzF1FVTXyw2C/pgytHMaI KRJszDccVUjk0sUz6ZX37A5MIR31muWdPz2z9iND54iNsmLB08kexnCqdYsCbZ3E5zOO YzFVuLJ+sqeI3fZRhU1OdJpbLb2H+xKTFDByZG9uIyJCNq6ZB5ggPUhcp6a1q6tfQ9Oz sLfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yH2Gd9ys; spf=pass (google.com: domain of linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ji10-20020a170903324a00b001d316a87161si11430042plb.161.2023.12.27.14.29.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 14:29:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yH2Gd9ys; spf=pass (google.com: domain of linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12295-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 744FAB2141F for <ouuuleilei@gmail.com>; Wed, 27 Dec 2023 22:29:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B8C249F84; Wed, 27 Dec 2023 22:28:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yH2Gd9ys" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29F2F4988B for <linux-kernel@vger.kernel.org>; Wed, 27 Dec 2023 22:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40d5ae89c72so16952765e9.2 for <linux-kernel@vger.kernel.org>; Wed, 27 Dec 2023 14:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703716112; x=1704320912; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JWBf1IzDI4te1Z7yJaMLFE48TcXMDUCVA44V+FdpVh4=; b=yH2Gd9yskgZMRRwSw8ak+G4cdUbiIE0tBLQSDLz03v8ILNkDUI3a5US1Do2G6vPcQL 2fivac16cWoQn3D7IHvUJw6OvA1PH9fe+0Z5lIsZ4VlkKB1B4Pscrn+KsY/JhQjF73di oHjSsrBAQf3Wx3b82cdpTJgbekWD3jV7+0cY2fKvDPhPDoAuewOmeafholg/5yYoT8ZT 11y9EMvIpyFbuzPNlyHWilFhSSBvtxMQSOO0QCiZGjx+ZlewcOgzJ1cxBRlz7pZq61gB 1Y1bOzHDXOdAeDJAe5flDoARjOVsrBqvtRuySpwSGGeN5UALHiGoPK+Kv9xh99sNP8QQ MopA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703716112; x=1704320912; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JWBf1IzDI4te1Z7yJaMLFE48TcXMDUCVA44V+FdpVh4=; b=jC2uMpi5vnPHt6K74Y+xSZowB82yWKqauQ2uUUNXTYR/sT7W1+/5iI/SRNiXjMqRyr kGqNfBbZasAoVMOYF+PICxhJOORG2eRkw+6wGHsaMDLKvFZv2A1H9EZfxTSE/W+JX2Rl 6tfrhbtqUng09fS3jDPcwZYVBoP1EVIHnIuhiZKSuqA8E3u7IZISEYxXQ7cJUV+t+Sk4 358M2SWwZ6up1n1kgEy5FKGsQIUAVh1TvbtZZrgwDN2ozvWoS3fBzwpkpilBoO3zMtXP gpBVmrr2V6cg6Va5fiLqpqAzza8siC6yJOQIWu1pstuJyiz0y32/PY5pz6x2LvZ/tmK2 v6mg== X-Gm-Message-State: AOJu0Yyzul0xnPKl/9TixmRXq5Vv2pZ7iab4KKYFEvciY92A87WrUnRk 94M6beNrRMNgejCIfnMH96mltJ8I4qwPng== X-Received: by 2002:a7b:cbc5:0:b0:40d:6221:868f with SMTP id n5-20020a7bcbc5000000b0040d6221868fmr186298wmi.279.1703716112496; Wed, 27 Dec 2023 14:28:32 -0800 (PST) Received: from [10.167.154.1] (178235179028.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.28]) by smtp.gmail.com with ESMTPSA id fb20-20020a1709073a1400b00a26a061ae1esm6854252ejc.97.2023.12.27.14.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 14:28:32 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> Date: Wed, 27 Dec 2023 23:28:26 +0100 Subject: [PATCH 1/3] arm64: dts: qcom: sc8280xp: Fix PCIe PHY power-domains Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231227-topic-8280_pcie_dts-v1-1-13d12b1698ff@linaro.org> References: <20231227-topic-8280_pcie_dts-v1-0-13d12b1698ff@linaro.org> In-Reply-To: <20231227-topic-8280_pcie_dts-v1-0-13d12b1698ff@linaro.org> To: 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> Cc: 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>, Konrad Dybcio <konrad.dybcio@linaro.org> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1703716109; l=2255; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=kMvRAvWfpP/DEkU3LU/WsYqL/aUkUp2LCfdAhZy7cI4=; b=on07lEwMe5d6HDnWJbd3ihCw4sDHjf6qoR6QPRX9iQ0Vnh0ruqYLUNj+EZc5bK1Y5UyUQikEE 6Fwi+MxoF+pDhYo9Felu72ulAdl/i+cto7szIDueMCbObm95l0u4r++ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786475868685388096 X-GMAIL-MSGID: 1786475868685388096 |
Series |
SC8280XP preparatory PCIe fixes
|
|
Commit Message
Konrad Dybcio
Dec. 27, 2023, 10:28 p.m. UTC
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.
Fix the power-domains assignment to stop potentially toggling the GDSC
unnecessarily.
Fixes: 813e83157001 ("arm64: dts: qcom: sc8280xp/sa8540p: add PCIe2-4 nodes")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Comments
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 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. > 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
On 29.12.2023 12:24, 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 > > 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. Could you please recheck this with patch 1 from [1] applied? Konrad [1] https://lore.kernel.org/linux-arm-msm/20231227-topic-8280_pcie-v1-1-095491baf9e4@linaro.org/T/#u
On Fri, Dec 29, 2023 at 02:08:25PM +0100, Konrad Dybcio wrote: > On 29.12.2023 12:24, 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. > > 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 > > > > 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. > Could you please recheck this with patch 1 from [1] applied? As expected that makes no difference as I'm powering on the PHY without the corresponding controller being enabled (which otherwise guarantees the GDSC to be on). > [1] https://lore.kernel.org/linux-arm-msm/20231227-topic-8280_pcie-v1-1-095491baf9e4@linaro.org/T/#u Johan
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 >
On 29.12.2023 18:03, Manivannan Sadhasivam wrote: > 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. I did a bit of experimentation, and.. I think that the PHY itself doesn't need the GDSC to be enabled. However. The AUX clock requires the GDSC to be enabled and the PHY will fail to power on if this clock is disabled. That makes me wonder if representing the PCIe PHY as a wholly separate device (instead of e.g. it being a subdev of PCIe RC) is even correct.. >> > > 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've heard otherwise, the PHY itself is powered by MX, but CX needs to be (should be?) enabled for communication with the RC (which itself needs CX to be up to function). Konrad
On Fri, Dec 29, 2023 at 10:33:34PM +0530, Manivannan Sadhasivam wrote: > 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. Sounds good, thanks. > 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). Right. > > 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. I was referring to the fact that the GDSC domain also appears to be needed even if that may possible get in the way when trying to implement suspend. > 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 if it's an always-on domain as you say, it should not be shut down, right? Perhaps you still want it described in DT for some other reason. > 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. Ok, but that seems to imply that this patch is definitely *not* correct (for sc8280xp)? Johan
On Fri, Dec 29, 2023 at 10:33:34PM +0530, Manivannan Sadhasivam wrote: > 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). > So I answer I got from Qcom is that this clock is only applicable to the PCIe controller and not PHYs. On some platforms, there is a separate PCIE_PHY_AUX_CLK coming from GCC that is used during L1SS state. I think that caused confusion while adding PHY support for followup platforms and folks just used PCIE_AUX_CLK since they couldn't find the actual PCIE_PHY_AUX_CLK. I've prepared a series to fix this mess, but I want to know how you end up seeing the above "clk status stuck at off" issue. Is there an actual usecase for powering up PHY without controller or you just experimented with it? - Mani
On Mon, Jan 22, 2024 at 10:55:28PM +0530, Manivannan Sadhasivam wrote: > On Fri, Dec 29, 2023 at 10:33:34PM +0530, Manivannan Sadhasivam wrote: > > 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). > > > > So I answer I got from Qcom is that this clock is only applicable to the PCIe > controller and not PHYs. On some platforms, there is a separate PCIE_PHY_AUX_CLK > coming from GCC that is used during L1SS state. I think that caused confusion > while adding PHY support for followup platforms and folks just used PCIE_AUX_CLK > since they couldn't find the actual PCIE_PHY_AUX_CLK. Thanks for sorting that out. > I've prepared a series to fix this mess, but I want to know how you end up > seeing the above "clk status stuck at off" issue. Is there an actual usecase for > powering up PHY without controller or you just experimented with it? As I mentioned, I ran into this when experimenting with how to enable the "companion" PHY for four-lane support. There shouldn't be any use case for it (apart from using it to determine that the current description of the PHY resources is incomplete or incorrect). Johan
On Mon, Jan 22, 2024 at 06:36:51PM +0100, Johan Hovold wrote: > On Mon, Jan 22, 2024 at 10:55:28PM +0530, Manivannan Sadhasivam wrote: > > On Fri, Dec 29, 2023 at 10:33:34PM +0530, Manivannan Sadhasivam wrote: > > > 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). > > > > > > > So I answer I got from Qcom is that this clock is only applicable to the PCIe > > controller and not PHYs. On some platforms, there is a separate PCIE_PHY_AUX_CLK > > coming from GCC that is used during L1SS state. I think that caused confusion > > while adding PHY support for followup platforms and folks just used PCIE_AUX_CLK > > since they couldn't find the actual PCIE_PHY_AUX_CLK. > > Thanks for sorting that out. > > > I've prepared a series to fix this mess, but I want to know how you end up > > seeing the above "clk status stuck at off" issue. Is there an actual usecase for > > powering up PHY without controller or you just experimented with it? > > As I mentioned, I ran into this when experimenting with how to enable > the "companion" PHY for four-lane support. There shouldn't be any use > case for it (apart from using it to determine that the current > description of the PHY resources is incomplete or incorrect). > Ok. I tested by enabling the PHY clocks during qmp_pcie_clk_init() without PCIE_GDSC. It worked for one instance of the PHY which doesn't have PCIE_PHY_AUX_CLK, but for the PHY instance with this clock, I saw the same "clk stuck" issue. Then checking the internal documentation revealed that this clock needs PCIE_GDSC to become functional >.< So to conclude, PCIE_AUX_CLK belongs to the controller and it needs GDSC. And PCIE_PHY_AUX_CLK belongs to the PHY and it also needs GDSC. I will just submit a series to remove the PCIE_AUX_CLK from PHY nodes. Then in another series, I'll remove the GDSC for PHY instances that do not require PCIE_PHY_AUX_CLK. Hope this makes sense. - Mani
On 1/23/24 18:06, Manivannan Sadhasivam wrote: > On Mon, Jan 22, 2024 at 06:36:51PM +0100, Johan Hovold wrote: >> On Mon, Jan 22, 2024 at 10:55:28PM +0530, Manivannan Sadhasivam wrote: >>> On Fri, Dec 29, 2023 at 10:33:34PM +0530, Manivannan Sadhasivam wrote: >>>> 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). >>>> >>> >>> So I answer I got from Qcom is that this clock is only applicable to the PCIe >>> controller and not PHYs. On some platforms, there is a separate PCIE_PHY_AUX_CLK >>> coming from GCC that is used during L1SS state. I think that caused confusion >>> while adding PHY support for followup platforms and folks just used PCIE_AUX_CLK >>> since they couldn't find the actual PCIE_PHY_AUX_CLK. >> >> Thanks for sorting that out. >> >>> I've prepared a series to fix this mess, but I want to know how you end up >>> seeing the above "clk status stuck at off" issue. Is there an actual usecase for >>> powering up PHY without controller or you just experimented with it? >> >> As I mentioned, I ran into this when experimenting with how to enable >> the "companion" PHY for four-lane support. There shouldn't be any use >> case for it (apart from using it to determine that the current >> description of the PHY resources is incomplete or incorrect). >> > > Ok. I tested by enabling the PHY clocks during qmp_pcie_clk_init() without > PCIE_GDSC. It worked for one instance of the PHY which doesn't have > PCIE_PHY_AUX_CLK, but for the PHY instance with this clock, I saw the same "clk > stuck" issue. Then checking the internal documentation revealed that this clock > needs PCIE_GDSC to become functional >.< > > So to conclude, PCIE_AUX_CLK belongs to the controller and it needs GDSC. And > PCIE_PHY_AUX_CLK belongs to the PHY and it also needs GDSC. > > I will just submit a series to remove the PCIE_AUX_CLK from PHY nodes. Then > in another series, I'll remove the GDSC for PHY instances that do not require > PCIE_PHY_AUX_CLK. > > Hope this makes sense. Thanks, Mani Konrad
On Tue, Jan 23, 2024 at 10:36:14PM +0530, Manivannan Sadhasivam wrote: > On Mon, Jan 22, 2024 at 06:36:51PM +0100, Johan Hovold wrote: > Ok. I tested by enabling the PHY clocks during qmp_pcie_clk_init() without > PCIE_GDSC. It worked for one instance of the PHY which doesn't have > PCIE_PHY_AUX_CLK, but for the PHY instance with this clock, I saw the same "clk > stuck" issue. Then checking the internal documentation revealed that this clock > needs PCIE_GDSC to become functional >.< > > So to conclude, PCIE_AUX_CLK belongs to the controller and it needs GDSC. And > PCIE_PHY_AUX_CLK belongs to the PHY and it also needs GDSC. > > I will just submit a series to remove the PCIE_AUX_CLK from PHY nodes. Then > in another series, I'll remove the GDSC for PHY instances that do not require > PCIE_PHY_AUX_CLK. Sounds good, thanks. Johan
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi index febf28356ff8..72c5818b67f2 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -1797,7 +1797,7 @@ pcie4_phy: phy@1c06000 { assigned-clocks = <&gcc GCC_PCIE4_PHY_RCHNG_CLK>; assigned-clock-rates = <100000000>; - power-domains = <&gcc PCIE_4_GDSC>; + power-domains = <&rpmhpd SC8280XP_MX>; resets = <&gcc GCC_PCIE_4_PHY_BCR>; reset-names = "phy"; @@ -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"; @@ -1994,7 +1994,7 @@ pcie3a_phy: phy@1c14000 { assigned-clocks = <&gcc GCC_PCIE3A_PHY_RCHNG_CLK>; assigned-clock-rates = <100000000>; - power-domains = <&gcc PCIE_3A_GDSC>; + power-domains = <&rpmhpd SC8280XP_MX>; resets = <&gcc GCC_PCIE_3A_PHY_BCR>; reset-names = "phy"; @@ -2094,7 +2094,7 @@ pcie2b_phy: phy@1c1e000 { assigned-clocks = <&gcc GCC_PCIE2B_PHY_RCHNG_CLK>; assigned-clock-rates = <100000000>; - power-domains = <&gcc PCIE_2B_GDSC>; + power-domains = <&rpmhpd SC8280XP_MX>; resets = <&gcc GCC_PCIE_2B_PHY_BCR>; reset-names = "phy"; @@ -2193,7 +2193,7 @@ pcie2a_phy: phy@1c24000 { assigned-clocks = <&gcc GCC_PCIE2A_PHY_RCHNG_CLK>; assigned-clock-rates = <100000000>; - power-domains = <&gcc PCIE_2A_GDSC>; + power-domains = <&rpmhpd SC8280XP_MX>; resets = <&gcc GCC_PCIE_2A_PHY_BCR>; reset-names = "phy";