All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 02/22] arm64: dts: qcom: kodiak: Fix the PCIe iommu-map entries
Date: Thu, 30 Jul 2026 12:08:05 +0000	[thread overview]
Message-ID: <20260730120805.DAF6B1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260730-iommu-map-fix-v1-2-83405d37ba41@oss.qualcomm.com>

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

New issues:
- [High] Changing the `iommu-map` entries from 4 cells to 5 cells breaks the manual parsing logic in the QCOM PCIe driver, resulting in corrupted BDF-to-SID hardware configurations.

Pre-existing issues:
- [Medium] The patch corrects an incorrectly formatted 4-cell `iommu-map` property by adding the missing SID mask cell to match the 2-cell `apps_smmu` provider in `kodiak.dtsi`. However, it fails to address the exact same defect present in numerous other Qualcomm SoC device trees and their YAML bindings.
--

--- Patch [2]: [PATCH 02/22] arm64: dts: qcom: kodiak: Fix the PCIe iommu-map entries ---
commit 3a1ab560afad0b97b3e224b3201d2ab8bc8cd668
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

arm64: dts: qcom: kodiak: Fix the PCIe iommu-map entries
    
The IOMMU provider apps_smmu uses '#iommu-cells = <2>', but the PCIe
iommu-map entries specify only one cell for the SID, omitting the SID
mask. This went unnoticed until the OF core started warning with commit
ccb2fd725d41. This patch fixes the entries to match the provider's
'#iommu-cells' property.

> diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> index fa540d8c2615d..2eb613dd67165 100644
> --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> @@ -2278,8 +2278,8 @@ pcie0: pcie@1c00000 {
>  				      "aggre0",
>  				      "aggre1";
>  
> -			iommu-map = <0x0   &apps_smmu 0x1c00 0x1>,
> -				    <0x100 &apps_smmu 0x1c01 0x1>;
> +			iommu-map = <0x0   &apps_smmu 0x1c00 0x0 0x1>,
> +				    <0x100 &apps_smmu 0x1c01 0x0 0x1>;

[Severity: High]
Will changing this to 5 cells break the manual parsing logic in the QCOM
PCIe driver?

Looking at drivers/pci/controller/dwc/pcie-qcom.c,
qcom_pcie_config_sid_1_9_0() manually casts the raw iommu-map property into
a 4-u32 struct array:

struct {
	u32 bdf;
	u32 phandle;
	u32 smmu_sid;
	u32 smmu_sid_len;
} *map;

If the device tree format is updated to 5 cells, will reading this array
cause out-of-sync reads? For the second entry, map[1].bdf would read the
length cell of the first entry (0x1), and map[1].smmu_sid would read the
phandle of the second entry. This could result in corrupted BDF-to-SID
hardware configurations, causing PCIe devices to use invalid SIDs for DMA.

[Severity: Medium]
This is a pre-existing issue, but does this fix need to be applied to other
Qualcomm SoCs as well?

This patch corrects an incorrectly formatted 4-cell iommu-map property by
adding the missing SID mask cell to match the 2-cell apps_smmu provider in
kodiak.dtsi, but fails to address the exact same defect present in numerous
other Qualcomm SoC device trees.

For example, in arch/arm64/boot/dts/qcom/sm8550.dtsi, pcie0 contains:

iommu-map = <0x0   &apps_smmu 0x1400 0x1>,

Other SoCs like sm8650 and sc8180x also seem to omit the SID mask. The OF
core warning will continue to be generated for all other affected Qualcomm
SoCs until they are updated.

(Note that fixing these DTs directly would also break the driver as mentioned
above, so the driver must likely be updated first to handle variable-length
cells or use standard OF core parsing before applying these DT changes).

>  
>  			resets = <&gcc GCC_PCIE_0_BCR>;
>  			reset-names = "pci";

[ ... ]

> @@ -2424,8 +2424,8 @@ pcie1: pcie@1c08000 {
>  
>  			dma-coherent;
>  
> -			iommu-map = <0x0 &apps_smmu 0x1c80 0x1>,
> -				    <0x100 &apps_smmu 0x1c81 0x1>;
> +			iommu-map = <0x0 &apps_smmu 0x1c80 0x0 0x1>,
> +				    <0x100 &apps_smmu 0x1c81 0x0 0x1>;
>  
>  			status = "disabled";
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730-iommu-map-fix-v1-0-83405d37ba41@oss.qualcomm.com?part=2

  reply	other threads:[~2026-07-30 12:08 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 11:55 [PATCH 00/22] arm64: dts: qcom: Fix the PCIe iommu-map entries Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55 ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 01/22] arm64: dts: qcom: kaanapali: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 02/22] arm64: dts: qcom: kodiak: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:08   ` sashiko-bot [this message]
2026-07-30 11:55 ` [PATCH 03/22] arm64: dts: qcom: sar2130p: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 04/22] arm64: dts: qcom: sc8180x: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:11   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 05/22] arm64: dts: qcom: sdm845: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 06/22] arm64: dts: qcom: sm8150: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 07/22] arm64: dts: qcom: sm8250: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:06   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 08/22] arm64: dts: qcom: sm8350: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 09/22] arm64: dts: qcom: sm8450: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:04   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 10/22] arm64: dts: qcom: sm8550: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 13:39   ` Neil Armstrong
2026-07-30 11:55 ` [PATCH 11/22] arm64: dts: qcom: sm8650: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 13:39   ` Neil Armstrong
2026-07-30 11:55 ` [PATCH 12/22] arm64: dts: qcom: sm8750: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 13/22] arm64: dts: qcom: talos: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:07   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 14/22] arm64: dts: qcom: lemans: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 15/22] arm64: dts: qcom: monaco: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:25   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 16/22] arm64: dts: qcom: monaco-monza-som: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:55 ` [PATCH 17/22] arm64: dts: qcom: monaco-evk-ifp-mezzanine: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 12:09   ` sashiko-bot
2026-07-30 11:55 ` [PATCH 18/22] arm64: dts: qcom: lemans-evk-ifp-mezzanine: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:55   ` Manivannan Sadhasivam
2026-07-30 11:56 ` [PATCH 19/22] arm64: dts: qcom: qcs6490-radxa-dragon-q6a: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:56   ` Manivannan Sadhasivam
2026-07-30 11:56 ` [PATCH 20/22] arm64: dts: qcom: qcs6490-thundercomm-minipc-g1iot: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:56   ` Manivannan Sadhasivam
2026-07-30 12:29   ` sashiko-bot
2026-07-30 11:56 ` [PATCH 21/22] arm64: dts: qcom: qcs6490-rb3gen2: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:56   ` Manivannan Sadhasivam
2026-07-30 12:12   ` sashiko-bot
2026-07-30 11:56 ` [PATCH 22/22] arm64: dts: qcom: qcs6490-rb3gen2-industrial-mezzanine: " Manivannan Sadhasivam via B4 Relay
2026-07-30 11:56   ` Manivannan Sadhasivam
2026-07-30 12:23 ` [PATCH 00/22] arm64: dts: qcom: " Dmitry Baryshkov
2026-07-30 16:14   ` Manivannan Sadhasivam
2026-07-30 16:25     ` Dmitry Baryshkov
2026-07-30 12:46 ` Konrad Dybcio

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=20260730120805.DAF6B1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --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 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.