Re: [PATCH v4 02/17] iommu: Add device-centric DMA ownership interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 14, 2022 at 02:33:41PM +0100, Eric Auger wrote:
> > +/**
> > + * iommu_device_release_dma_owner() - Release DMA ownership of a device
> > + * @group: The device.
> @dev: the device
> > + *
> > + * Release the DMA ownership claimed by iommu_device_claim_dma_owner().
> > + */
> > +void iommu_device_release_dma_owner(struct device *dev)
> > +{
> > +	struct iommu_group *group = iommu_group_get(dev);
> > +
> > +	mutex_lock(&group->mutex);
> > +	if (group->owner_cnt > 1) {
> > +		group->owner_cnt--;
> > +		goto unlock_out;
> > +	}
> > +	__iommu_release_dma_ownership(group);
> > +unlock_out:
> > +	mutex_unlock(&group->mutex);
> 
> if (group->owner_cnt > 1)
> 
> 	group->owner_cnt--;
> else
> 	__iommu_release_dma_ownership(group);
> 
> mutex_unlock(&group->mutex);
> 
> iommu_group_put(group);

Sure, thanks

Jason



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux