Re: [PATCH] PCI: qcom: Honor IOMMU provider's #iommu-cells in qcom_pcie_config_sid_1_9_0()
From: Konrad Dybcio
Date: Tue Sep 08 2026 - 03:45:00 EST
On 9/7/26 4:33 PM, Manivannan Sadhasivam wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
>
> qcom_pcie_config_sid_1_9_0() reads the "iommu-map" property as an array
> of fixed four-word {rid-base, phandle, sid, rid-len} entries to program
> the BDF to SID translation table. But that layout only holds for an
> IOMMU with '#iommu-cells = <1>'. The PCIe SMMUs on these SoCs use
> '#iommu-cells = <2>' (SID and mask), so per the pci-iommu binding each
> entry is really five cells long.
[...]
> + /*
> + * Retain backward compatibility with DTs that describe iommu-map
> + * with 4-cell entries against an IOMMU declaring #iommu-cells = 2,
> + * matching the fallback in drivers/of/base.c::of_check_bad_map().
Can we export it from there instead?
Perhaps as a follow-up change given this is a fix to a current
breakage..
I was hoping this whole logic could be simplified a bit by reusing
the map parsing logic from of/property.c, but alas it doesn't seem
feasible given we essentially need more data
Konrad