Re: [PATCH v5 04/14] driver core: platform: Add driver dma ownership management

2022-02-14 Thread Jason Gunthorpe via iommu
On Mon, Feb 14, 2022 at 02:37:15PM +0100, Greg Kroah-Hartman wrote: > On Mon, Feb 14, 2022 at 09:18:53AM -0400, Jason Gunthorpe wrote: > > On Mon, Feb 14, 2022 at 10:59:50AM +0100, Greg Kroah-Hartman wrote: > > > > > > + if (ret && !drv->no_kernel_api_dma) > > > > + iommu_devic

Re: [PATCH v5 04/14] driver core: platform: Add driver dma ownership management

2022-02-14 Thread Greg Kroah-Hartman
On Mon, Feb 14, 2022 at 09:18:53AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 10:59:50AM +0100, Greg Kroah-Hartman wrote: > > > > + if (ret && !drv->no_kernel_api_dma) > > > + iommu_device_unuse_dma_api(dev); > > > > So you are now going to call this for every platform driver

Re: [PATCH v5 04/14] driver core: platform: Add driver dma ownership management

2022-02-14 Thread Jason Gunthorpe via iommu
On Mon, Feb 14, 2022 at 10:59:50AM +0100, Greg Kroah-Hartman wrote: > > + if (ret && !drv->no_kernel_api_dma) > > + iommu_device_unuse_dma_api(dev); > > So you are now going to call this for every platform driver _unless_ > they set this flag? Yes, it is necessary because VFIO suppor

Re: [PATCH v5 04/14] driver core: platform: Add driver dma ownership management

2022-02-14 Thread Greg Kroah-Hartman
On Tue, Jan 04, 2022 at 09:56:34AM +0800, Lu Baolu wrote: > Multiple platform devices may be placed in the same IOMMU group because > they cannot be isolated from each other. These devices must either be > entirely under kernel control or userspace control, never a mixture. This > checks and sets D

[PATCH v5 04/14] driver core: platform: Add driver dma ownership management

2022-01-03 Thread Lu Baolu
Multiple platform devices may be placed in the same IOMMU group because they cannot be isolated from each other. These devices must either be entirely under kernel control or userspace control, never a mixture. This checks and sets DMA ownership during driver binding, and release the ownership duri