RE: [PATCH v7 4/5] iommu/arm-smmu-v3: Standardize ATS enablement failure reporting

From: Tian, Kevin

Date: Wed Jun 03 2026 - 03:46:59 EST


> 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.