Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Elder" <elder@riscstar.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v3 3/3] arm64: dts: qcom: qcs6490-rb3gen2: add endpoint buses
Date: Tue, 15 Sep 2026 18:25:18 +0000	[thread overview]
Message-ID: <20260915182519.977DF1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915181003.1633543-4-elder@riscstar.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] PCI endpoint dynamic ranges update fails due to static node definition
- [Low] dtc warning: pci-ep-bus@4 unit-address lacks reg property
--

commit 8f41aa3c7aef831e8b83dd47d6e93a9ac9228f4f
Author: Alex Elder <elder@riscstar.com>

arm64: dts: qcom: qcs6490-rb3gen2: add endpoint buses

The TC9564 SoC incorporates a PCIe switch, which is connected via the second
PCI segment (0001) on the RB3gen2 platform. The downstream port has an
embedded PCIe endpoint that implements two PCIe functions, and this patch
adds the devicetree nodes representing these buses.

> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> index 3bb5fca8e2b13..5b7f5292a8864 100644
> --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> @@ -955,11 +955,41 @@ pcie@3,0 {
>  			bus-range = <0x5 0xff>;
>  
>  			dev@0,0 {
> +				compatible = "pci1179,0220";
>  				reg = <0x50000 0x0 0x0 0x0 0x0>;
> +				#address-cells = <3>;
> +				#size-cells = <2>;
> +				/* Ranges will be updated dynamically */
> +				ranges = <0x0 0x0 0x0  0x83050000 0x0 0x0  0x0 0x4000>,
> +					 <0x2 0x0 0x0  0x83050000 0x0 0x4000  0x0 0x80000>,
> +					 <0x4 0x0 0x0  0x83050000 0x0 0x84000  0x0 0x200000>;

[Severity: High]
Will these ranges actually be updated dynamically during boot?

The commit message states the ranges property will be updated dynamically.
However, the PCI quirk calls of_pci_make_dev_node() which has an early return
if the device node is already statically defined in the device tree:

    if (pci_device_to_OF_node(pdev))
        return;

Since dev@0,0 is defined here in the devicetree, it seems they are linked
during initial PCI enumeration, causing the update to be skipped entirely.
Furthermore, even if the early return was bypassed, the update uses
__of_add_property(), which rejects existing properties with -EEXIST.

Could this leave devices on the pci-ep-bus with invalid MMIO addresses mapped
to unassigned PCI regions?

> +
> +				pci-ep-bus@4 {
> +					compatible = "simple-bus";
> +					#address-cells = <1>;
> +					#size-cells = <1>;
> +					/* Map 0x0-0x1fffff to BAR 4 */
> +					ranges = <0x0  0x4 0x0 0x0  0x200000>;
> +				};

[Severity: Low]
Does this unit address trigger a devicetree compiler warning?

The pci-ep-bus@4 node is assigned a unit address of @4, but it lacks a
matching reg property. According to the Devicetree specification, if a node
uses a unit address, it must have a matching reg property.

For simple buses without a reg property, the unit address must match the
first child address in the ranges property, which is 0x0 here, rather than 4.

>  			};
>  
>  			dev@0,1 {
> +				compatible = "pci1179,0220";
>  				reg = <0x50100 0x0 0x0 0x0 0x0>;
> +				#address-cells = <3>;
> +				#size-cells = <2>;
> +				/* Ranges will be updated dynamically */
> +				ranges = <0x0 0x0 0x0  0x83050100 0x0 0x0  0x0 0x4000>,
> +					 <0x2 0x0 0x0  0x83050100 0x0 0x4000  0x0 0x80000>,
> +					 <0x4 0x0 0x0  0x83050100 0x0 0x84000  0x0 0x200000>;

[Severity: High]
As with dev@0,0 above, it appears this node might also be skipped by
of_pci_make_dev_node() because it is statically defined. Will this prevent
the ranges property from being dynamically updated for this second endpoint?

> +
> +				pci-ep-bus@4 {
> +					compatible = "simple-bus";
> +					#address-cells = <1>;
> +					#size-cells = <1>;
> +					/* Map 0x0-0x1fffff to BAR 4 */
> +					ranges = <0x0  0x4 0x0 0x0  0x200000>;
> +				};

[Severity: Low]
Does this second pci-ep-bus@4 node also trigger a compiler warning for
missing a reg property while having a unit address?

>  			};
>  		};
>  	};

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915181003.1633543-1-elder@riscstar.com?part=3

  reply	other threads:[~2026-09-15 18:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 18:09 [PATCH v3 0/3] PCI: introduce TC9564 misc driver Alex Elder
2026-09-15 18:10 ` [PATCH v3 1/3] dt-bindings: misc: introduce pci1179,0220.yaml Alex Elder
2026-09-15 18:16   ` sashiko-bot
2026-09-15 18:10 ` [PATCH v3 2/3] misc: tc9564: introduce base PCI driver Alex Elder
2026-09-15 18:22   ` sashiko-bot
2026-09-15 18:42     ` Alex Elder
2026-09-15 18:10 ` [PATCH v3 3/3] arm64: dts: qcom: qcs6490-rb3gen2: add endpoint buses Alex Elder
2026-09-15 18:25   ` sashiko-bot [this message]
2026-09-15 18:42     ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260915182519.977DF1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@riscstar.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox