RE: [PATCH v7 4/5] iommu/arm-smmu-v3: Standardize ATS enablement failure reporting
From: Tian, Kevin
Date: Wed Jun 03 2026 - 06:20:20 EST
> From: Pranjal Shrivastava <praan@xxxxxxxxxx>
> Sent: Wednesday, June 3, 2026 5:12 PM
>
> On Wed, Jun 03, 2026 at 07:34:14AM +0000, Tian, Kevin wrote:
> > > From: Pranjal Shrivastava <praan@xxxxxxxxxx>
> > > Sent: Monday, June 1, 2026 10:37 PM
> > >
> > > Update arm_smmu_enable_ats() to wrap the pci_enable_ats() call in
> > > WARN_ON(). Since probe-time checks now preclude configuration errors
> > > any failure during hardware enablement is considered a kernel bug.
> > >
> > > Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
> > > ---
> > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 ++++++-
> > > 1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > > b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > > index 54c7f1ae3a84..dfb2b0d2d2a5 100644
> > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > > @@ -2956,7 +2956,12 @@ static void arm_smmu_enable_ats(struct
> > > arm_smmu_master *master)
> > > * ATC invalidation of PASID 0 causes the entire ATC to be flushed.
> > > */
> > > arm_smmu_atc_inv_master(master, IOMMU_NO_PASID);
> > > - if (pci_enable_ats(pdev, stu))
> > > +
> > > + /*
> > > + * Since pci_prepare_ats() has already verified the HW capability
> > > + * and programmed the STE, pci_enable_ats() should not fail here.
> > > + */
> > > + if (WARN_ON(pci_enable_ats(pdev, stu)))
> > > dev_err(master->dev, "Failed to enable ATS (STU %zu)\n",
> > > stu);
> > > }
> > >
> >
> > looks smmu driver doesn't check return value of pci_prepare_ats() too.
>
> It does check the reval of pci_prepare_ats() now with the a recent
> patch [1] (merged in Joerg's tree) that adds a new
> "arm_smmu_master_prepare_ats" helper function.
>
> Thanks,
> Praan
>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git/commit/?h
> =core&id=5ff98a0da6b48d8722eac0080e4185c417925d05
Okay. Then:
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>