RE: [PATCH rc v2] iommu: Fix nested pci_dev_reset_iommu_prepare/done()
From: Tian, Kevin
Date: Wed Apr 01 2026 - 04:26:52 EST
> From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> Sent: Tuesday, March 31, 2026 8:23 PM
>
> On Tue, Mar 31, 2026 at 07:12:19AM +0000, Tian, Kevin wrote:
> > > > > > - prepare() only detaches the specific pdev, leaving other
> > > > > > devices in the group still attached to the original domain
> > > >
> > > > no, attach is per-group. all devices are changed together.
> > >
> > > I think prepare() should use the per-device ops:
> > > ops->attach_dev (via __iommu_attach_device)
> > > ops->set_dev_pasid
> > > right?
> >
> > it's per-device op but the condition of calling it is per-group:
> >
> > if (group->domain != group->blocking_domain) {
> > ret = __iommu_attach_device(group->blocking_domain, &pdev-
> >dev,
> > group->domain);
> > if (ret)
> > return ret;
> > }
>
> If the group->domain is not blocking_domain, this device will
> move away from group->domain to blocking_domain, while other
> device (in the same group) are staying in group->domain. No?
yeah, obviously I was wrong here. will review v4.