Re: [PATCH RFCv1 3/3] iommu/arm-smmu-v3: Allow ATS to be always on

Nicolin Chen
2026-01-26T18:22:10Z

On Mon, Jan 26, 2026 at 12:39:50PM +0000, Will Deacon wrote:
> On Fri, Jan 16, 2026 at 08:56:42PM -0800, Nicolin Chen wrote:
> > @@ -1422,7 +1422,7 @@ void arm_smmu_clear_cd(struct arm_smmu_master *master, ioasid_t ssid)
> > if (!arm_smmu_cdtab_allocated(&master->cd_table))
> > return;
> > cdptr = arm_smmu_get_cd_ptr(master, ssid);
> > - if (WARN_ON(!cdptr))
> > + if (!cdptr)
> > return;
>
> Should we still warn if !master->ats_always_on?

Hmm, yes. I'll fix this.

> > @@ -3205,7 +3222,7 @@ static void arm_smmu_attach_dev_ste(struct iommu_domain *domain,
> > struct iommu_domain *old_domain,
> > struct device *dev,
> > struct arm_smmu_ste *ste,
> > - unsigned int s1dss)
> > + unsigned int s1dss, bool ats_always_on)
> > {
> > struct arm_smmu_master *master = dev_iommu_priv_get(dev);
>
> Can we avoid the 'bool' parameter if possible, please? They tend to make the
> callsites pretty horrible to read and you're already passing the 'struct
> device *' so you should have the master in hand?

Trying to set ats_always_on=false for blocked domain here:

@@ -3260,7 +3277,8 @@ static int arm_smmu_attach_dev_identity(struct iommu_domain *domain,
arm_smmu_attach_dev_ste(domain, old_domain, dev, &ste,
STRTAB_STE_1_S1DSS_BYPASS,
master->ats_always_on);
@@ -3283,7 +3301,7 @@ static int arm_smmu_attach_dev_blocked(struct iommu_domain *domain,
arm_smmu_attach_dev_ste(domain, old_domain, dev, &ste,
STRTAB_STE_1_S1DSS_TERMINATE, false);

But I think we could do that by combining master->ats_always_on
with the s1dss. I will drop the "bool".

Thanks
Nicolin