Re: [PATCH rc v6] iommu: Fix nested pci_dev_reset_iommu_prepare/done()
From: Nicolin Chen
Date: Tue Apr 21 2026 - 13:49:33 EST
On Tue, Apr 21, 2026 at 07:01:22AM +0000, Tian, Kevin wrote:
> > From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > Sent: Saturday, April 18, 2026 12:57 PM
> >
> > On Fri, Apr 17, 2026 at 02:44:41PM -0700, Nicolin Chen wrote:
> > > @@ -2469,9 +2469,2 @@ static int
> > __iommu_group_set_domain_internal(struct iommu_group *group,
> > >
> > > - /*
> > > - * This is a concurrent attach during device recovery. Reject it until
> > > - * pci_dev_reset_iommu_done() attaches the device to group->domain.
> > > - */
> > > - if (group->recovery_cnt)
> > > - return -EBUSY;
> > > -
> >
> > On a second thought, we may not simply drop this -- IIRC, we added
> > it particularly to fence a case where gdevs share the same RID or
> > some corner case like that?
> >
>
> this is by design according to the original commit:
>
> "
> Note that there are two corner cases:
> 1. Devices in the same iommu_group
> Since an attachment is always per iommu_group, this means that any
> sibling devices in the iommu_group cannot change domain, to prevent
> race conditions.
> ...
> "
Well, we changed the implementation a few times, and it isn't in
the merged v8 cover-letter..
Nicolin