Skip to contentSkip to conversation

arm64: dts: qcom: Move PCIe phy/GPIOs to root port nodes and fix wake-gpios polarity

PATCH Superseded Krishna Chaitanya Chundru 5 participants 60 messages Sep 10 – Sep 14

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: qcom: Move PCIe phy/GPIOs to root port nodes and fix wake-gpios polarity

PCIe wake is active low signal as per the PCIe base spec, Several Qualcomm platform devicetrees incorrectly describe wake-gpios as GPIO_ACTIVE_HIGH.

The PCIe PHY references and PERST/WAKE GPIO properties are defined on a per-root-port basis and do not belong to the PCIe controller (RC) node. Keeping these properties at the controller level makes the description less accurate and prevents clean per-port customization.

This series moves the PHY references (phys, phy-names) from the PCIe controller node to the corresponding root port nodes (pcie@0), namely pcie0_port0, pcie1_port0, and pcie2_port0. Labels are added to these port nodes to enable board-level overrides where required.

Additionally, the PERST and WAKE GPIO properties are relocated from controller-level board overrides to their respective root port nodes in the board DTS files. As part of this change, 'perst-gpios' is renamed to 'reset-gpios' to align with the binding used in the PCIe root port context.

This restructuring improves DT correctness by properly associating resources with their respective hardware blocks and aligns with the expectations defined in the PCIe binding.

Tested on Talos Ride & lemans evk platform.

No Fixes tag is added as no functional issue has been observed.

---
Changes in v3:
- Rebased the code
- keep phy property in between bus-range and address-cells (Konrad)
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Move phy, perst & wake properties to the root port node.
- Rebased the code
- Link to v1: https://patch.msgid.link/[email protected]

To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Krishna Chaitanya Chundru (34):
ARM: dts: qcom: sdx55: Fix PCIe wake GPIO polarity
arm64: dts: qcom: msm8996: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sdm845: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sc8180x: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8150: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8250: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8350: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8450: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8550: Fix PCIe wake GPIO polarity
arm64: dts: qcom: qcs8550-rb5gen2: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8650: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sm8750: Fix PCIe wake GPIO polarity
arm64: dts: qcom: kaanapali: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sar2130p: Fix PCIe wake GPIO polarity
arm64: dts: qcom: monaco: Fix PCIe wake GPIO polarity
arm64: dts: qcom: lemans: Fix PCIe wake GPIO polarity
arm64: dts: qcom: talos: Fix PCIe wake GPIO polarity
arm64: dts: qcom: sa8540p-ride: Fix PCIe wake GPIO polarity
arm64: dts: qcom: kodiak: Fix PCIe wake GPIO polarity
arm64: dts: qcom: qcs6490-vicharak-axon-mini: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: msm8998: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: qcs404: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sar2130p: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sdm845: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8150: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8250: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8350: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8450: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: talos: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8650: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: msm8996: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: lemans: Move PCIe phy and GPIOs to root port node
arm64: dts: qcom: sm8550: Move PCIe phy and GPIOs to root port node

 arch/arm/boot/dts/qcom/qcom-sdx55-t55.dts          |  2 +-
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi       | 15 ++++++++--
 arch/arm64/boot/dts/qcom/kaanapali-mtp.dts         |  2 +-
 arch/arm64/boot/dts/qcom/lemans-evk.dts            | 13 +++++----
 arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi   | 13 +++++----
 arch/arm64/boot/dts/qcom/lemans.dtsi               | 12 ++++----
 arch/arm64/boot/dts/qcom/monaco-evk.dts            |  4 +--
 .../boot/dts/qcom/msm8996-oneplus-common.dtsi      |  5 +++-
 .../boot/dts/qcom/msm8996-sony-xperia-tone.dtsi    |  7 +++--
 .../arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi |  6 ++--
 arch/arm64/boot/dts/qcom/msm8996.dtsi              | 21 ++++++-------
 arch/arm64/boot/dts/qcom/msm8998.dtsi              |  8 ++---
 .../boot/dts/qcom/qcm6490-particle-tachyon.dts     |  3 +-
 arch/arm64/boot/dts/qcom/qcs404-evb.dtsi           |  6 ++--
 arch/arm64/boot/dts/qcom/qcs404.dtsi               |  7 ++---
 arch/arm64/boot/dts/qcom/qcs615-ride.dts           |  8 +++--
 .../boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts     |  4 +--
 .../dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts  |  4 +--
 .../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts |  2 +-
 .../boot/dts/qcom/qcs6490-vicharak-axon-mini.dts   | 16 ++++++----
 arch/arm64/boot/dts/qcom/qcs8300-ride.dts          |  4 +--
 arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi       | 16 ++++++----
 arch/arm64/boot/dts/qcom/qcs8550-rb5gen2.dts       | 12 ++++----
 arch/arm64/boot/dts/qcom/sa8540p-ride.dts          |  4 +--
 arch/arm64/boot/dts/qcom/sar2130p-qar2130p.dts     |  6 ++--
 arch/arm64/boot/dts/qcom/sar2130p.dtsi             | 12 ++++----
 .../arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts |  7 +++--
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |  7 +++--
 arch/arm64/boot/dts/qcom/sc8180x.dtsi              | 24 +++++++--------
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts         | 13 ++++++---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts            | 12 +++++---
 arch/arm64/boot/dts/qcom/sdm845.dtsi               | 14 ++++-----
 arch/arm64/boot/dts/qcom/sm8150.dtsi               | 21 ++++++-------
 arch/arm64/boot/dts/qcom/sm8250.dtsi               | 34 +++++++++-------------
 arch/arm64/boot/dts/qcom/sm8350-hdk.dts            | 16 ++++++----
 arch/arm64/boot/dts/qcom/sm8350.dtsi               | 14 ++++-----
 arch/arm64/boot/dts/qcom/sm8450.dtsi               | 22 ++++++--------
 arch/arm64/boot/dts/qcom/sm8550-hdk.dts            | 14 +++++----
 arch/arm64/boot/dts/qcom/sm8550-mtp.dts            | 16 ++++++----
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts            |  6 ++--
 arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts    |  7 +++--
 .../dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts    |  8 +++--
 arch/arm64/boot/dts/qcom/sm8550.dtsi               | 10 +++----
 .../boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts      | 14 +++++----
 arch/arm64/boot/dts/qcom/sm8650-hdk.dts            | 14 +++++----
 arch/arm64/boot/dts/qcom/sm8650-mtp.dts            | 16 ++++++----
 arch/arm64/boot/dts/qcom/sm8650-qrd.dts            |  6 ++--
 arch/arm64/boot/dts/qcom/sm8650.dtsi               | 10 +++----
 arch/arm64/boot/dts/qcom/sm8750-mtp.dts            |  2 +-
 arch/arm64/boot/dts/qcom/talos-evk-som.dtsi        |  8 +++--
 arch/arm64/boot/dts/qcom/talos.dtsi                |  8 ++---
 51 files changed, 289 insertions(+), 246 deletions(-)

---
base-commit: 50d05c7c76c96b90462f24debacca971d2e86713
change-id: 20260910-root_port-8237b5931fcc

Best regards,

Signature · 1 line
Krishna Chaitanya Chundru <[email protected]>
#1 lore raw

