arm64: dts: qcom: use pci for device nodes
cover arm64: dts: qcom: use pci for device nodes
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
This unfortunately changed the way the devicetree code treats the nodes, because of_bus_pci_match() considers any node named pcie@ that has no device_type property to be a PCI bus.
The previous name "pci" matched such nodes as "default-flags" bus type (defined in the of_busses[] array). This series restores the previous behavior for these endpoint nodes.
-Alex
Alex Elder (5):
arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
arm64: dts: qcom: qcs6490-rb3gen2-industrial-mezzanine: use pci for
device nodes
arm64: dts: qcom: lemans-evk-ifp-mezzanine: use pci for device nodes
arm64: dts: qcom: monaco-evk-ifp-mezzanine: use dev for device nodes
arm64: dts: qcom: qcs6490-thundercomm-minipc-g1iot: use dev for device
nodes
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso | 4 ++-- arch/arm64/boot/dts/qcom/monaco-evk-ifp-mezzanine.dtso | 4 ++-- .../dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso | 8 ++++---- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- .../boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-)
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
Signature · 1 line
2.53.0
PATCH 1/5 arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
An RB3gen2 system has an "interposer board" that contains a TC9564 SoC. The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
Unfortunately, of_node_is_pcie() causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.
Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +2 -2
@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -962,7 +962,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Conceptual Flaw / False Premise: Renaming the node does not prevent it from being treated as a…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Conceptual Flaw / False Premise: Renaming the node does not prevent it from being treated as a PCI bus because device_type = "pci" is still present. --
commit 3cd795cb2f33ffae376d5bceb9ba0da490602d05
Author: Alex Elder <[email protected]>
arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
This commit renames devicetree nodes from pcie@ to pci@ with the intent of stopping the embedded PCIe endpoints from being treated as PCI buses by the devicetree parsing code.
Quoted 13 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Quoted 1 line
device_type= "pci";
[Severity: Medium]
Does this node rename actually prevent the devicetree parsing code from treating it as a PCI bus?
The commit message indicates that renaming the node away from pcie@ will stop of_node_is_pcie() from matching it. However, because this node explicitly specifies device_type = "pci", of_bus_pci_match() in drivers/of/address.c will still return true immediately.
When evaluating buses, of_bus_pci_match() checks:
of_node_is_type(np, "pci") || of_node_is_pcie(np)
Since the device type is explicitly "pci", the match succeeds before of_node_is_pcie() is evaluated. Should device_type = "pci" also be removed to actually prevent this endpoint from being treated as a PCI bridge?
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
Quoted 21 lines · On 9/1/26 12:39 PM, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Conceptual Flaw / False Premise: Renaming the node does not prevent it from being treated as a PCI bus becausedevice_type = "pci"is still present. --commit
3cd795cb2f33ffae376d5bceb9ba0da490602d05
Author: Alex Elder <[email protected]>arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
This commit renames devicetree nodes from pcie@ to pci@ with the intent of stopping the embedded PCIe endpoints from being treated as PCI buses by the devicetree parsing code.
Quoted 8 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0
-0@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>;
Quoted 10 lines
Quoted 6 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1- pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;device_type = "pci";[Severity: Medium]
Does this node rename actually prevent the devicetree parsing code from treating it as a PCI bus?
This patch (series) is being done separate from another pre-existing series that addresses that particular issue. I suppose once that is merged I can re-issue this one.
https://lore.kernel.org/lkml/[email protected]/
It looks like I might get a similar comment from Sashiko on other patches in this series... I won't respond to any others unless what is noted differs from what I've explained here.
-Alex
Quoted 15 lines
The commit message indicates that renaming the node away from pcie@ will stop
of_node_is_pcie()from matching it. However, because this node explicitly specifiesdevice_type= "pci",of_bus_pci_match()indrivers/of/address.cwill still return true immediately.When evaluating buses,
of_bus_pci_match()checks:of_node_is_type(np, "pci") || of_node_is_pcie(np)Since the device type is explicitly "pci", the match succeeds before
of_node_is_pcie()is evaluated. Shoulddevice_type= "pci" also be removed to actually prevent this endpoint from being treated as a PCI bridge?[ ... ]
Rob Herring
maintainerRe: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
In reply to Alex ElderQuoted 34 lines · Alex Elder
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
An RB3gen2 system has an "interposer board" that contains a TC9564 SoC. The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit
e806c63ba51a7("arm64: dts: qcom: Rename pci@ nodes to pcie@").Unfortunately,
of_node_is_pcie()causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
Fixes e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@")Signed-off-by Alex Elder <[email protected]>--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0
-0
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts pcie@3,0 { · line 957
Quoted 5 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 {
The kernel should treat either name the same. There may have been some reason 'pci' was not included in checks. It could have been that only old things are (parallel, plain) 'pci' and anything new is 'pcie'.
These are ethernet devices, right? Then the right name is 'ethernet@0,0'. If not, then pick something that matches what the node is. Both pci and pcie mean the node implements a PCI bus.
Rob
Re: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
Quoted 38 lines · Rob Herring
Quoted 37 lines · Alex Elder
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
An RB3gen2 system has an "interposer board" that contains a TC9564 SoC. The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit
e806c63ba51a7("arm64: dts: qcom: Rename pci@ nodes to pcie@").Unfortunately,
of_node_is_pcie()causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
Fixes e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@")Signed-off-by Alex Elder <[email protected]>--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0
-0@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>;
Quoted 6 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts pcie@3,0 { · line 957
Quoted 2 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1- pcie@0,0 { + pci@0,0 {The kernel should treat either name the same. There may have been some reason 'pci' was not included in checks. It could have been that only old things are (parallel, plain) 'pci' and anything new is 'pcie'.
OK. Does this mean "pci@" and "pcie@" should only represent bridge devices? (These devices are all endpoints and erroneously had device_type = "pci" properties, among other things, so I'm already fixing that.)
Do you want me to make a (separate) change to treat "pci" the same as "pcie"?
Quoted 3 lines
These are ethernet devices, right? Then the right name is 'ethernet@0,0'. If not, then pick something that matches what the node is. Both pci and pcie mean the node implements a PCI bus.
They implement Ethernet devices, yes. But they are used for pci-ep-bus (and the Ethernet devices bind to a sub-node), and that's what's important about these nodes. What's the right name? The dynamically-generated node uses "dev@".
Is "ethernet@" still right, if it's also used to access a clock and a reset and ... via pci-ep-bus?
I want to use the right name, I'm just unsure about what that is, given its use for access via pci-ep-bus.
Thanks.
-Alex
Quoted 1 line
Rob
Rob Herring
maintainerRe: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
Quoted 46 lines · Alex Elder
Quoted 38 lines · Rob Herring
Quoted 37 lines · Alex Elder
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
An RB3gen2 system has an "interposer board" that contains a TC9564 SoC. The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit
e806c63ba51a7("arm64: dts: qcom: Rename pci@ nodes to pcie@").Unfortunately,
of_node_is_pcie()causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
Fixes e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@")Signed-off-by Alex Elder <[email protected]>--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0
-0@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>;Quoted 6 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts pcie@3,0 { · line 957
Quoted 2 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1- pcie@0,0 { + pci@0,0 {The kernel should treat either name the same. There may have been some reason 'pci' was not included in checks. It could have been that only old things are (parallel, plain) 'pci' and anything new is 'pcie'.
Quoted 4 lines
OK. Does this mean "pci@" and "pcie@" should only represent bridge devices? (These devices are all endpoints and erroneously had
device_type= "pci" properties, among other things, so I'm already fixing that.)
Yes.
Quoted 2 lines
Do you want me to make a (separate) change to treat "pci" the same as "pcie"?
Only if it fixes something besides consistency.
Quoted 8 lines
Quoted 3 lines
These are ethernet devices, right? Then the right name is 'ethernet@0,0'. If not, then pick something that matches what the node is. Both pci and pcie mean the node implements a PCI bus.
They implement Ethernet devices, yes. But they are used for pci-ep-bus (and the Ethernet devices bind to a sub-node), and that's what's important about these nodes. What's the right name? The dynamically-generated node uses "dev@".
I don't love 'dev', but don't have a better suggestion for it.
Quoted 3 lines
Is "ethernet@" still right, if it's also used to access a clock and a reset and ... via pci-ep-bus?
"ethernet@" belongs on the node that has ethernet-controller.yaml schema applied.
Quoted 3 lines
I want to use the right name, I'm just unsure about what that is, given its use for access via pci-ep-bus.
I don't know if there's a right name here. You just can't use a standard name if the node doesn't implement what the standard name defines. Granted we just have a list in the spec and some names (e.g. pci) imply more that other names.
Rob
Re: [PATCH 1/5] arm64: dts: qcom: qcs6490-rb3gen2: use pci for device nodes
Quoted 6 lines · Rob Herring
Quoted 5 lines · Alex Elder
Quoted 4 lines · Rob Herring
Quoted 3 lines · Alex Elder
A recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
I respond below, and have a plan for moving forward.
Quoted 40 lines
Quoted 40 lines
Quoted 39 lines
Quoted 30 lines
An RB3gen2 system has an "interposer board" that contains a TC9564 SoC. The TC9564 includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit
e806c63ba51a7("arm64: dts: qcom: Rename pci@ nodes to pcie@").Unfortunately,
of_node_is_pcie()causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
Fixes e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@")Signed-off-by Alex Elder <[email protected]>--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0
-0arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts pcie@3,0 { · line 957
Quoted 5 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1
-1@@ -954,7 +954,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 {The kernel should treat either name the same. There may have been some reason 'pci' was not included in checks. It could have been that only old things are (parallel, plain) 'pci' and anything new is 'pcie'.
Quoted 6 lines
Quoted 4 lines
OK. Does this mean "pci@" and "pcie@" should only represent bridge devices? (These devices are all endpoints and erroneously had
device_type= "pci" properties, among other things, so I'm already fixing that.)Yes.
OK. This means that these nodes were misnamed, and that should be fixed when addressing the broader problem of describing these nodes as if they were a PCI bridges rather than endpoints. That problem is addressed in this other series:
https://lore.kernel.org/lkml/[email protected]/
Lots of reviews on that... But I'll submit *one more version* of it, as described below.
Quoted 4 lines
Quoted 2 lines
Do you want me to make a (separate) change to treat "pci" the same as "pcie"?
Only if it fixes something besides consistency.
I have no example of this causing a problem, so I will not implement any such change.
Quoted 10 lines
Quoted 8 lines
Quoted 3 lines
These are ethernet devices, right? Then the right name is 'ethernet@0,0'. If not, then pick something that matches what the node is. Both pci and pcie mean the node implements a PCI bus.
They implement Ethernet devices, yes. But they are used for pci-ep-bus (and the Ethernet devices bind to a sub-node), and that's what's important about these nodes. What's the right name? The dynamically-generated node uses "dev@".
I don't love 'dev', but don't have a better suggestion for it.
OK. The only reason I like "dev" is that it matches what the dynamic PCI devicetree nodes are named.
Quoted 5 lines
Quoted 2 lines
Is "ethernet@" still right, if it's also used to access a clock and a reset and ... via pci-ep-bus?
"ethernet@" belongs on the node that has
ethernet-controller.yamlschema applied.
That makes sense and it's actually how it's done in our code currently (not all of it is currently out for review).
Quoted 7 lines
Quoted 2 lines
I want to use the right name, I'm just unsure about what that is, given its use for access via pci-ep-bus.
I don't know if there's a right name here. You just can't use a standard name if the node doesn't implement what the standard name defines. Granted we just have a list in the spec and some names (e.g. pci) imply more that other names.
Here is my plan.
First, I will use "dev@" rather than "pci@" for the names of these endpoint nodes--in all of the affected Qualcomm DTS files.
Second, rather than doing that as a follow-on to *this* series, I will instead post version 3 of the series linked to above, adding to the changes made that the names of the nodes will get changed as well (for the reasons covered here). I therefore retract this series, because it will be merged into the other one.
==> MANI, KONRAD, ABEL: I am going to keep your
Reviewed-by tags on the new version, because I think it's more likely than not you agree with this change.
Please just ask me to remove it when I post if you disagree.
-Alex
Quoted 2 lines
Rob
PATCH 2/5 arm64: dts: qcom: qcs6490-rb3gen2-industrial-mezzanine: use pci for device nodes
In reply to Alex ElderA recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the code devicetree as PCI buses, which is incorrect.
There are three TC9564 SoCs on the RB3gen2 system with an industrial mezzanine. All implement a PCIe switch that includes an upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The first TC9564 is found on the "interposer board." Its upstream switch port connects to the QCS6490 host PCIe root port 1, and is described in "qcs6490-rb3gen2.dts".
The other two TC9564 SoCs are found on the industrial mezzanine board and are described in "qcs6490-rb3gen2-industrial-mezzanine.dtso". The upstream switch port for one of these connects to the QCS6490 host PCIe root port 0. The upstream port for the other is connected to the second downstream PCIe switch port of the TC9564 on root port 1.
---------------
| QCS6490 |
| Host |
| PCIe0 PCIe1 | +
----+-----+---- ------------------ |
| | | TC9564 1 | | ------------------
| | | DSP1 +--- | TC9564 2 |
| -------+ USP | | DSP1 +-----+
| | DSP3 DSP2 +-----+ USP |
| | / \ | | DSP3 DSP2 +-----+
| | EPF0 EPF1 | | / \ |
| ----+------+------ | EPF0 EPF1 |
| ------------------ ----+------+------
| | TC9564 3 |
| | DSP1 +-----+
-------------+ USP |
| DSP3 DSP2 +-----+
| / \ |
| EPF0 EPF1 |
----+------+------The third downstream port (DSP3) on all three of these has an embedded PCIe endpoint with two functions, each of which implements a 10 Gbps-capable Ethernet interface. These devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
Unfortunately, when these nodes are named "pcie@" (as they are now), of_node_is_pcie() causes them to be treated as PCI bridges, which they are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.
Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
--- .../dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso +4 -4
@@ -130,7 +130,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -138,7 +138,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -225,7 +225,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -233,7 +233,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 2/5] arm64: dts: qcom: qcs6490-rb3gen2-industrial-mezzanine: use pci for device nodes
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] The patch claims to fix PCIe endpoints being incorrectly treated as PCI bridges by renaming them from pcie@ back to pci@. However, this is a placebo fix that fails to resolve the issue because the nodes still retain the device_type = "pci" property. --
commit 8f05438af7136e29082530fe0089fb496985289a
Author: Alex Elder <[email protected]>
arm64: dts: qcom: qcs6490-rb3gen2-industrial-mezzanine: use pci for device nodes
This commit renames embedded PCIe endpoint nodes on the TC9564 SoCs from pcie@ back to pci@ to prevent them from being incorrectly treated as PCI bridges. The commit message states that the previous name pcie@ caused of_node_is_pcie() to match them as bridge nodes.
Quoted 4 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso +0
-0
[ ... ]
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso pcie@3,0 { · line 136
Quoted 9 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso +1
-1@@ -130,7 +130,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
[Severity: High]
This is a pre-existing issue, but does this rename actually resolve the problem of endpoints being treated as PCI bridges?
Looking at drivers/of/address.c, the devicetree match logic in of_bus_pci_match() is evaluated as:
return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") ||
of_node_is_type(np, "vci") || of_node_is_type(np, "ht") ||
of_node_is_pcie(np);Since the endpoint node retains the device_type = "pci" property just below these cells, of_node_is_type(np, "pci") evaluates to true. This short-circuits the condition before the of_node_is_pcie(np) name check is ever reached.
Because of this property, will the nodes continue to be matched as PCI buses even with the name changed to pci@0,0, making this a placebo fix?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH 3/5 arm64: dts: qcom: lemans-evk-ifp-mezzanine: use pci for device nodes
In reply to Alex ElderA recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
The Lemans EVK IFP mezzanine has a TC9564 SoC, which includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
Unfortunately, of_node_is_pcie() causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.
Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
--- arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso +2 -2
@@ -271,7 +271,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -279,7 +279,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 3/5] arm64: dts: qcom: lemans-evk-ifp-mezzanine: use pci for device nodes
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Ineffective Bug Fix / Logic Flaw: renaming nodes fails to prevent them from being parsed as PCI…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Ineffective Bug Fix / Logic Flaw: renaming nodes fails to prevent them from being parsed as PCI bridges --
commit a26d89db10179b360a293aeb14a12f49b7daf216
Author: Alex Elder <[email protected]>
arm64: dts: qcom: lemans-evk-ifp-mezzanine: use pci for device nodes
This patch renames the PCIe endpoint nodes from "pcie@" to "pci@" in the Lemans EVK IFP mezzanine devicetree. The goal is to prevent the devicetree parsing code from incorrectly treating these endpoint nodes as PCI bridge nodes.
Quoted 13 lines
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso +1
-1@@ -271,7 +271,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Quoted 1 line
device_type= "pci";
[Severity: Medium]
Will this rename successfully prevent the node from being matched as a PCI bridge?
When the devicetree address parser matches the bus type, it iterates of_busses and calls of_bus_pci_match() which checks:
of_bus_pci_match() {
return of_node_is_type(np, "pci") || ... || of_node_is_pcie(np);
}Since this node still retains the device_type = "pci" property, of_node_is_type(np, "pci") will evaluate to true immediately.
Does this mean the of_node_is_pcie() check is completely bypassed, leaving the node still incorrectly matched as a PCI bus? Should the device_type = "pci" property be removed from these endpoint nodes instead, as required by the devicetree specification?
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso pcie@0,0 {
Quoted 9 lines
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso +1
-1ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>; device_type = "pci";
[Severity: Medium]
Does the same logic flaw apply to this node as well?
Because the device_type = "pci" property is also still present here, it appears this node will also unconditionally match as a PCI bus in of_bus_pci_match() regardless of the rename.
Quoted 3 lines
arch/arm64/boot/dts/qcom/lemans-evk-ifp-mezzanine.dtso +0
-0ranges; }; };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH 4/5 arm64: dts: qcom: monaco-evk-ifp-mezzanine: use dev for device nodes
In reply to Alex ElderA recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
The Monaco EVK IFP mezzanine has a TC9564 SoC, which includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
Unfortunately, of_node_is_pcie() causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.
Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
--- arch/arm64/boot/dts/qcom/monaco-evk-ifp-mezzanine.dtso | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/monaco-evk-ifp-mezzanine.dtso +2 -2
@@ -117,7 +117,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -125,7 +125,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 4/5] arm64: dts: qcom: monaco-evk-ifp-mezzanine: use dev for device nodes
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:
New issues:
- [Medium] Mismatch between the commit title and the patch implementation regarding the new node name.
Pre-existing issues:
- [High] Renaming the endpoint nodes from 'pcie@' to 'pci@' will not prevent them from being treated as PCI buses, because the device_type = "pci" property is retained. --
commit c206fa07d8c746582b6a4894fa608acb472261eb
Author: Alex Elder <[email protected]>
Quoted 1 line
arm64: dts: qcom: monaco-evk-ifp-mezzanine: use dev for device nodes
[Severity: Medium]
Does the commit title match the implementation? The title explicitly mentions using "dev for device nodes", but the patch renames the nodes to "pci@", not "dev@".
This patch aims to fix an issue where embedded PCIe endpoints were incorrectly treated as PCI buses after being renamed to pcie@. It renames the nodes to pci@ to restore previous behavior and avoid them being mistaken for bridge nodes.
Quoted 4 lines
arch/arm64/boot/dts/qcom/monaco-evk-ifp-mezzanine.dtso +0
-0
[ ... ]
Quoted 10 lines
arch/arm64/boot/dts/qcom/monaco-evk-ifp-mezzanine.dtso +1
-1@@ -117,7 +117,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
device_type= "pci";
[Severity: High]
This is a pre-existing issue, but does renaming the node to "pci@" actually prevent it from being treated as a PCI bus?
The node pci@0,0 retains the device_type = "pci" property. When the devicetree address parser matches buses, of_bus_pci_match() in drivers/of/address.c evaluates the type before checking the node name:
drivers/of/address.c:of_bus_pci_match() {
...
return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") ||
of_node_is_type(np, "vci") || of_node_is_type(np, "ht") ||
of_node_is_pcie(np);
}Because device_type = "pci" remains present in the endpoint node, of_node_is_type() will still evaluate to true. Will this cause the node to always be matched as a PCI bus unconditionally, rendering the rename ineffective at restoring the default-flags bus behavior?
This same question applies to the pci@0,1 node modified later in the file.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH 4/5] arm64: dts: qcom: monaco-evk-ifp-mezzanine: use dev for device nodes
Quoted 2 lines · On 9/1/26 12:54 PM, [email protected] wrote:
New issues:
- [Medium] Mismatch between the commit title and the patch implementation regarding the new node name.
This was indeed a mistake. I will update to say "use pci" rather than "use dev" in the title.
As an aside... I initially tried using "dev" for these nodes. The reason was that of_pci_make_dev_node() uses that convention for non-bridge nodes. This was introduced by commit 407d1a51921e9 ("PCI: Create device tree node for bridge"), and I haven't yet gone to see if there was discussion about that choice when that patch was out for review.
However DTC complains if a node is not named "pci" or "pcie", so I went back to using "pci" for these endpoint nodes instead.
I personally think dynamically-generated devicetree content should honor the same conventions and restrictions used for static devicetree files. There isn't an automated way to do that though.
I was thinking of following up with a proposed change to of_pci_make_dev_node() to at least use "pci" rather than "dev" for non-bridge nodes, but I'm not sure that's the right thing to do.
Comments welcome.
-Alex
PATCH 5/5 arm64: dts: qcom: qcs6490-thundercomm-minipc-g1iot: use dev for device nodes
In reply to Alex ElderA recent change caused the embedded PCIe endpoints on TC9564 SoCs to be treated by the devicetree code as PCI buses, which is incorrect.
The Thundercomm AI Mini PC G1 IoT defines a TC956x SoC, which includes a PCIe switch with one upstream port and two downstream (external) ports, plus a third downstream port. The third port has an embedded PCIe endpoint with two functions, each providing access to a 10 Gbps capable Ethernet interface.
The devicetree nodes representing these functions were previously named "pci@" but were renamed in the interest of consistency in commit e806c63ba51a7 ("arm64: dts: qcom: Rename pci@ nodes to pcie@").
Unfortunately, of_node_is_pcie() causes nodes named "pcie@" to be treated as PCI bridges, which PCI endpoints are not. The previous name "pci" matched such nodes as "default-flags" bus type, defined in the of_busses[] array.
Rename the PCIe endpoint nodes "pci@" so they are not mistaken for bridge nodes by the devicetree parsing code. This restores the previous behavior, and allows them to be used for PCI endpoint bus.
--- arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts +2 -2
@@ -790,7 +790,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
@@ -798,7 +798,7 @@ pcie@0,0 { ranges; }; - pcie@0,1 { + pci@0,1 { reg = <0x50100 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 5/5] arm64: dts: qcom: qcs6490-thundercomm-minipc-g1iot: use dev for device nodes
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit claims that renaming PCIe endpoint nodes from `pcie@` to `pci@` prevents them from…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit claims that renaming PCIe endpoint nodes from pcie@ to pci@ prevents them from being incorrectly treated as PCI buses by of_bus_pci_match(). However, this fix is logically flawed and entirely ineffective because the endpoint nodes still contain the device_type = "pci" property. of_bus_pci_match() checks of_node_is_type(np, "pci") before checking the node name via of_node_is_pcie(np). Because the device_type = "pci" property is present on the nodes, the match short-circuits and evaluates to true unconditionally, bypassing the name check. As a result, the endpoints will still be treated as PCI buses, failing to restore the desired default-flags bus behavior. --
commit 1271b9698d89ac8a7e9afe5810c933ffba016f7f
Author: Alex Elder <[email protected]>
arm64: dts: qcom: qcs6490-thundercomm-minipc-g1iot: use dev for device nodes
This commit renames the PCIe endpoint nodes from "pcie@" to "pci@" in the Thundercomm AI Mini PC G1 IoT devicetree. The goal is to prevent these endpoints from being incorrectly treated as PCI buses by the parsing logic in of_node_is_pcie().
arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts pcie@3,0 { · line 796
Quoted 13 lines
arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts +1
-1@@ -790,7 +790,7 @@ pcie@3,0 { ranges; bus-range = <0x5 0xff>; - pcie@0,0 { + pci@0,0 { reg = <0x50000 0x0 0x0 0x0 0x0>; #address-cells = <3>; #size-cells = <2>;
[Severity: Medium]
Does this rename actually prevent the node from being treated as a PCI bridge?
The commit message states that renaming the nodes to "pci@" stops them from being treated as PCI bridges by bypassing of_node_is_pcie(). However, these nodes still contain the property device_type = "pci" (visible just below this diff context).
During devicetree address parsing, of_bus_pci_match() in drivers/of/address.c checks the device type before it checks the node name:
drivers/of/address.c:of_bus_pci_match() {
return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") ||
of_node_is_type(np, "vci") || of_node_is_type(np, "ht") ||
of_node_is_pcie(np);
}Since of_node_is_type(np, "pci") evaluates to true, the match short-circuits and succeeds unconditionally, bypassing the of_node_is_pcie() check entirely.
Will these endpoints still be mistakenly treated as PCI buses despite the name change?
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5