All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, robh@kernel.org,
	conor+dt@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org,
	olteanv@gmail.com
Subject: Re: [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes
Date: Sun, 22 Nov 2026 03:17:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-227667@kernel.org> (raw)
In-Reply-To: <20261122-nord_ep-v1-11-6d8839ffa9aa@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] arm64: dts: qcom: nord: overlapping atu and msix reg regions in
  pcie0_ep
- [High] arm64: dts: qcom: nord: non-power-of-2 msix BAR size in
  pcie0_ep
- [High] arm64: dts: qcom: nord: missing msix reg region in
  pcie1_ep..pcie3_ep
- [Medium] arm64: dts: qcom: nord: missing num-lanes = <8> property in
  pcie0_ep
- [Medium] arm64: dts: qcom: nord: 1 MB addr_space reg size in
  pcie1_ep..pcie3_ep
- [Low] arm64: dts: qcom: nord: missing gpio.h include in
  nord-embedded.dtsi
--

commit 2599e7213b15292427fa12c65b538dbb750cb433
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

arm64: dts: qcom: nord: Add PCIe endpoint nodes

This commit adds the pcie0_ep..pcie3_ep endpoint controller nodes and
their pin control states for the four PCIe instances on Nord.

> diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> index e6d0bd21744e2..829fc63681c1d 100644
> --- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> +++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> @@ -1638,6 +1638,287 @@ pcie_phy: phy@1b00000 {
>  		status = "disabled";
>  	};
>  
> +	pcie0_ep: pcie-ep@1b80000 {
> +		compatible = "qcom,nord-pcie-ep";
> +
> +		reg = <0x00 0x01b80000 0x00 0x00004000>,
> +		      <0x00 0x40000000 0x00 0x00000f20>,
> +		      <0x00 0x40000f20 0x00 0x000000a8>,
> +		      <0x00 0x40010000 0x00 0x00020000>,

[Severity: High]
Should the atu region size in pcie0_ep be 0x00010000 (like
pcie1_ep..pcie3_ep) instead of 0x00020000?

With a size of 0x00020000, the atu region spans 0x40010000..0x4002ffff and
overlaps the msix region at 0x40020000..0x400213ff.
dw_pcie_get_resources() claims the full range in iomem_resource via
devm_ioremap_resource() and sets pci->atu_size = 0x20000, which causes
dw_pcie_iatu_detect() to probe unrolled iATU indices 128..255 at
0x40020000..0x4002ffff and write test patterns (0x11110000) into the MSI-X
BAR memory space.

> +		      <0x00 0x40100000 0x00 0x0ff00000>,
> +		      <0x00 0x01b84000 0x00 0x00001000>,
> +		      <0x00 0x40030000 0x00 0x00010000>,
> +		      <0x00 0x40020000 0x00 0x00001400>;
> +		reg-names = "parf",
> +			    "dbi",
> +			    "elbi",
> +			    "atu",
> +			    "addr_space",
> +			    "mmio",
> +			    "dma",
> +			    "msix";

[Severity: High]
Does the 0x00001400 msix region size cause pci_epc_set_bar() to fail with
-EINVAL?

pci_epf_mhi_bind() records resource_size(res) of the "msix" resource as
epf_mhi->msix_size, and pci_epf_mhi_epc_init() passes that directly as
msix_bar->size to pci_epc_set_bar(), which requires a power-of-2 BAR size:

drivers/pci/endpoint/pci-epc-core.c:pci_epc_set_bar() {
    ...
	if (!is_power_of_2(epf_bar->size))
		return -EINVAL;
    ...
}

[ ... ]

> +		phys = <&pcie_phy 0>;
> +		phy-names = "pciephy";
> +
> +		reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
> +		wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;

[Severity: Low]
These nodes introduce the first uses of GPIO_ACTIVE_LOW in
nord-embedded.dtsi, but neither nord-embedded.dtsi nor nord.dtsi includes
<dt-bindings/gpio/gpio.h>.  Should nord-embedded.dtsi include
<dt-bindings/gpio/gpio.h> directly so it does not depend on inclusion order
in board .dts files?

> +
> +		pinctrl-0 = <&pcie0_ep_default>;
> +		pinctrl-names = "default";
> +
> +		linux,pci-domain = <0>;
> +
> +		status = "disabled";
> +	};

[Severity: Medium]
Is pcie0_ep missing num-lanes = <8>?

On Nord, pcie0 in nord.dtsi is the 8-lane port of the quadfurcated PHY and
specifies num-lanes = <8>, while pcie1_ep..pcie3_ep below specify
num-lanes = <4>, <2>, and <2>.  Without num-lanes on pcie0_ep,
dw_pcie_get_resources() leaves pci->num_lanes as 0 and
dw_pcie_link_set_max_link_width() skips programming PORT_LINK_CTRL,
LINK_WIDTH_SPEED_CTRL, and PCI_EXP_LNKCAP_MLW.

> +
> +	pcie1_ep: pcie-ep@1b88000 {
> +		compatible = "qcom,nord-pcie-ep";
> +
> +		reg = <0x00 0x01b88000 0x00 0x00004000>,
> +		      <0x00 0x50000000 0x00 0x00000f20>,
> +		      <0x00 0x50000f20 0x00 0x000000a8>,
> +		      <0x00 0x50010000 0x00 0x00010000>,
> +		      <0x00 0x50100000 0x00 0x00100000>,

[Severity: Medium]
Should the addr_space size in pcie1_ep, pcie2_ep, and pcie3_ep be
0x0ff00000 (255 MB, matching pcie0_ep and the full outbound slave window in
nord.dtsi) instead of 0x00100000 (1 MB)?

dw_pcie_ep_init() passes the addr_space size to pci_epc_mem_init() as the
total outbound address pool, so a 1 MB size limits outbound iATU mappings on
pcie1_ep..pcie3_ep to 1020 KB after reserving ep->msi_mem.

> +		      <0x00 0x01b8c000 0x00 0x00001000>,
> +		      <0x00 0x50030000 0x00 0x00010000>;
> +		reg-names = "parf",
> +			    "dbi",
> +			    "elbi",
> +			    "atu",
> +			    "addr_space",
> +			    "mmio",
> +			    "dma";

[Severity: High]
Does omitting the "msix" reg entry on pcie1_ep, pcie2_ep, and pcie3_ep
cause pci_epf_mhi_epc_init() to fail with -EINVAL on those instances?

In drivers/pci/controller/dwc/pcie-qcom-ep.c, "qcom,nord-pcie-ep" maps to
cfg_nord with .msix_capable = true, and qcom_pcie_epc_get_features()
unconditionally reports msix_capable = true without checking whether an
"msix" resource exists.  When pci_epf_mhi is bound to pcie1_ep..pcie3_ep,
epf_mhi->msix_phys is 0 and pci_epf_mhi_epc_init() fails on PERST#
deassertion:

drivers/pci/endpoint/functions/pci-epf-mhi.c:pci_epf_mhi_epc_init() {
    ...
	if (epf_mhi->epc_features->msix_capable) {
		if (!epf_mhi->msix_phys) {
			dev_err(dev, "MSI-X BAR address not configured in DT\n");
			return -EINVAL;
		}
    ...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=11

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, robh@kernel.org,
	conor+dt@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org,
	olteanv@gmail.com
Subject: Re: [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes
Date: Sun, 22 Nov 2026 03:17:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-227667@kernel.org> (raw)
In-Reply-To: <20261122-nord_ep-v1-11-6d8839ffa9aa@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] arm64: dts: qcom: nord: overlapping atu and msix reg regions in
  pcie0_ep
- [High] arm64: dts: qcom: nord: non-power-of-2 msix BAR size in
  pcie0_ep
- [High] arm64: dts: qcom: nord: missing msix reg region in
  pcie1_ep..pcie3_ep
- [Medium] arm64: dts: qcom: nord: missing num-lanes = <8> property in
  pcie0_ep
- [Medium] arm64: dts: qcom: nord: 1 MB addr_space reg size in
  pcie1_ep..pcie3_ep
- [Low] arm64: dts: qcom: nord: missing gpio.h include in
  nord-embedded.dtsi
--

commit 2599e7213b15292427fa12c65b538dbb750cb433
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

arm64: dts: qcom: nord: Add PCIe endpoint nodes

This commit adds the pcie0_ep..pcie3_ep endpoint controller nodes and
their pin control states for the four PCIe instances on Nord.

> diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> index e6d0bd21744e2..829fc63681c1d 100644
> --- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> +++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> @@ -1638,6 +1638,287 @@ pcie_phy: phy@1b00000 {
>  		status = "disabled";
>  	};
>  
> +	pcie0_ep: pcie-ep@1b80000 {
> +		compatible = "qcom,nord-pcie-ep";
> +
> +		reg = <0x00 0x01b80000 0x00 0x00004000>,
> +		      <0x00 0x40000000 0x00 0x00000f20>,
> +		      <0x00 0x40000f20 0x00 0x000000a8>,
> +		      <0x00 0x40010000 0x00 0x00020000>,

[Severity: High]
Should the atu region size in pcie0_ep be 0x00010000 (like
pcie1_ep..pcie3_ep) instead of 0x00020000?

With a size of 0x00020000, the atu region spans 0x40010000..0x4002ffff and
overlaps the msix region at 0x40020000..0x400213ff.
dw_pcie_get_resources() claims the full range in iomem_resource via
devm_ioremap_resource() and sets pci->atu_size = 0x20000, which causes
dw_pcie_iatu_detect() to probe unrolled iATU indices 128..255 at
0x40020000..0x4002ffff and write test patterns (0x11110000) into the MSI-X
BAR memory space.

> +		      <0x00 0x40100000 0x00 0x0ff00000>,
> +		      <0x00 0x01b84000 0x00 0x00001000>,
> +		      <0x00 0x40030000 0x00 0x00010000>,
> +		      <0x00 0x40020000 0x00 0x00001400>;
> +		reg-names = "parf",
> +			    "dbi",
> +			    "elbi",
> +			    "atu",
> +			    "addr_space",
> +			    "mmio",
> +			    "dma",
> +			    "msix";

[Severity: High]
Does the 0x00001400 msix region size cause pci_epc_set_bar() to fail with
-EINVAL?

pci_epf_mhi_bind() records resource_size(res) of the "msix" resource as
epf_mhi->msix_size, and pci_epf_mhi_epc_init() passes that directly as
msix_bar->size to pci_epc_set_bar(), which requires a power-of-2 BAR size:

drivers/pci/endpoint/pci-epc-core.c:pci_epc_set_bar() {
    ...
	if (!is_power_of_2(epf_bar->size))
		return -EINVAL;
    ...
}

[ ... ]

> +		phys = <&pcie_phy 0>;
> +		phy-names = "pciephy";
> +
> +		reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
> +		wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;

[Severity: Low]
These nodes introduce the first uses of GPIO_ACTIVE_LOW in
nord-embedded.dtsi, but neither nord-embedded.dtsi nor nord.dtsi includes
<dt-bindings/gpio/gpio.h>.  Should nord-embedded.dtsi include
<dt-bindings/gpio/gpio.h> directly so it does not depend on inclusion order
in board .dts files?

> +
> +		pinctrl-0 = <&pcie0_ep_default>;
> +		pinctrl-names = "default";
> +
> +		linux,pci-domain = <0>;
> +
> +		status = "disabled";
> +	};

[Severity: Medium]
Is pcie0_ep missing num-lanes = <8>?

On Nord, pcie0 in nord.dtsi is the 8-lane port of the quadfurcated PHY and
specifies num-lanes = <8>, while pcie1_ep..pcie3_ep below specify
num-lanes = <4>, <2>, and <2>.  Without num-lanes on pcie0_ep,
dw_pcie_get_resources() leaves pci->num_lanes as 0 and
dw_pcie_link_set_max_link_width() skips programming PORT_LINK_CTRL,
LINK_WIDTH_SPEED_CTRL, and PCI_EXP_LNKCAP_MLW.

> +
> +	pcie1_ep: pcie-ep@1b88000 {
> +		compatible = "qcom,nord-pcie-ep";
> +
> +		reg = <0x00 0x01b88000 0x00 0x00004000>,
> +		      <0x00 0x50000000 0x00 0x00000f20>,
> +		      <0x00 0x50000f20 0x00 0x000000a8>,
> +		      <0x00 0x50010000 0x00 0x00010000>,
> +		      <0x00 0x50100000 0x00 0x00100000>,

[Severity: Medium]
Should the addr_space size in pcie1_ep, pcie2_ep, and pcie3_ep be
0x0ff00000 (255 MB, matching pcie0_ep and the full outbound slave window in
nord.dtsi) instead of 0x00100000 (1 MB)?

dw_pcie_ep_init() passes the addr_space size to pci_epc_mem_init() as the
total outbound address pool, so a 1 MB size limits outbound iATU mappings on
pcie1_ep..pcie3_ep to 1020 KB after reserving ep->msi_mem.

> +		      <0x00 0x01b8c000 0x00 0x00001000>,
> +		      <0x00 0x50030000 0x00 0x00010000>;
> +		reg-names = "parf",
> +			    "dbi",
> +			    "elbi",
> +			    "atu",
> +			    "addr_space",
> +			    "mmio",
> +			    "dma";

[Severity: High]
Does omitting the "msix" reg entry on pcie1_ep, pcie2_ep, and pcie3_ep
cause pci_epf_mhi_epc_init() to fail with -EINVAL on those instances?

In drivers/pci/controller/dwc/pcie-qcom-ep.c, "qcom,nord-pcie-ep" maps to
cfg_nord with .msix_capable = true, and qcom_pcie_epc_get_features()
unconditionally reports msix_capable = true without checking whether an
"msix" resource exists.  When pci_epf_mhi is bound to pcie1_ep..pcie3_ep,
epf_mhi->msix_phys is 0 and pci_epf_mhi_epc_init() fails on PERST#
deassertion:

drivers/pci/endpoint/functions/pci-epf-mhi.c:pci_epf_mhi_epc_init() {
    ...
	if (epf_mhi->epc_features->msix_capable) {
		if (!epf_mhi->msix_phys) {
			dev_err(dev, "MSI-X BAR address not configured in DT\n");
			return -EINVAL;
		}
    ...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=11

  reply	other threads:[~2026-11-22  3:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22  2:56 ` Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:03   ` sashiko-bot
2026-11-22  3:03     ` sashiko-bot
2026-11-23 10:03   ` Niklas Cassel
2026-11-23 10:03     ` Niklas Cassel
2026-11-22  2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:08   ` sashiko-bot
2026-11-22  3:08     ` sashiko-bot
2026-11-23 16:41   ` Frank Li
2026-11-23 16:41     ` Frank Li
2026-11-22  2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:15   ` sashiko-bot
2026-11-22  3:15     ` sashiko-bot
2026-11-23 16:48   ` Frank Li
2026-11-23 16:48     ` Frank Li
2026-11-22  2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-23 16:49   ` Frank Li
2026-11-23 16:49     ` Frank Li
2026-11-22  2:56 ` [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-23 16:56   ` Frank Li
2026-11-23 16:56     ` Frank Li
2026-11-22  2:56 ` [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-23 16:57   ` Frank Li
2026-11-23 16:57     ` Frank Li
2026-11-22  2:56 ` [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:08   ` sashiko-bot
2026-11-22  3:08     ` sashiko-bot
2026-11-23 17:12   ` Frank Li
2026-11-23 17:12     ` Frank Li
2026-11-22  2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:19   ` sashiko-bot
2026-11-22  3:19     ` sashiko-bot
2026-11-23 17:19   ` Frank Li
2026-11-23 17:19     ` Frank Li
2026-11-22  2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
2026-11-22  2:56   ` Krishna Chaitanya Chundru
2026-11-22  3:17   ` sashiko-bot [this message]
2026-11-22  3:17     ` sashiko-bot
2026-11-22  3:19 ` [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support sashiko-bot

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=sashiko-outbox-227667@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

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

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