Re: [PATCH v3 03/13] iommu/arm-smmu-v3: Drain in-flight fault events on domain detach
From: Nicolin Chen
Date: Tue Sep 08 2026 - 18:16:14 EST
On Tue, Sep 08, 2026 at 01:36:43PM -0300, Jason Gunthorpe wrote:
> On Fri, Sep 04, 2026 at 03:57:14PM -0700, Nicolin Chen wrote:
> > On Fri, Sep 04, 2026 at 11:09:06AM -0300, Jason Gunthorpe wrote:
> > > On Thu, Sep 03, 2026 at 12:18:33PM -0700, Jonathan Cameron wrote:
> > > > > Also run the drain for every stall-capable master, even when the departing
> > > > > attachment did not enable IOPF: such a stall event has to be aborted while
> > > > > it still resolves to the old attach handle,
> > >
> > > That isn't the model for fault handling. The fault is delivered
> > > unpredictably into either old or new domain. It doesn't matter which
> > > one.
> > >
> > > Domains have to conclude their fault proceessing before they are
> > > destroyed, and attach to the a non-fault domain has to conclude faults
> > > before completing the attach.
> > >
> > > But there is no requirement to deliver faults to any particular thing.
> >
> > Edited:
> >
> > Also run the drain for every stall-capable master, even when the departing
> > attachment did not enable IOPF. An attachment has to conclude its in-flight
> > faults before the attach completes, as the incoming domain might not handle
> > a fault at all.
>
> I still don't understand from this why an non-fault capable domain
> would need to flush on becoming replaced?
Actually, I missed the part that the iopf core already resolves
this via an IOMMU_PAGE_RESP_INVALID.
So, drain should happen when:
- if (master->stall_enabled) {
+ if (master_domain->using_iopf && master->stall_enabled) {
arm_smmu_wait_for_queue_drained()
And I will drop that paragraph in the commit message.
Thanks!
Nicolin