Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-15 Thread Lu Baolu
Hi Greg, On 2021/12/13 8:50, Lu Baolu wrote: On 12/10/21 9:23 AM, Lu Baolu wrote: Hi Greg, Jason and Christoph, On 12/9/21 9:20 AM, Lu Baolu wrote: On 12/7/21 9:16 PM, Jason Gunthorpe wrote: On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote: On 12/6/21 11:06 PM, Jason Gunthorpe

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-14 Thread Christoph Hellwig
This approach looks much better to me. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-13 Thread Jason Gunthorpe via iommu
On Mon, Dec 13, 2021 at 08:50:05AM +0800, Lu Baolu wrote: > > Does this work for you? Can I work towards this in the next version? > > A kindly ping ... Is this heading the right direction? I need your > advice to move ahead. :-) I prefer this to all the duplicated code in the v3 series.. Given

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-12 Thread Lu Baolu
On 12/10/21 9:23 AM, Lu Baolu wrote: Hi Greg, Jason and Christoph, On 12/9/21 9:20 AM, Lu Baolu wrote: On 12/7/21 9:16 PM, Jason Gunthorpe wrote: On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote: On 12/6/21 11:06 PM, Jason Gunthorpe wrote: On Mon, Dec 06, 2021 at 06:36:27AM -0800,

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-09 Thread Lu Baolu
Hi Greg, Jason and Christoph, On 12/9/21 9:20 AM, Lu Baolu wrote: On 12/7/21 9:16 PM, Jason Gunthorpe wrote: On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote: On 12/6/21 11:06 PM, Jason Gunthorpe wrote: On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote: I really hate

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-08 Thread Lu Baolu
On 12/7/21 9:16 PM, Jason Gunthorpe wrote: On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote: On 12/6/21 11:06 PM, Jason Gunthorpe wrote: On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote: I really hate the amount of boilerplate code that having this in each bus type

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-07 Thread Jason Gunthorpe via iommu
On Tue, Dec 07, 2021 at 05:25:04AM -0800, Christoph Hellwig wrote: > On Tue, Dec 07, 2021 at 09:16:27AM -0400, Jason Gunthorpe wrote: > > Yes, the suggestion was to put everything that 'if' inside a function > > and then of course a matching undo function. > > Can't we simplify things even more?

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-07 Thread Christoph Hellwig
On Tue, Dec 07, 2021 at 09:16:27AM -0400, Jason Gunthorpe wrote: > Yes, the suggestion was to put everything that 'if' inside a function > and then of course a matching undo function. Can't we simplify things even more? Do away with the DMA API owner entirely, and instead in

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-07 Thread Jason Gunthorpe via iommu
On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote: > On 12/6/21 11:06 PM, Jason Gunthorpe wrote: > > On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote: > > > I really hate the amount of boilerplate code that having this in each > > > bus type causes. > > +1 > > > > I liked

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-06 Thread Lu Baolu
On 12/6/21 11:06 PM, Jason Gunthorpe wrote: On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote: I really hate the amount of boilerplate code that having this in each bus type causes. +1 I liked the first version of this series better with the code near really_probe(). Can we

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-06 Thread Jason Gunthorpe via iommu
On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote: > I really hate the amount of boilerplate code that having this in each > bus type causes. +1 I liked the first version of this series better with the code near really_probe(). Can we go back to that with some

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-06 Thread Christoph Hellwig
I really hate the amount of boilerplate code that having this in each bus type causes. Between that and the suggestion from Joerg I wonder if we could do the following again: - add new no_kernel_dma flag to struct device_driver - set this flag for the various vfio drivers - skip claiming the

Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management

2021-12-05 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 09:58:49AM +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