PATCH 1/34 ARM: dts: qcom: sdx55: Fix PCIe wake GPIO polarity

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm/boot/dts/qcom/qcom-sdx55-t55.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-sdx55-t55.dts +1 -1
index d23b8ec08af4..0443a86899a9 100644
@@ -249,7 +249,7 @@ &pcie_phy {
 
 &pcie_rc {
 	perst-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 53 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie_default>;
 	pinctrl-names = "default";
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 01/34] ARM: dts: qcom: sdx55: Fix PCIe wake GPIO polarity

On Thu, Sep 10, 2026 at 06:58:50PM +0530, Krishna Chaitanya Chundru wrote:

s/wake/WAKE# in subject

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw

PATCH 2/34 arm64: dts: qcom: msm8996: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi | 2 +-
 arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi +1 -1
index d55e4075040f..5b42c266557a 100644
@@ -192,7 +192,7 @@ &mmcc {
 
 &pcie0 {
 	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&pm8994_l28>;
 	status = "okay";
arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi +1 -1
index 77ad613590a3..2abcc733dad8 100644
@@ -280,7 +280,7 @@ &pcie0 {
 	vdda-supply = <&vreg_l28a_0p925>;
 
 	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
 };
 
 &pcie_phy {
Signature · 1 line
2.34.1
#4 lore raw

PATCH 3/34 arm64: dts: qcom: sdm845: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +1 -1
index 846138149b2c..3e636926231d 100644
@@ -619,7 +619,7 @@ &mss_pil {
 &pcie0 {
 	status = "okay";
 	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 134 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
 
 	vddpe-3v3-supply = <&pcie0_3p3v_dual>;
 
Signature · 1 line
2.34.1
#5 lore raw

PATCH 4/34 arm64: dts: qcom: sc8180x: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 2 +-
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts +1 -1
index 565e5a9979b1..e6ab523d249e 100644
@@ -492,7 +492,7 @@ &mdss_edp_out {
 
 &pcie3 {
 	perst-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 180 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 180 GPIO_ACTIVE_LOW>;
 	pinctrl-0 = <&pcie3_default_state>;
 	pinctrl-names = "default";
 
arch/arm64/boot/dts/qcom/sc8180x-primus.dts +1 -1
index c10a936b320a..327dba55a5ec 100644
@@ -593,7 +593,7 @@ &mdss_edp_out {
 
 &pcie1 {
 	perst-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 177 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 177 GPIO_ACTIVE_LOW>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie2_default_state>;
 
Signature · 1 line
2.34.1
#6 lore raw

PATCH 5/34 arm64: dts: qcom: sm8150: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
index 94a3b02cb289..74df5cd86f04 100644
@@ -1905,7 +1905,7 @@ pcie0: pcie@1c00000 {
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
-			wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH 05/34] arm64: dts: qcom: sm8150: Fix PCIe wake GPIO polarity

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] The commit fixes wake-gpios for pcie0 but misses the pcie1 node, which has a typoed 'enable-gpio' instead of 'wake-gpios' and incorrect active-high polarity.
- [High] The patch updates the PCIe WAKE# signal to GPIO_ACTIVE_LOW but neglects to fix the similarly inverted PERST# GPIO polarity in both PCIe nodes, and misses updating the dt-bindings example. --

commit 2d78a7a1ac651411a441c9a376da10f308ed1b27
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sm8150: Fix PCIe wake GPIO polarity

This commit corrects the WAKE# GPIO polarity for the sm8150 pcie0 node to GPIO_ACTIVE_LOW, complying with the active-low requirement in the PCIe Base Specification.

arch/arm64/boot/dts/qcom/sm8150.dtsi pcie0: pcie@1c00000 { · line 1907

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -0
index 94a3b02cb2897..74df5cd86f04f 100644
@@ -1905,7 +1905,7 @@ pcie0: pcie@1c00000 {
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;

[Severity: High]
This isn't a bug introduced by this patch, but since the WAKE# polarity is being fixed to match the PCIe Base Specification, should the PERST# polarity be updated as well?

The PERST# signal is also strictly defined as active-low by the PCIe spec. Leaving perst-gpios configured as GPIO_ACTIVE_HIGH in both pcie0 and pcie1 causes the pcie-qcom driver to invert the hardware reset sequence. When the driver logically asserts the reset using GPIOD_OUT_HIGH, an active-high configuration causes the physical pin to drive high on assertion and low on de-assertion. Does this hold the endpoint in physical reset when the driver attempts to initialize it?

Also, could the dt-bindings example in Documentation/devicetree/bindings/pci/qcom,pcie-sm8150.yaml be updated? It currently retains the GPIO_ACTIVE_HIGH polarity for both WAKE# and PERST#, which might teach the wrong polarity to users.

arch/arm64/boot/dts/qcom/sm8150.dtsi pcie0: pcie@1c00000 { · line 1908

Quoted 2 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
-			wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;

[Severity: High]
This is a pre-existing issue, but was the WAKE# configuration for the pcie1 node accidentally overlooked?

Looking at the pcie1 node, the WAKE# GPIO is misspelled as enable-gpio and retains the incorrect active-high polarity:

        perst-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
        enable-gpio = <&tlmm 104 GPIO_ACTIVE_HIGH>;

Because of this typo, the PCI framework completely ignores the WAKE# GPIO, breaking PCIe wake and power management features for the secondary controller. Would it make sense to correct enable-gpio to wake-gpios and set it to GPIO_ACTIVE_LOW in this patch?

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -0
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#8 lore raw

PATCH 6/34 arm64: dts: qcom: sm8250: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +3 -3
index 90f8b091634e..e0c357222bc7 100644
@@ -2211,7 +2211,7 @@ pcie0: pcie@1c00000 {
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 81 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 81 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
@@ -2338,7 +2338,7 @@ pcie1: pcie@1c08000 {
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 82 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 84 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 84 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie1_default_state>;
@@ -2465,7 +2465,7 @@ pcie2: pcie@1c10000 {
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie2_default_state>;
Signature · 1 line
2.34.1
#9 lore raw

PATCH 7/34 arm64: dts: qcom: sm8350: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8350-hdk.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8350-hdk.dts +2 -2
index bb93c3e9417b..e9b9e03f725e 100644
@@ -500,7 +500,7 @@ &pcie0 {
 	pinctrl-0 = <&pcie0_default_state>;
 
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 
 	status = "okay";
 };
@@ -514,7 +514,7 @@ &pcie0_phy {
 
 &pcie1 {
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
Signature · 1 line
2.34.1
#10 lore raw

PATCH 8/34 arm64: dts: qcom: sm8450: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +2 -2
index b8793482b181..7bc5f85e7ebc 100644
@@ -2021,7 +2021,7 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
@@ -2186,7 +2186,7 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			phy-names = "pciephy";
 
 			perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+			wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie1_default_state>;
Signature · 1 line
2.34.1
#11 lore raw

PATCH 9/34 arm64: dts: qcom: sm8550: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi                | 4 ++--
 arch/arm64/boot/dts/qcom/qcs8550-rb5gen2.dts                | 4 ++--
 arch/arm64/boot/dts/qcom/sm8550-hdk.dts                     | 4 ++--
 arch/arm64/boot/dts/qcom/sm8550-mtp.dts                     | 4 ++--
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts                     | 2 +-
 arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts             | 2 +-
 arch/arm64/boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi +2 -2
index ae301d78e071..aaf5eb57ce23 100644
@@ -336,7 +336,7 @@ &mdss_dsi0_phy {
 
 &pcie0 {
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
@@ -349,7 +349,7 @@ &pcie0_phy {
 
 &pcie1 {
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
arch/arm64/boot/dts/qcom/qcs8550-rb5gen2.dts +2 -2
index 9df8dcd6c62b..41b09ab43d0c 100644
@@ -1045,7 +1045,7 @@ &mdss_dp0 {
 &pcie0 {
 	vddpe-3v3-supply = <&pcie_upd_3p3>;
 
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
@@ -1146,7 +1146,7 @@ pci@0,1 {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
arch/arm64/boot/dts/qcom/sm8550-hdk.dts +2 -2
index 82fb10ed6b6b..4777c908c4d7 100644
@@ -1087,7 +1087,7 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
@@ -1121,7 +1121,7 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
arch/arm64/boot/dts/qcom/sm8550-mtp.dts +2 -2
index 7c634572c6b7..eb1de33e5ba5 100644
@@ -739,7 +739,7 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
@@ -756,7 +756,7 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
arch/arm64/boot/dts/qcom/sm8550-qrd.dts +1 -1
index 473ec4e27daf..13cdb5b0ce40 100644
@@ -987,7 +987,7 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts +1 -1
index 81c02ee27fe9..cf4e4e9d9e26 100644
@@ -510,7 +510,7 @@ &i2c_master_hub_0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
arch/arm64/boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts +1 -1
index 367f6eae5e65..9f347bea6c74 100644
@@ -584,7 +584,7 @@ cirrus,gpio-ctrl2 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
2.34.1
#12 lore raw

PATCH 10/34 arm64: dts: qcom: qcs8550-rb5gen2: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The perst/wake GPIO properties are per root port and belong in the root port node, not in the RC controller node. Move perst-gpios/ wake-gpios from the &pcie0/&pcie1 controller overrides to the respective &pcie0_port0/&pcie1_port0 nodes, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/qcs8550-rb5gen2.dts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/qcs8550-rb5gen2.dts +6 -6
index 41b09ab43d0c..42e3e862e6f4 100644
@@ -1045,9 +1045,6 @@ &mdss_dp0 {
 &pcie0 {
 	vddpe-3v3-supply = <&pcie_upd_3p3>;
 
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -1074,6 +1071,9 @@ &pcie0_phy {
 };
 
 &pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	pcie@0,0 {
 		compatible = "pci1179,0623";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
@@ -1146,9 +1146,6 @@ pci@0,1 {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
@@ -1176,6 +1173,9 @@ &pcie1_phy {
 };
 
 &pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+
 	pcie@0,0 {
 		compatible = "pci1179,0623";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
Signature · 1 line
2.34.1
Reviewed-by on v1 10/34
#13 lore raw

Re: [PATCH 10/34] arm64: dts: qcom: qcs8550-rb5gen2: Move PCIe phy and GPIOs to root port node

Quoted 8 lines · Krishna Chaitanya Chundru

The perst/wake GPIO properties are per root port and belong in the root port node, not in the RC controller node. Move perst-gpios/ wake-gpios from the &pcie0/&pcie1 controller overrides to the respective &pcie0_port0/&pcie1_port0 nodes, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

splitting sm8550-renamed from sm8550 is a bit excessive, but anyway:

Konrad

#14 lore raw

PATCH 11/34 arm64: dts: qcom: sm8650: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts | 4 ++--
 arch/arm64/boot/dts/qcom/sm8650-hdk.dts              | 4 ++--
 arch/arm64/boot/dts/qcom/sm8650-mtp.dts              | 4 ++--
 arch/arm64/boot/dts/qcom/sm8650-qrd.dts              | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts +2 -2
index 6ddf30ecabfe..668c183bc177 100644
@@ -1074,7 +1074,7 @@ &mdss_dp0_out {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
@@ -1108,7 +1108,7 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
arch/arm64/boot/dts/qcom/sm8650-hdk.dts +2 -2
index 41d0c7edc433..b73ad7861eb4 100644
@@ -1027,7 +1027,7 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
@@ -1061,7 +1061,7 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
arch/arm64/boot/dts/qcom/sm8650-mtp.dts +2 -2
index 26045430d34a..1332c864801f 100644
@@ -642,7 +642,7 @@ &mdss_dsi0_phy {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
@@ -659,7 +659,7 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
arch/arm64/boot/dts/qcom/sm8650-qrd.dts +1 -1
index 1fb78588a504..2e874f046a0e 100644
@@ -1021,7 +1021,7 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
 	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
2.34.1
#15 lore raw

PATCH 12/34 arm64: dts: qcom: sm8750: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sm8750-mtp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8750-mtp.dts +1 -1
index 9b5fbc004df4..23476fbd993c 100644
@@ -1119,7 +1119,7 @@ &pcie0_phy {
 };
 
 &pcieport0 {
-	wake-gpios = <&tlmm 104 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 104 GPIO_ACTIVE_LOW>;
 	reset-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
 
 	wifi@0 {
Signature · 1 line
2.34.1
#16 lore raw

PATCH 13/34 arm64: dts: qcom: kaanapali: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/kaanapali-mtp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/kaanapali-mtp.dts +1 -1
index 6d817381bb37..83c4f93a654a 100644
@@ -976,7 +976,7 @@ &pcie0_phy {
 };
 
 &pcie_port0 {
-	wake-gpios = <&tlmm 104 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 104 GPIO_ACTIVE_LOW>;
 	reset-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
 
 	wifi@0 {
Signature · 1 line
2.34.1
#17 lore raw

PATCH 14/34 arm64: dts: qcom: sar2130p: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sar2130p-qar2130p.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sar2130p-qar2130p.dts +1 -1
index 80428c0b3b4e..7469134f42b7 100644
@@ -358,7 +358,7 @@ &i2c10 {
 
 &pcie0 {
 	perst-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
Signature · 1 line
2.34.1
#18 lore raw

PATCH 15/34 arm64: dts: qcom: monaco: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/monaco-evk.dts   | 4 ++--
 arch/arm64/boot/dts/qcom/qcs8300-ride.dts | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/monaco-evk.dts +2 -2
index 9d17ef7d2caf..b30fc7ecdf32 100644
@@ -643,12 +643,12 @@ &pcie1_phy {
 
 &pcieport0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 };
 
 &pcieport1 {
 	reset-gpios = <&tlmm 23 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
 };
 
 &pmm8620au_0_gpios {
arch/arm64/boot/dts/qcom/qcs8300-ride.dts +2 -2
index 1ff39530ea3d..2472df47a0ea 100644
@@ -615,7 +615,7 @@ &pcie0 {
 
 &pcieport0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 
 	wifi@0 {
 		compatible = "pci17cb,1103";
@@ -651,7 +651,7 @@ &pcie1 {
 
 &pcieport1 {
 	reset-gpios = <&tlmm 23 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
 };
 
 &pcie1_phy {
Signature · 1 line
2.34.1
#19 lore raw

PATCH 16/34 arm64: dts: qcom: lemans: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/lemans-evk.dts          | 4 ++--
 arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk.dts +2 -2
index a45485b54a5b..194e114a12a0 100644
@@ -840,7 +840,7 @@ &mdss0_dp1_phy {
 
 &pcie0 {
 	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
@@ -857,7 +857,7 @@ &pcie0_phy {
 
 &pcie1 {
 	perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi +2 -2
index 144f117ba511..3ecf3d464dd7 100644
@@ -962,7 +962,7 @@ wake-pins {
 
 &pcie0 {
 	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
@@ -972,7 +972,7 @@ &pcie0 {
 
 &pcie1 {
 	perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
Signature · 1 line
2.34.1
#20 lore raw

PATCH 17/34 arm64: dts: qcom: talos: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/qcs615-ride.dts    | 2 +-
 arch/arm64/boot/dts/qcom/talos-evk-som.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/qcs615-ride.dts +1 -1
index 047b4efb04b9..43f110ba3a7c 100644
@@ -445,7 +445,7 @@ &mdss_dsi0_phy {
 
 &pcie {
 	perst-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie_default_state>;
 	pinctrl-names = "default";
arch/arm64/boot/dts/qcom/talos-evk-som.dtsi +1 -1
index a31bed7fad07..198f656bddf1 100644
@@ -367,7 +367,7 @@ &mdss_dsi0_phy {
 
 &pcie {
 	perst-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie_default_state>;
 	pinctrl-names = "default";
Signature · 1 line
2.34.1
#21 lore raw

PATCH 18/34 arm64: dts: qcom: sa8540p-ride: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sa8540p-ride.dts +2 -2
index c72faaa0ae7a..e85d78ecac2e 100644
@@ -374,7 +374,7 @@ &pcie2a {
 
 &pcie2a_port0 {
 	reset-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 145 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
 };
 
 &pcie2a_phy {
@@ -397,7 +397,7 @@ &pcie3a {
 
 &pcie3a_port0 {
 	reset-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 56 GPIO_ACTIVE_LOW>;
 };
 
 &pcie3a_phy {
Signature · 1 line
2.34.1
#22 lore raw

PATCH 19/34 arm64: dts: qcom: kodiak: Fix PCIe wake GPIO polarity

In reply to Krishna Chaitanya Chundru

The PCIe WAKE# signal is active-low as defined in the PCIe Base Specification. Fix the wake-gpios polarity by using GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH.

---
 arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts         | 3 ++-
 arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts         | 4 ++--
 arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts | 4 ++--
 arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts     | 2 +-
 arch/arm64/boot/dts/qcom/qcs6490-vicharak-axon-mini.dts       | 4 ++--
 5 files changed, 9 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts +2 -1
index 5bb33a8a9830..509fc4941a02 100644
@@ -558,7 +558,7 @@ &pcie0_phy {
 
 &pcie0_port {
 	reset-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 };
 
 &pcie1 {
@@ -579,6 +579,7 @@ &pcie1_phy {
 
 &pcie1_port0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
 };
 
 &pmk8350_adc_tm {
arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts +2 -2
index 41d60c87f5bd..ed0b81710b9a 100644
@@ -541,7 +541,7 @@ &pcie0_phy {
 
 &pcie0_port {
 	reset-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 };
 
 &pcie1 {
@@ -571,7 +571,7 @@ &pcie1_phy {
 
 &pcie1_port0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
 };
 
 &pm7325_gpios {
arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts +2 -2
index 31bafa2cf51d..6527cf815b85 100644
@@ -705,7 +705,7 @@ &pcie0_phy {
 
 &pcie0_port {
 	reset-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 };
 
 &pcie1 {
@@ -736,7 +736,7 @@ &pcie1_phy {
 
 &pcie1_port0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
 
 	pcie@0,0 {
 		compatible = "pci1179,0623";
arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts +1 -1
index 13e8e62f6205..4ac2998a0a6a 100644
@@ -833,7 +833,7 @@ &pcie0_phy {
 
 &pcie0_port {
 	reset-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 };
 
 &pcie1 {
arch/arm64/boot/dts/qcom/qcs6490-vicharak-axon-mini.dts +2 -2
index 4f2e0109f49b..141d263e6566 100644
@@ -653,7 +653,7 @@ &ice {
 
 &pcie0 {
 	perst-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie0_clkreq_n>, <&pcie0_reset_n>, <&pcie0_wake_n>;
 	pinctrl-names = "default";
@@ -670,7 +670,7 @@ &pcie0_phy {
 
 &pcie1 {
 	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
 
 	pinctrl-0 = <&pcie1_reset_n>, <&pcie1_wake_n>, <&pcie1_clkreq_n>;
 	pinctrl-names = "default";
Signature · 1 line
2.34.1
#23 lore raw

Re: [PATCH 19/34] arm64: dts: qcom: kodiak: Fix PCIe wake GPIO polarity

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Undocumented functional change (adding missing wake-gpios property). --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Undocumented functional change (adding missing wake-gpios property). --

commit f9eaa8a25d673bb044fadcfbda30d55434544bbe
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: kodiak: Fix PCIe wake GPIO polarity

This commit fixes the PCIe wake-gpios polarity across several boards by changing the active state from high to low. This is intended to match the active-low requirement defined in the PCIe Base Specification.

Quoted 4 lines
arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts +0 -0
index 5bb33a8a98304..509fc4941a029 100644

[ ... ]

arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts &pcie1_phy { · line 582

Quoted 5 lines
arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts +1 -0
@@ -579,6 +579,7 @@ &pcie1_phy {
 
 &pcie1_port0 {
 	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;

[Severity: Medium]
The commit message focuses on changing the polarity of existing wake-gpios properties, but this addition introduces a brand new wake-gpios property to pcie1_port0 that was completely missing before.

Is this functional addition intentional? If so, could this be documented in the commit message so that it accurately reflects all the scope changes introduced by the patch?

Quoted 3 lines
arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts +0 -0
 };
 
 &pmk8350_adc_tm {
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=19
#24 lore raw

PATCH 20/34 arm64: dts: qcom: qcs6490-vicharak-axon-mini: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The perst/wake GPIO properties are per root port and belong in the root port node, not in the RC controller node. Move perst-gpios/ wake-gpios from the &pcie0/&pcie1 controller overrides to the respective &pcie0_port/&pcie1_port0 nodes, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/qcs6490-vicharak-axon-mini.dts | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/qcs6490-vicharak-axon-mini.dts +10 -6
index 141d263e6566..89fb685c53cc 100644
@@ -652,15 +652,17 @@ &ice {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_clkreq_n>, <&pcie0_reset_n>, <&pcie0_wake_n>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie0_port {
+	reset-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l10c_0p88>;
 	vdda-pll-supply = <&vreg_l6b_1p2>;
@@ -669,9 +671,6 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_reset_n>, <&pcie1_wake_n>, <&pcie1_clkreq_n>;
 	pinctrl-names = "default";
 
@@ -685,6 +684,11 @@ &pcie1_phy {
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
+};
+
 &pm7250b_adc {
 	channel@4d {
 		reg = <ADC5_AMUX_THM1_100K_PU>;
Signature · 1 line
2.34.1
Reviewed-by on v1 20/34
#25 lore raw

Re: [PATCH 20/34] arm64: dts: qcom: qcs6490-vicharak-axon-mini: Move PCIe phy and GPIOs to root port node

Quoted 8 lines · Krishna Chaitanya Chundru

The perst/wake GPIO properties are per root port and belong in the root port node, not in the RC controller node. Move perst-gpios/ wake-gpios from the &pcie0/&pcie1 controller overrides to the respective &pcie0_port/&pcie1_port0 nodes, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

Konrad

#26 lore raw

PATCH 21/34 arm64: dts: qcom: msm8998: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst GPIO property are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, and perst-gpios from the controller to pcie0_port0, adding a label to this node to allow board-level overrides, and renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +4 -4
index 5038d0009c1a..0782ee1cde05 100644
@@ -928,8 +928,6 @@ pcie0: pcie@1c00000 {
 			#address-cells = <3>;
 			#size-cells = <2>;
 			num-lanes = <1>;
-			phys = <&pcie_phy>;
-			phy-names = "pciephy";
 			status = "disabled";
 
 			ranges = <0x01000000 0x0 0x00000000 0x1b200000 0x0 0x100000>,
@@ -969,13 +967,15 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 			iommu-map = <0x100 &anoc1_smmu 0x1480 1>;
-			perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie_phy>;
+				reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#27 lore raw

Re: [PATCH 21/34] arm64: dts: qcom: msm8998: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message claims to move `phy-names` to the root port node, but the property is…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message claims to move phy-names to the root port node, but the property is actually deleted. --

commit 5db263a0e4f8f01c847c35b40997163432b4247b
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: msm8998: Move PCIe phy and GPIOs to root port node

This commit moves the pcie phy reference and the perst gpio property from the RC controller node to the root port node (pcie@0) for the msm8998 devicetree. It also renames the perst gpio to reset-gpios and adds a label to the root port node.

Quoted 6 lines

The PCIe phy reference and the perst GPIO property are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, and perst-gpios from the controller to pcie0_port0, adding a label to this node to allow board-level overrides, and renaming perst-gpios to reset-gpios to match the binding used in the root port context.

[Severity: Medium]
The commit message claims to move phy-names to the root port node, but the property is actually deleted in the patch. Should the commit message be updated to reflect this omission?

The omission appears to be structurally correct per the device tree bindings (Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml), which state that phy-names is not required in the root port as it only has one phy, but the commit message contradicts this intentional deletion.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=21
Reviewed-by on v1 21/34
#28 lore raw

Re: [PATCH 21/34] arm64: dts: qcom: msm8998: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Quoted 9 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst GPIO property are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, and perst-gpios from the controller to pcie0_port0, adding a label to this node to allow board-level overrides, and renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

Konrad

#29 lore raw

PATCH 22/34 arm64: dts: qcom: qcs404: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst GPIO property are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, adding a label to this node to allow board-level overrides. Move perst-gpios from the &pcie controller override to &pcie0_port0 in the board file, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 6 ++++--
 arch/arm64/boot/dts/qcom/qcs404.dtsi     | 7 +++----
 2 files changed, 7 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/qcs404-evb.dtsi +4 -2
index a22b4501ce1e..a035546a1b97 100644
@@ -101,12 +101,14 @@ pms405_s3: s3 {
 &pcie {
 	status = "okay";
 
-	perst-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&perst_state>;
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	status = "okay";
 
arch/arm64/boot/dts/qcom/qcs404.dtsi +3 -4
index 736accfc34f9..b661505b409d 100644
@@ -1517,16 +1517,15 @@ pcie: pcie@10000000 {
 				      "pwr",
 				      "ahb";
 
-			phys = <&pcie_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#30 lore raw

Re: [PATCH 22/34] arm64: dts: qcom: qcs404: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message incorrectly claims that `phy-names` is moved to the root port node, but it is…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message incorrectly claims that phy-names is moved to the root port node, but it is actually dropped. --

commit 43e475189be13ef7a3db0e296715dd66a66766c9
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: qcs404: Move PCIe phy and GPIOs to root port node

This commit moves the PCIe phy reference and perst GPIO property from the RC controller node to the root port node, renaming the GPIO to reset-gpios. It adds a label to the root port node to allow board-level overrides.

Quoted 2 lines

Move phys and phy-names from the controller to pcie0_port0, adding a label to this node to allow board-level overrides.

[Severity: Medium]
The commit message states that phy-names is moved to pcie0_port0, but looking at the diff, it appears to be removed entirely rather than moved. Is this omission intentional since the driver might look up the PHY without a connection ID, and could the commit message be updated to reflect that it is dropped?

Quoted 4 lines
arch/arm64/boot/dts/qcom/qcs404.dtsi +0 -0
@@ -1517,16 +1517,15 @@ pcie: pcie@10000000 {

[ ... ]

arch/arm64/boot/dts/qcom/qcs404.dtsi pcie: pcie@10000000 { · line 1528

Quoted 13 lines
arch/arm64/boot/dts/qcom/qcs404.dtsi +3 -4
-			phys = <&pcie_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie_phy>;
+

[Severity: Medium]
As noted above, we add phys here in pcie0_port0 but omit phy-names which was present in the parent node. Does this child node also need the phy-names property to match the commit message, or is dropping it the intended behavior?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=22
Reviewed-by on v1 22/34
#31 lore raw

Re: [PATCH 22/34] arm64: dts: qcom: qcs404: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Quoted 10 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst GPIO property are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, adding a label to this node to allow board-level overrides. Move perst-gpios from the &pcie controller override to &pcie0_port0 in the board file, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

Konrad

#32 lore raw

PATCH 23/34 arm64: dts: qcom: sar2130p: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the &pcie0 controller override to &pcieport0 in the board file, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sar2130p-qar2130p.dts |  6 +++---
 arch/arm64/boot/dts/qcom/sar2130p.dtsi         | 12 +++++-------
 2 files changed, 8 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/qcom/sar2130p-qar2130p.dts +3 -3
index 7469134f42b7..cc04eefdfcff 100644
@@ -357,9 +357,6 @@ &i2c10 {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -367,6 +364,9 @@ &pcie0 {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
arch/arm64/boot/dts/qcom/sar2130p.dtsi +5 -7
index a2d93fd68299..678ecda1c99a 100644
@@ -1337,9 +1337,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
 			pcieport0: pcie@0 {
@@ -1347,6 +1344,8 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -1464,16 +1463,15 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#33 lore raw

Re: [PATCH 23/34] arm64: dts: qcom: sar2130p: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message falsely claims that the `phy-names` property is moved to the root port nodes…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message falsely claims that the phy-names property is moved to the root port nodes, but the implementation entirely deletes it. --

commit 4afbaa887d3731fc2a6a1eaf2a71527f5f0835ef
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sar2130p: Move PCIe phy and GPIOs to root port node

This commit moves the PCIe phy reference and the perst/wake GPIO properties from the RC controller node to the root port node (pcie@0). The commit message indicates that both phys and phy-names are being moved to allow board-level overrides.

Quoted 15 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +0 -3
index a2d93fd682997..678ecda1c99a3 100644
@@ -1337,9 +1337,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
 			pcieport0: pcie@0 {

arch/arm64/boot/dts/qcom/sar2130p.dtsi pcieport0: pcie@0 { · line 1348

Quoted 5 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +2 -0
@@ -1347,6 +1344,8 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+

[Severity: Medium]
The commit message states that both phys and phy-names are moved from the controller to pcieport0. However, only the phys property is added here. Was phy-names intentionally omitted, or should it be included to match the commit message?

Quoted 3 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +0 -0
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;

[ ... ]

Quoted 7 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +0 -3
@@ -1464,16 +1463,15 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-

arch/arm64/boot/dts/qcom/sar2130p.dtsi &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, · line 1474

Quoted 10 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +3 -1
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+

[Severity: Medium]
Similarly for pcie1_port0, the phy-names property was removed from the controller but not added here. Should phy-names also be added to this node to remain consistent with the commit description?

Quoted 3 lines
arch/arm64/boot/dts/qcom/sar2130p.dtsi +0 -0
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=23
Reviewed-by on v1 23/34
#34 lore raw

Re: [PATCH 23/34] arm64: dts: qcom: sar2130p: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Quoted 11 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the &pcie0 controller override to &pcieport0 in the board file, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

Konrad

#35 lore raw

PATCH 24/34 arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, pcie1_port0, pcie2_port0, and pcie3_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 .../arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts |  7 +++++--
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |  7 +++++--
 arch/arm64/boot/dts/qcom/sc8180x.dtsi              | 24 +++++++++++-----------
 3 files changed, 22 insertions(+), 16 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts +5 -2
index e6ab523d249e..160f6ccf21ca 100644
@@ -491,14 +491,17 @@ &mdss_edp_out {
 };
 
 &pcie3 {
-	perst-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 180 GPIO_ACTIVE_LOW>;
 	pinctrl-0 = <&pcie3_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie3_port0 {
+	reset-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 180 GPIO_ACTIVE_LOW>;
+};
+
 &pcie3_phy {
 	vdda-phy-supply = <&vreg_l5e_0p88>;
 	vdda-pll-supply = <&vreg_l3c_1p2>;
arch/arm64/boot/dts/qcom/sc8180x-primus.dts +5 -2
index 327dba55a5ec..fe773a47da2e 100644
@@ -592,14 +592,17 @@ &mdss_edp_out {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 177 GPIO_ACTIVE_LOW>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie2_default_state>;
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 177 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l5e_0p88>;
 	vdda-pll-supply = <&vreg_l3c_1p2>;
arch/arm64/boot/dts/qcom/sc8180x.dtsi +12 -12
index de1b72b64d96..a85e3211958d 100644
@@ -1779,17 +1779,17 @@ pcie0: pcie@1c00000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -1898,17 +1898,17 @@ pcie3: pcie@1c08000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_3 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie3_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie3_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie3_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2018,17 +2018,17 @@ pcie1: pcie@1c10000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_1 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2138,17 +2138,17 @@ pcie2: pcie@1c18000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_2 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie2_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie2_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie2_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#36 lore raw

Re: [PATCH 24/34] arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message claims to move both `phys` and `phy-names` to the root port nodes, but…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message claims to move both phys and phy-names to the root port nodes, but phy-names is deleted entirely instead of being moved. --

commit fb102e85b305ac3a25a018843f8ea1cc8f87f980
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node

This commit moves PCIe phy references and GPIO properties from the RC controller node to the root port node. It drops phys and phy-names from the controller node and adds phys to the root port node.

Quoted 6 lines

arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, pcie1_port0, pcie2_port0, and pcie3_port0, adding

[Severity: Medium]
The commit message claims to move both phys and phy-names to the root port nodes, but phy-names is deleted entirely instead of being moved.

While dropping phy-names is technically correct and safe (the qcom,pcie-common.yaml DT binding marks phy-names as deprecated and explicitly states it is not required in the root port node), the commit message is factually inaccurate.

Could the commit message be updated to document the intentional removal of the deprecated property rather than claiming it was moved?

Quoted 15 lines
arch/arm64/boot/dts/qcom/sc8180x.dtsi +0 -3
index de1b72b64d960..a85e3211958d1 100644
@@ -1779,17 +1779,17 @@ pcie0: pcie@1c00000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {

arch/arm64/boot/dts/qcom/sc8180x.dtsi pcie0: pcie@1c00000 { · line 1795

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc8180x.dtsi +3 -0
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;

[Severity: Medium]
As noted above, phys is moved to the pcie0_port0 node in arch/arm64/boot/dts/qcom/sc8180x.dtsi, but phy-names is conspicuously missing, contradicting the commit message.

[ ... ]

Quoted 11 lines
arch/arm64/boot/dts/qcom/sc8180x.dtsi +0 -3
@@ -1898,17 +1898,17 @@ pcie3: pcie@1c08000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_3 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie3_phy>;
-			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {

arch/arm64/boot/dts/qcom/sc8180x.dtsi pcie3: pcie@1c08000 { · line 1914

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc8180x.dtsi +3 -0
+			pcie3_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie3_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;

[Severity: Medium]
The same discrepancy applies to pcie3_port0, where phy-names is also omitted.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=24
Reviewed-by on v1 24/34
#37 lore raw

Re: [PATCH 24/34] arm64: dts: qcom: sc8180x: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Quoted 11 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, pcie1_port0, pcie2_port0, and pcie3_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---

Konrad

#38 lore raw

PATCH 25/34 arm64: dts: qcom: sdm845: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 13 +++++++++----
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts    | 12 ++++++++----
 arch/arm64/boot/dts/qcom/sdm845.dtsi       | 14 ++++++--------
 3 files changed, 23 insertions(+), 16 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +9 -4
index 3e636926231d..27a0b90d2b7a 100644
@@ -618,15 +618,17 @@ &mss_pil {
 
 &pcie0 {
 	status = "okay";
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
-
 	vddpe-3v3-supply = <&pcie0_3p3v_dual>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	status = "okay";
 
@@ -636,12 +638,15 @@ &pcie0_phy {
 
 &pcie1 {
 	status = "okay";
-	perst-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	status = "okay";
 
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +8 -4
index c66df45eee64..0080000a1839 100644
@@ -508,14 +508,16 @@ &mss_pil {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l1a_0p875>;
 	vdda-pll-supply = <&vreg_l26a_1p2>;
@@ -524,14 +526,16 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	status = "okay";
 
arch/arm64/boot/dts/qcom/sdm845.dtsi +6 -8
index b1f6782a3ad9..cb7f93b02b5a 100644
@@ -2395,16 +2395,15 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2525,16 +2524,15 @@ pcie1: pcie@1c08000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#39 lore raw

Re: [PATCH 25/34] arm64: dts: qcom: sdm845: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing phy_exit() on early error paths in PCIe port parsing functions, leading to leaked initialized PHY state. --

commit 7aa07cedc6576c48d7f1dd8ce61fd5bb50362173
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sdm845: Move PCIe phy and GPIOs to root port node

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +0 -0
index 3e636926231d3..27a0b90d2b7ae 100644

[ ... ]

Quoted 8 lines
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +0 -3
@@ -618,15 +618,17 @@ &mss_pil {
 
 &pcie0 {
 	status = "okay";
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
-
 	vddpe-3v3-supply = <&pcie0_3p3v_dual>;

arch/arm64/boot/dts/qcom/sdm845-db845c.dts &mss_pil { · line 631

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +5 -0
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
+};
+

[Severity: High]
This isn't a bug introduced by this patch, but does this new device tree configuration expose a resource leak in the driver's error handling paths?

Because the driver now dynamically evaluates qcom_pcie_parse_perst() during qcom_pcie_parse_port() for these root port nodes, what happens if these GPIOs defer probing?

Looking at drivers/pci/controller/dwc/pcie-qcom.c in qcom_pcie_parse_port():

	ret = qcom_pcie_parse_perst(pcie, port, node);
	if (ret)
		return ret;

If this fails (e.g., returning -EPROBE_DEFER because GPIOs are not yet available), the function returns immediately. At this point, the newly parsed port has not been added to pcie->ports, so the caller's error handler fails to find it and doesn't call phy_exit(port->phy). Will this leak the initialized PHY state (such as regulator enable counts or unbalanced clock states) on every probe deferral attempt?

A similar issue appears to be present in qcom_pcie_parse_legacy_binding():

	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
	if (!port)
		return -ENOMEM;

Does returning -ENOMEM here leak the PHY state without reverting the earlier phy_init(phy) call?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=25
#40 lore raw

Re: [PATCH 25/34] arm64: dts: qcom: sdm845: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Quoted 24 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 13 +++++++++----
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts    | 12 ++++++++----
 arch/arm64/boot/dts/qcom/sdm845.dtsi       | 14 ++++++--------
 3 files changed, 23 insertions(+), 16 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +0 -0
index 3e636926231d..27a0b90d2b7a 100644
@@ -618,15 +618,17 @@ &mss_pil {
 
 &pcie0 {
 	status = "okay";

arch/arm64/boot/dts/qcom/sdm845-db845c.dts &mss_pil { · line 627

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +1 -3
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 134 GPIO_ACTIVE_LOW>;
-
 	vddpe-3v3-supply = <&pcie0_3p3v_dual>;
 
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 };
 
+&pcie0_port0 {

p'h'y < p'o'rt, just noticed other patches have the same issue, please touch it up

Konrad

#41 lore raw

PATCH 26/34 arm64: dts: qcom: sm8150: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, perst-gpios, and wake-gpios from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides, and renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +9 -12
index 74df5cd86f04..d75f71463287 100644
@@ -1901,22 +1901,20 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
-			wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+				reset-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
+				wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2019,10 +2017,6 @@ pcie1: pcie@1c08000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
 			enable-gpio = <&tlmm 104 GPIO_ACTIVE_HIGH>;
 
 			pinctrl-names = "default";
@@ -2030,11 +2024,14 @@ pcie1: pcie@1c08000 {
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+				reset-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#42 lore raw

Re: [PATCH 26/34] arm64: dts: qcom: sm8150: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message explicitly claims that `phy-names` is moved to the root port nodes, but it is…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message explicitly claims that phy-names is moved to the root port nodes, but it is only removed from the controller nodes and never added to the new locations. --

commit b066c836beffb04b20d0daeb1e52c04c33f8e062
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sm8150: Move PCIe phy and GPIOs to root port node

This commit moves the PCIe PHY and perst/wake GPIO properties from the root complex node to the root port node for sm8150. It also renames perst-gpios to reset-gpios to match root port bindings.

Quoted 4 lines

Move phys, phy-names, perst-gpios, and wake-gpios from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides, and renaming perst-gpios to reset-gpios to match the binding used in the root port context.

[Severity: Medium]
The commit message states that phy-names is moved to the pcie0_port0 and pcie1_port0 nodes, but the property appears to only be removed from the parent nodes and never added back. Could this omission cause a regression during initialization if the driver or PHY framework strictly expects this property to be present?

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -0
index 74df5cd86f04f..d75f714632872 100644

[ ... ]

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -6
@@ -1901,22 +1901,20 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
-			wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
-

[ ... ]

arch/arm64/boot/dts/qcom/sm8150.dtsi pcie0: pcie@1c00000 { · line 1917

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +5 -1
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+				reset-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
+				wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+

[Severity: Medium]
Should phy-names = "pciephy" be added here for pcie0_port0, as indicated by the commit message?

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -0
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;

[ ... ]

Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +0 -4
@@ -2019,10 +2017,6 @@ pcie1: pcie@1c08000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
 			enable-gpio = <&tlmm 104 GPIO_ACTIVE_HIGH>;

[ ... ]

arch/arm64/boot/dts/qcom/sm8150.dtsi pcie1: pcie@1c08000 { · line 2034

Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8150.dtsi +4 -1
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+				reset-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
+

[Severity: Medium]
Similarly for pcie1_port0, was the phy-names property accidentally dropped during the move?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=26
#43 lore raw

PATCH 27/34 arm64: dts: qcom: sm8250: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, perst-gpios, and wake-gpios from the controller to the existing pcieport0 and newly labeled pcie1_port0 and pcie2_port0, allowing board-level overrides. Rename perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +14 -20
index e0c357222bc7..7fa26c1b37dc 100644
@@ -2207,12 +2207,6 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 81 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
 			dma-coherent;
@@ -2224,6 +2218,10 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+				reset-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
+				wake-gpios = <&tlmm 81 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2334,23 +2332,21 @@ pcie1: pcie@1c08000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 82 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 84 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie1_default_state>;
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+				reset-gpios = <&tlmm 82 GPIO_ACTIVE_LOW>;
+				wake-gpios = <&tlmm 84 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2461,23 +2457,21 @@ pcie2: pcie@1c10000 {
 
 			power-domains = <&gcc PCIE_2_GDSC>;
 
-			phys = <&pcie2_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie2_default_state>;
 			dma-coherent;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie2_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie2_phy>;
+				reset-gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
+				wake-gpios = <&tlmm 87 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#44 lore raw

PATCH 28/34 arm64: dts: qcom: sm8350: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0 and pcie1_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board file, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sm8350-hdk.dts | 16 ++++++++++------
 arch/arm64/boot/dts/qcom/sm8350.dtsi    | 14 ++++++--------
 2 files changed, 16 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/qcom/sm8350-hdk.dts +10 -6
index e9b9e03f725e..2e087416a598 100644
@@ -499,12 +499,14 @@ &pcie0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l5b_0p88>;
 	vdda-pll-supply = <&vreg_l6b_1p2>;
@@ -513,15 +515,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	status = "okay";
 	vdda-phy-supply = <&vreg_l5b_0p88>;
arch/arm64/boot/dts/qcom/sm8350.dtsi +6 -8
index 32b47f5ec1f6..74cd66d98c54 100644
@@ -1586,16 +1586,15 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie0_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -1695,16 +1694,15 @@ pcie1: pcie@1c08000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#45 lore raw

PATCH 29/34 arm64: dts: qcom: sm8450: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, perst-gpios, and wake-gpios from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Rename perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +9 -13
index 7bc5f85e7ebc..05e852ed7995 100644
@@ -2017,12 +2017,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie0_default_state>;
 
@@ -2063,6 +2057,10 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+				reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+				wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2182,12 +2180,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcie1_default_state>;
 
@@ -2263,11 +2255,15 @@ opp-32000000-4 {
 				};
 			};
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+				reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+				wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
Reviewed-by on v1 29/34
#46 lore raw

Re: [PATCH 29/34] arm64: dts: qcom: sm8450: Move PCIe phy and GPIOs to root port node

Quoted 12 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys, phy-names, perst-gpios, and wake-gpios from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Rename perst-gpios to reset-gpios to match the binding used in the root port context.

---
  arch/arm64/boot/dts/qcom/sm8450.dtsi | 22 +++++++++-------------
  1 file changed, 9 insertions(+), 13 deletions(-)

<snip>

Thanks,
Neil

#47 lore raw

Re: [PATCH 29/34] arm64: dts: qcom: sm8450: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Removing `phys` and `perst-gpios` from the root complex node breaks PCIe on older kernels.…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Removing phys and perst-gpios from the root complex node breaks PCIe on older kernels.
- [Medium] The commit message claims that phy-names was moved to the root port node, but it was completely dropped. --

commit f7da5024671b8a2ed22694b38cd5eab69ebf0cdc
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sm8450: Move PCIe phy and GPIOs to root port node

This commit moves the PCIe phy references and the perst/wake GPIO properties from the PCIe root complex controller node to the root port node. It also renames perst-gpios to reset-gpios to match the root port binding context.

Quoted 3 lines

Move phys, phy-names, perst-gpios, and wake-gpios from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides.

[Severity: Medium]
The commit message claims that phy-names was moved to the root port node, but looking at the changes to pcieport0 and pcie1_port0, it appears to have been completely dropped instead.

While devm_of_phy_get() correctly retrieves the first PHY if no name is provided, this creates a mismatch between the patch's intent as documented and the implemented code.

Should phy-names be added to the port nodes, or should the commit message be updated to reflect its removal?

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450.dtsi +0 -0
index 7bc5f85e7ebc0..05e852ed7995c 100644

[ ... ]

arch/arm64/boot/dts/qcom/sm8450.dtsi &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, · line 2025

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450.dtsi +0 -6
@@ -2017,12 +2017,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
-			perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-			wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-

[Severity: High]
Does removing phys and perst-gpios from the root complex node break backward compatibility for older kernels?

Older kernels booting with this updated device tree might fail to initialize the PCIe controller if they lack the logic to parse child port nodes and strictly look for phys and perst-gpios in the root complex node.

Since Device Tree is considered a stable ABI, does this break forward compatibility (booting a newer DT on an older kernel) by not leaving a deprecated fallback in the parent node?

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=29
#48 lore raw

PATCH 30/34 arm64: dts: qcom: talos: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys from the controller to pcie_port0, and move perst-gpios/wake-gpios from the &pcie controller overrides to the &pcie_port0 node in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/qcs615-ride.dts    | 8 +++++---
 arch/arm64/boot/dts/qcom/talos-evk-som.dtsi | 8 +++++---
 arch/arm64/boot/dts/qcom/talos.dtsi         | 8 ++++----
 3 files changed, 14 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/qcom/qcs615-ride.dts +5 -3
index 43f110ba3a7c..4edd2b1bb03a 100644
@@ -444,15 +444,17 @@ &mdss_dsi0_phy {
 };
 
 &pcie {
-	perst-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie_port0 {
+	reset-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	vdda-phy-supply = <&vreg_l5a>;
 	vdda-pll-supply = <&vreg_l12a>;
arch/arm64/boot/dts/qcom/talos-evk-som.dtsi +5 -3
index 198f656bddf1..715bbf29ac68 100644
@@ -366,15 +366,17 @@ &mdss_dsi0_phy {
 };
 
 &pcie {
-	perst-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie_port0 {
+	reset-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	vdda-phy-supply = <&vreg_l5a>;
 	vdda-pll-supply = <&vreg_l12a>;
arch/arm64/boot/dts/qcom/talos.dtsi +4 -4
index eedfdce3c479..a22f78f5a5de 100644
@@ -1367,9 +1367,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie_phy>;
-			phy-names = "pciephy";
-
 			max-link-speed = <2>;
 
 			operating-points-v2 = <&pcie_opp_table>;
@@ -1397,10 +1394,13 @@ opp-5000000 {
 			pcie_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+
+				phys = <&pcie_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
-				bus-range = <0x01 0xff>;
 			};
 		};
 
Signature · 1 line
2.34.1
#49 lore raw

Re: [PATCH 30/34] arm64: dts: qcom: talos: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Moving phys and reset-gpios into the root port child node activates a pre-existing PHY initialization resource leak in qcom_pcie_parse_port() on probe deferral. --

commit 97d4c74a5631a23e99d2209733340334556228ea
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: talos: Move PCIe phy and GPIOs to root port node

This commit moves PCIe PHY and GPIO properties (perst/wake) from the RC controller node to the root port node (pcie@0) in device tree files for QCS615 and Talos.

Quoted 4 lines
arch/arm64/boot/dts/qcom/qcs615-ride.dts +0 -0
index 43f110ba3a7c5..4edd2b1bb03af 100644

[ ... ]

Quoted 5 lines
arch/arm64/boot/dts/qcom/qcs615-ride.dts +0 -1
@@ -444,15 +444,17 @@ &mdss_dsi0_phy {
 };
 
 &pcie {
-	perst-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/qcom/qcs615-ride.dts &mdss_dsi0_phy { · line 454

Quoted 10 lines
arch/arm64/boot/dts/qcom/qcs615-ride.dts +2 -2
-	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie_port0 {
+	reset-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;

[Severity: High]
This isn't a bug introduced by this patch, but does moving reset-gpios into the root port node activate a PHY resource leak during probe deferral?

In drivers/pci/controller/dwc/pcie-qcom.c, qcom_pcie_parse_port() successfully gets the PHY and calls phy_init(), which increments the init_count and enables clocks and regulators. Immediately afterward, it calls qcom_pcie_parse_perst(), which requests reset-gpios.

If the GPIO controller probes later, this returns -EPROBE_DEFER:

drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_port() {
    ...
	ret = qcom_pcie_parse_perst(pcie, port, node);
	if (ret)
		return ret;
    ...
}

This error path returns without calling phy_exit() and without adding the port to the pcie->ports list. As a result, the cleanup path in qcom_pcie_parse_ports() also fails to invoke phy_exit().

This permanently leaks the phy_init() call on each probe deferral, meaning the underlying clocks and regulators will never be disabled, even on system suspend or driver unbind.

Quoted 3 lines
arch/arm64/boot/dts/qcom/qcs615-ride.dts +3 -0
+	wake-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
+};
+

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=30
#50 lore raw

PATCH 31/34 arm64: dts: qcom: sm8650: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts | 14 ++++++++------
 arch/arm64/boot/dts/qcom/sm8650-hdk.dts              | 14 ++++++++------
 arch/arm64/boot/dts/qcom/sm8650-mtp.dts              | 16 ++++++++++------
 arch/arm64/boot/dts/qcom/sm8650-qrd.dts              |  6 +++---
 arch/arm64/boot/dts/qcom/sm8650.dtsi                 | 10 ++++------
 5 files changed, 33 insertions(+), 27 deletions(-)
arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts +8 -6
index 668c183bc177..9fb53fd8c3f5 100644
@@ -1074,9 +1074,6 @@ &mdss_dp0_out {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -1084,6 +1081,9 @@ &pcie0 {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
@@ -1108,15 +1108,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_port0 {
 	/* Renesas μPD720201 PCIe USB3.0 HOST CONTROLLER */
 	usb-controller@0 {
arch/arm64/boot/dts/qcom/sm8650-hdk.dts +8 -6
index b73ad7861eb4..b0dc9f134497 100644
@@ -1027,9 +1027,6 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -1037,6 +1034,9 @@ &pcie0 {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
@@ -1061,15 +1061,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l3e_0p9>;
 	vdda-pll-supply = <&vreg_l3i_1p2>;
arch/arm64/boot/dts/qcom/sm8650-mtp.dts +10 -6
index 1332c864801f..945ebe063dac 100644
@@ -642,15 +642,17 @@ &mdss_dsi0_phy {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcieport0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l1i_0p88>;
 	vdda-pll-supply = <&vreg_l3i_1p2>;
@@ -659,15 +661,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l3e_0p9>;
 	vdda-pll-supply = <&vreg_l3i_1p2>;
arch/arm64/boot/dts/qcom/sm8650-qrd.dts +3 -3
index 2e874f046a0e..c1971638561b 100644
@@ -1021,9 +1021,6 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -1031,6 +1028,9 @@ &pcie0 {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
arch/arm64/boot/dts/qcom/sm8650.dtsi +4 -6
index b679fd8afb7d..39ecf4686c4b 100644
@@ -3700,9 +3700,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			num-lanes = <2>;
 			bus-range = <0 0xff>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			#address-cells = <3>;
 			#size-cells = <2>;
 			ranges = <0x01000000 0 0x00000000 0 0x60200000 0 0x100000>,
@@ -3769,6 +3766,8 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -3893,9 +3892,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			num-lanes = <2>;
 			bus-range = <0 0xff>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			dma-coherent;
 
 			#address-cells = <3>;
@@ -3978,6 +3974,8 @@ pcie1_port0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
Reviewed-by on v1 31/34
#51 lore raw

Re: [PATCH 31/34] arm64: dts: qcom: sm8650: Move PCIe phy and GPIOs to root port node

Quoted 16 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
  arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts | 14 ++++++++------
  arch/arm64/boot/dts/qcom/sm8650-hdk.dts              | 14 ++++++++------
  arch/arm64/boot/dts/qcom/sm8650-mtp.dts              | 16 ++++++++++------
  arch/arm64/boot/dts/qcom/sm8650-qrd.dts              |  6 +++---
  arch/arm64/boot/dts/qcom/sm8650.dtsi                 | 10 ++++------
  5 files changed, 33 insertions(+), 27 deletions(-)

<snip>

Thanks,
Neil

#52 lore raw

Re: [PATCH 31/34] arm64: dts: qcom: sm8650: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] Removing `phys` and `phy-names` from the Root Complex node breaks backwards compatibility with…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Removing phys and phy-names from the Root Complex node breaks backwards compatibility with older kernels.
- [Low] Duplicate &pcie1_port0 node definition in sm8650-ayaneo-pocket-s2.dts.
--

commit 833589d45fdeff1baf13bf57dca340bf7b4c39dc
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sm8650: Move PCIe phy and GPIOs to root port node

This commit moves the PCIe phy references and the perst/wake GPIO properties from the RC controller node to the root port node. It also renames the perst-gpios property to reset-gpios.

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts +0 -0
index 668c183bc1777..9fb53fd8c3f5e 100644

[ ... ]

Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts +0 -3
@@ -1108,15 +1108,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";

arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts &pcie0_phy { · line 1124

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8650-ayaneo-pocket-s2.dts +5 -0
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_port0 {
 	/* Renesas μPD720201 PCIe USB3.0 HOST CONTROLLER */
 	usb-controller@0 {

[Severity: Low]
Does this unintentionally duplicate the &pcie1_port0 node definition in sm8650-ayaneo-pocket-s2.dts?

Since there is already a &pcie1_port0 block directly below it, could these reset-gpios and wake-gpios properties be placed into that existing block instead to improve readability?

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8650.dtsi +0 -0
index b679fd8afb7d5..39ecf4686c4b8 100644

[ ... ]

arch/arm64/boot/dts/qcom/sm8650.dtsi &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, · line 3705

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8650.dtsi +0 -3
@@ -3700,9 +3700,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			num-lanes = <2>;
 			bus-range = <0 0xff>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			#address-cells = <3>;
 			#size-cells = <2>;
 			ranges = <0x01000000 0 0x00000000 0 0x60200000 0 0x100000>,

[Severity: Medium]
Will removing the phys and phy-names properties from the pcie0 Root Complex node break backwards compatibility with older kernels?

Older kernels booting with this updated Device Tree might fail to initialize the PCIe PHY because they only look for these properties in the parent Root Complex node, which could lead to a complete loss of PCIe functionality.

[ ... ]

arch/arm64/boot/dts/qcom/sm8650.dtsi &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, · line 3897

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8650.dtsi +0 -3
@@ -3893,9 +3892,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 			num-lanes = <2>;
 			bus-range = <0 0xff>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			dma-coherent;
 
 			#address-cells = <3>;

[Severity: Medium]
Is backward compatibility broken for older kernels on the pcie1 Root Complex node as well by removing these PHY references?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=31
#53 lore raw

PATCH 32/34 arm64: dts: qcom: msm8996: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to pcie0_port0, pcie1_port0, and pcie2_port0, adding labels to these nodes to allow board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi        | 15 ++++++++++++---
 .../arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi |  5 ++++-
 .../boot/dts/qcom/msm8996-sony-xperia-tone.dtsi     |  7 +++++--
 arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi |  4 +++-
 arch/arm64/boot/dts/qcom/msm8996.dtsi               | 21 +++++++++------------
 5 files changed, 33 insertions(+), 19 deletions(-)
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +12 -3
index 0c076852b494..ad435a13ba24 100644
@@ -458,23 +458,32 @@ hdmi_ddc_suspend: hdmi-ddc-suspend-state {
 
 &pcie0 {
 	status = "okay";
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&vreg_l28a_0p925>;
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1 {
 	status = "okay";
-	perst-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
 	vdda-supply = <&vreg_l28a_0p925>;
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
+};
+
 &pcie2 {
 	status = "okay";
-	perst-gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
 	vdda-supply = <&vreg_l28a_0p925>;
 };
 
+&pcie2_port0 {
+	reset-gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	status = "okay";
 
arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi +4 -1
index a4dcc88bb01f..7a3f8afae22d 100644
@@ -210,12 +210,15 @@ &mss_pil {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&vreg_l28a_0p925>;
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	vdda-phy-supply = <&vreg_l28a_0p925>;
 	vdda-pll-supply = <&vreg_l12a_1p8>;
arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi +5 -2
index 5b42c266557a..20b5eeef46e4 100644
@@ -191,13 +191,16 @@ &mmcc {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&pm8994_l28>;
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+};
+
 &pcie_phy {
 	vdda-phy-supply = <&pm8994_l28>;
 	vdda-pll-supply = <&pm8994_l12>;
arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi +3 -1
index 2abcc733dad8..3c70a9be45d2 100644
@@ -278,8 +278,10 @@ &pcie0 {
 	/* Supplied by vdd_3v3, but choose wlan_en to drive enable pin high */
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&vreg_l28a_0p925>;
+};
 
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+&pcie0_port0 {
+	reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
 	wake-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
 };
 
arch/arm64/boot/dts/qcom/msm8996.dtsi +9 -12
index 818e5660df91..f3c004f02cfc 100644
@@ -1924,9 +1924,6 @@ pcie0: pcie@600000 {
 				      <0x0c100000 0x100000>;
 				reg-names = "parf", "dbi", "elbi","config";
 
-				phys = <&pciephy_0>;
-				phy-names = "pciephy";
-
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges = <0x01000000 0x0 0x00000000 0x0c200000 0x0 0x100000>,
@@ -1975,11 +1972,13 @@ pcie0: pcie@600000 {
 						"bus_master",
 						"bus_slave";
 
-				pcie@0 {
+				pcie0_port0: pcie@0 {
 					device_type = "pci";
 					reg = <0x0 0x0 0x0 0x0 0x0>;
 					bus-range = <0x01 0xff>;
 
+					phys = <&pciephy_0>;
+
 					#address-cells = <3>;
 					#size-cells = <2>;
 					ranges;
@@ -2001,9 +2000,6 @@ pcie1: pcie@608000 {
 
 				reg-names = "parf", "dbi", "elbi","config";
 
-				phys = <&pciephy_1>;
-				phy-names = "pciephy";
-
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges = <0x01000000 0x0 0x00000000 0x0d200000 0x0 0x100000>,
@@ -2052,11 +2048,13 @@ pcie1: pcie@608000 {
 						"bus_master",
 						"bus_slave";
 
-				pcie@0 {
+				pcie1_port0: pcie@0 {
 					device_type = "pci";
 					reg = <0x0 0x0 0x0 0x0 0x0>;
 					bus-range = <0x01 0xff>;
 
+					phys = <&pciephy_1>;
+
 					#address-cells = <3>;
 					#size-cells = <2>;
 					ranges;
@@ -2076,9 +2074,6 @@ pcie2: pcie@610000 {
 
 				reg-names = "parf", "dbi", "elbi","config";
 
-				phys = <&pciephy_2>;
-				phy-names = "pciephy";
-
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges = <0x01000000 0x0 0x00000000 0x0e200000 0x0 0x100000>,
@@ -2126,11 +2121,13 @@ pcie2: pcie@610000 {
 						"bus_master",
 						"bus_slave";
 
-				pcie@0 {
+				pcie2_port0: pcie@0 {
 					device_type = "pci";
 					reg = <0x0 0x0 0x0 0x0 0x0>;
 					bus-range = <0x01 0xff>;
 
+					phys = <&pciephy_2>;
+
 					#address-cells = <3>;
 					#size-cells = <2>;
 					ranges;
Signature · 1 line
2.34.1
#54 lore raw

Re: [PATCH 32/34] arm64: dts: qcom: msm8996: Move PCIe phy and GPIOs to root port node

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Critical] Removing phys, phy-names, perst-gpios, and wake-gpios from the PCIe root complex (controller) node breaks device tree backwards compatibility with older kernels.
- [Medium] The commit message falsely claims to move phy-names to the root port nodes, but the property is completely omitted.

Pre-existing issues:
- [High] Missing phy_exit() cleanup on error paths leads to unbalanced PHY initialization. --

commit eb9552cbeaad8284f5ba99a861cad696426a8167
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: msm8996: Move PCIe phy and GPIOs to root port node

This commit updates the device tree bindings for the MSM8996 PCIe controllers by moving the PHY references and PERST/WAKE GPIO properties from the Root Complex nodes into the child port nodes. It also renames the perst-gpios property to reset-gpios to match the binding used in the root port context.

Quoted 2 lines

Move phys and phy-names from the controller to pcie0_port0, pcie1_port0, and pcie2_port0, adding labels to these

[Severity: Medium]
The commit message claims that phy-names is moved to the pcieX_port0 nodes, but it appears to be completely omitted in the changes below. Is the commit message inaccurate, or was the property accidentally dropped?

[ ... ]

arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi hdmi_ddc_suspend: hdmi-ddc-suspend-state { · line 463

Quoted 11 lines
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +0 -1
@@ -458,23 +458,32 @@ hdmi_ddc_suspend: hdmi-ddc-suspend-state {
 
 &pcie0 {
 	status = "okay";
-	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
 	vddpe-3v3-supply = <&wlan_en>;
 	vdda-supply = <&vreg_l28a_0p925>;
 };

[Severity: Critical]
Does removing the legacy perst-gpios property from the pcie0 controller override cause a device tree backwards compatibility regression?

Older kernels booting with this updated device tree might fail to initialize the PCIe controller because they cannot find the reset GPIOs on the Root Complex node.

[ ... ]

arch/arm64/boot/dts/qcom/msm8996.dtsi pcie0: pcie@600000 { · line 1928

Quoted 9 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +0 -2
@@ -1924,9 +1924,6 @@ pcie0: pcie@600000 {
 				      <0x0c100000 0x100000>;
 				reg-names = "parf", "dbi", "elbi","config";
 
-				phys = <&pciephy_0>;
-				phy-names = "pciephy";

[Severity: Critical]
Will removing these PHY bindings from the pcie0 controller node cause older kernel versions to fail to initialize the PCIe controller, since they may not scan the child port nodes for the PHY properties?

Quoted 5 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +0 -0
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges = <0x01000000 0x0 0x00000000 0x0c200000 0x0 0x100000>,
@@ -1975,11 +1972,13 @@ pcie0: pcie@600000 {
 						"bus_master",

arch/arm64/boot/dts/qcom/msm8996.dtsi pcie0: pcie@600000 { · line 1981

Quoted 10 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +3 -1
 						"bus_slave";
 
-				pcie@0 {
+				pcie0_port0: pcie@0 {
 					device_type = "pci";
 					reg = <0x0 0x0 0x0 0x0 0x0>;
 					bus-range = <0x01 0xff>;
 
+					phys = <&pciephy_0>;
+

[Severity: Medium]
Should phy-names = "pciephy" be added here, as described in the commit message?

[ ... ]

[Severity: High]
This is a pre-existing issue, but while reviewing the driver handling for these ports, is there a missing phy_exit() cleanup on error paths in drivers/pci/controller/dwc/pcie-qcom.c?

If probe defers due to GPIOs not being ready, the unbalanced PHY enable counts will accumulate. In qcom_pcie_parse_port():

drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_port() {
	...
	ret = qcom_pcie_parse_perst(pcie, port, node);
	if (ret)
		return ret;
	...
}

This early return bypasses PHY cleanup since the port is not yet added to the global list. Similarly, in qcom_pcie_parse_legacy_binding():

drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_legacy_binding() {
	...
	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
	if (!port)
		return -ENOMEM;
	...
}

Could these early returns cause resource leaks of the PHY state initialized earlier?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=32
#55 lore raw

PATCH 33/34 arm64: dts: qcom: lemans: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys from the controller to pcieport0 and pcieport1. Add the missing pcieport1 label to the pcie1 root port node to allow board-level overrides. Move perst-gpios/wake-gpios from the &pcie0/&pcie1 controller overrides to the respective &pcieport0/ &pcieport1 nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/lemans-evk.dts          | 13 +++++++------
 arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 13 +++++++------
 arch/arm64/boot/dts/qcom/lemans.dtsi             | 12 +++++-------
 3 files changed, 19 insertions(+), 19 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk.dts +7 -6
index 194e114a12a0..6946d83cccd1 100644
@@ -839,9 +839,6 @@ &mdss0_dp1_phy {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -856,15 +853,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l5a>;
 	vdda-pll-supply = <&vreg_l1c>;
@@ -873,6 +872,8 @@ &pcie1_phy {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 	port {
 		pcieport0_ep: endpoint {
 			remote-endpoint = <&m2_e_pcie_ep>;
arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi +7 -6
index 3ecf3d464dd7..a27bab7aba22 100644
@@ -961,9 +961,6 @@ wake-pins {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 
@@ -971,15 +968,17 @@ &pcie0 {
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l5a>;
 	vdda-pll-supply = <&vreg_l1c>;
@@ -995,6 +994,8 @@ &pcie1_phy {
 };
 
 &pcieport0 {
+	reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
 	wifi@0 {
 		compatible = "pci17cb,1101";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
arch/arm64/boot/dts/qcom/lemans.dtsi +5 -7
index 695eae1b7256..7ae08f29d974 100644
@@ -2753,9 +2753,6 @@ pcie0: pcie@1c00000 {
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			eq-presets-8gts = /bits/ 16 <0x5555 0x5555>;
 			eq-presets-16gts = /bits/ 8 <0x55 0x55>;
 
@@ -2767,6 +2764,8 @@ pcieport0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2927,19 +2926,18 @@ pcie1: pcie@1c10000 {
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			eq-presets-8gts = /bits/ 16 <0x5555 0x5555 0x5555 0x5555>;
 			eq-presets-16gts = /bits/ 8 <0x55 0x55 0x55 0x55>;
 
 			status = "disabled";
 
-			pcie@0 {
+			pcie1_port0: pcie@0 {
 				device_type = "pci";
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
#56 lore raw

PATCH 34/34 arm64: dts: qcom: sm8550: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
 arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi             | 16 ++++++++++------
 arch/arm64/boot/dts/qcom/sm8550-hdk.dts                  | 14 ++++++++------
 arch/arm64/boot/dts/qcom/sm8550-mtp.dts                  | 16 ++++++++++------
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts                  |  6 +++---
 arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts          |  7 +++++--
 .../boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts     |  8 +++++---
 arch/arm64/boot/dts/qcom/sm8550.dtsi                     | 10 ++++------
 7 files changed, 45 insertions(+), 32 deletions(-)
arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi +10 -6
index aaf5eb57ce23..b271c2056e83 100644
@@ -335,26 +335,30 @@ &mdss_dsi0_phy {
 };
 
 &pcie0 {
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l1e_0p88>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
 };
 
 &pcie1 {
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l3c_0p9>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
arch/arm64/boot/dts/qcom/sm8550-hdk.dts +8 -6
index 4777c908c4d7..c76ad7d17466 100644
@@ -1087,9 +1087,6 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -1097,6 +1094,9 @@ &pcie0 {
 };
 
 &pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
@@ -1121,15 +1121,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie1_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l3c_0p9>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
arch/arm64/boot/dts/qcom/sm8550-mtp.dts +10 -6
index eb1de33e5ba5..63d7e4da66d8 100644
@@ -739,15 +739,17 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie0_default_state>;
 
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l1e_0p88>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
@@ -756,15 +758,17 @@ &pcie0_phy {
 };
 
 &pcie1 {
-	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
-
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie1_default_state>;
 
 	status = "okay";
 };
 
+&pcie1_port0 {
+	reset-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>;
+};
+
 &pcie1_phy {
 	vdda-phy-supply = <&vreg_l3c_0p91>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
arch/arm64/boot/dts/qcom/sm8550-qrd.dts +3 -3
index 13cdb5b0ce40..18c258f3cafc 100644
@@ -987,9 +987,6 @@ &mdss_dp0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
@@ -997,6 +994,9 @@ &pcie0 {
 };
 
 &pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+
 	wifi@0 {
 		compatible = "pci17cb,1107";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts +5 -2
index cf4e4e9d9e26..8c4182719067 100644
@@ -510,13 +510,16 @@ &i2c_master_hub_0 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&vreg_l1e_0p88>;
 	vdda-pll-supply = <&vreg_l3e_1p2>;
arch/arm64/boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts +5 -3
index 9f347bea6c74..9d08993b8bc8 100644
@@ -584,15 +584,17 @@ cirrus,gpio-ctrl2 {
 };
 
 &pcie0 {
-	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
-	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
-
 	pinctrl-0 = <&pcie0_default_state>;
 	pinctrl-names = "default";
 
 	status = "okay";
 };
 
+&pcie0_port0 {
+	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
+};
+
 &pcie0_phy {
 	vdda-phy-supply = <&pm8550vs_2_l1>;
 	vdda-pll-supply = <&pm8550vs_2_l3>;
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -6
index 0e701e709235..9bbc31346f90 100644
@@ -2397,9 +2397,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			operating-points-v2 = <&pcie0_opp_table>;
 
 			status = "disabled";
@@ -2461,6 +2458,8 @@ pcie0_port0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
@@ -2583,9 +2582,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_1_GDSC>;
 
-			phys = <&pcie1_phy>;
-			phy-names = "pciephy";
-
 			operating-points-v2 = <&pcie1_opp_table>;
 
 			status = "disabled";
@@ -2663,6 +2659,8 @@ pcie1_port0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie1_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;
Signature · 1 line
2.34.1
Reviewed-by on v1 34/34
#57 lore raw

Re: [PATCH 34/34] arm64: dts: qcom: sm8550: Move PCIe phy and GPIOs to root port node

Quoted 20 lines · Krishna Chaitanya Chundru

The PCIe phy reference and the perst/wake GPIO properties are per root port and belong in the root port node (pcie@0), not in the RC controller node. Move phys and phy-names from the controller to the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides. Move perst-gpios/wake-gpios from the controller overrides to the respective port nodes in the board files, renaming perst-gpios to reset-gpios to match the binding used in the root port context.

---
  arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi             | 16 ++++++++++------
  arch/arm64/boot/dts/qcom/sm8550-hdk.dts                  | 14 ++++++++------
  arch/arm64/boot/dts/qcom/sm8550-mtp.dts                  | 16 ++++++++++------
  arch/arm64/boot/dts/qcom/sm8550-qrd.dts                  |  6 +++---
  arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts          |  7 +++++--
  .../boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts     |  8 +++++---
  arch/arm64/boot/dts/qcom/sm8550.dtsi                     | 10 ++++------
  7 files changed, 45 insertions(+), 32 deletions(-)

<snip>

Thanks,
Neil

#58 lore raw

Re: [PATCH 34/34] arm64: dts: qcom: sm8550: Move PCIe phy and GPIOs to root port node

In reply to Krishna Chaitanya Chundru
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message inaccurately claims that `phy-names` is moved to the root port node and that…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message inaccurately claims that phy-names is moved to the root port node and that pcie1_port0 is a newly added label. --

commit 5a165f26f5136ff46d1b26908e6f480f88cfa37b
Author: Krishna Chaitanya Chundru <[email protected]>

arm64: dts: qcom: sm8550: Move PCIe phy and GPIOs to root port node

This commit updates the sm8550 devicetrees to move the PCIe PHY references and the PERST/WAKE GPIO properties from the root complex controller nodes down to the respective root port nodes. It also renames perst-gpios to reset-gpios to match the root port binding context. These changes enable board-level overrides for port-specific configurations.

Quoted 3 lines

Move phys and phy-names from the controller to
the existing pcieport0 and newly labeled pcie1_port0, allowing board-level overrides.

[Severity: Medium]
Is this description accurate? Looking at the baseline code in sm8550.dtsi, the pcie1_port0 label already exists and doesn't appear to be newly added by this commit.

Quoted 15 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +0 -3
index 0e701e709235c..9bbc31346f900 100644
@@ -2397,9 +2397,6 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
 
 			power-domains = <&gcc PCIE_0_GDSC>;
 
-			phys = <&pcie0_phy>;
-			phy-names = "pciephy";
-
 			operating-points-v2 = <&pcie0_opp_table>;
 
 			status = "disabled";

arch/arm64/boot/dts/qcom/sm8550.dtsi pcie0_port0: pcie@0 { · line 2465

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8550.dtsi +2 -0
@@ -2461,6 +2458,8 @@ pcie0_port0: pcie@0 {
 				reg = <0x0 0x0 0x0 0x0 0x0>;
 				bus-range = <0x01 0xff>;
 
+				phys = <&pcie0_phy>;
+
 				#address-cells = <3>;
 				#size-cells = <2>;
 				ranges;

[Severity: Medium]
The commit message states that phy-names is being moved to the root port node, but it looks like it was dropped from the controller and not re-added here alongside phys. Was phy-names intentionally removed instead of being moved?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=34
#59 lore raw
In reply to Krishna Chaitanya Chundru
Quoted 13 lines · Krishna Chaitanya Chundru

PCIe wake is active low signal as per the PCIe base spec, Several Qualcomm platform devicetrees incorrectly describe wake-gpios as GPIO_ACTIVE_HIGH.

The PCIe PHY references and PERST/WAKE GPIO properties are defined on a per-root-port basis and do not belong to the PCIe controller (RC) node. Keeping these properties at the controller level makes the description less accurate and prevents clean per-port customization.

This series moves the PHY references (phys, phy-names) from the PCIe controller node to the corresponding root port nodes (pcie@0), namely pcie0_port0, pcie1_port0, and pcie2_port0. Labels are added to these port nodes to enable board-level overrides where required.

Quoted 6 lines

Additionally, the PERST and WAKE GPIO properties are relocated from controller-level board overrides to their respective root port nodes in the board DTS files. As part of this change, 'perst-gpios' is renamed to 'reset-gpios' to align with the binding used in the PCIe root port context.

Please split Root Port binding rework and WAKE# polarity fix to separate series.

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்