Re: [PATCH] iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids

From: Nicolin Chen
Date: Tue Apr 15 2025 - 14:53:49 EST


On Tue, Apr 15, 2025 at 10:24:01AM -0300, Jason Gunthorpe wrote:
> On Sat, Apr 12, 2025 at 11:06:58AM -0700, Nicolin Chen wrote:
> > ASPEED VGA card has two built-in devices:
> > 0008:06:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 06)
> > 0008:07:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 52)
> >
> > Since SMMU driver had been already expecting a potential duplicated Stream
> > ID in arm_smmu_install_ste_for_dev(), change the arm_smmu_insert_master()
> > routine to ignore a duplicated ID from the fwspec->sids array as well.
> >
> > Note: this has been failing the iommu_device_probe() since 2021, although a
> > recent iommu commit in v6.15-rc1 that moves iommu_device_probe() started to
> > fail the SMMU driver probe. Since nobody has cared about DMA Alias support,
> > leave that as it was but fix the fundamental iommu_device_probe() breakage.
> >
> > Fixes: cdf315f907d4 ("iommu/arm-smmu-v3: Maintain a SID->device structure")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> > Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > ---
> > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 +++++++++++++++----
> > 1 file changed, 15 insertions(+), 4 deletions(-)
>
> Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
>
> This should go to rc as it has become urgent with the probe
> reorder. Use [PATCH rc] to idicate this..

OK. Let me respin it for that highlight.

Thanks
Nicolin