Hi Joerg, Thanks for the reply. I will spin another version of the patch addressing your comments.
> -----Original Message----- > From: Joerg Roedel <j...@8bytes.org> > Sent: Wednesday, July 22, 2020 6:53 AM > To: Prakhya, Sai Praneeth <sai.praneeth.prak...@intel.com> > Cc: Raj, Ashok <ashok....@intel.com>; Will Deacon <will.dea...@arm.com>; > iommu@lists.linux-foundation.org; Robin Murphy <robin.mur...@arm.com>; > Christoph Hellwig <h...@lst.de> > Subject: Re: [PATCH V4 1/3] iommu: Add support to change default domain of > an iommu group > > On Tue, Jul 14, 2020 at 06:23:54PM +0000, Prakhya, Sai Praneeth wrote: > > Q1: > > > Presently, iommu_change_dev_def_domain() checks if the iommu group > > > still has only one device or not. Hence, checking if iommu group has > > > one device or not is done twice, once before taking device_lock() > > > and the other, after taking device_lock(). > > > > > > I agree that the code isn't checking if the iommu group still has > > > the _same_ device or not. > > > One way, I could think of doing it is by storing "dev" temporarily > > > and checking for it. > > > Do you think that's ok? Or would you rather suggest something else? > > That sounds reasonable, get the device from the group, lock it, take > group->mutex, and check whether the same device is still alone in the > group. Sounds good! I will implement this. Regards, Sai _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu