Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-23 Thread Jason Gunthorpe via iommu
On Wed, Feb 23, 2022 at 12:00:56PM -0600, Bjorn Helgaas wrote: > > static int pci_dma_configure(struct device *dev) > > { > > + struct pci_driver *driver = to_pci_driver(dev->driver); > > struct device *bridge; > > int ret = 0; > > > > + if (!driver->no_kernel_api_dma) { > > Ugh.

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-23 Thread Bjorn Helgaas
In subject, s/dma/DMA/ to match the other patches On Tue, Jan 04, 2022 at 09:56:37AM +0800, Lu Baolu wrote: > Multiple PCI 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

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Lu Baolu
On 2/14/22 9:43 PM, Jason Gunthorpe wrote: On Mon, Feb 14, 2022 at 02:39:18PM +0100, Greg Kroah-Hartman wrote: A driver that sets this flag can still decide to enable the dma API on its own. eg tegra drivers do this. So you are just forcing the driver to manage this all on their own, so how

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Jason Gunthorpe via iommu
On Mon, Feb 14, 2022 at 02:39:18PM +0100, Greg Kroah-Hartman wrote: > > A driver that sets this flag can still decide to enable the dma API on > > its own. eg tegra drivers do this. > > So you are just forcing the driver to manage this all on their own, so > how about, "driver_managed_dma", or

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Greg Kroah-Hartman
On Mon, Feb 14, 2022 at 09:11:17AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 01:51:06PM +0100, Greg Kroah-Hartman wrote: > > On Mon, Feb 14, 2022 at 08:38:42AM -0400, Jason Gunthorpe wrote: > > > On Mon, Feb 14, 2022 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > > > > On Tue, Jan

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Jason Gunthorpe via iommu
On Mon, Feb 14, 2022 at 01:51:06PM +0100, Greg Kroah-Hartman wrote: > On Mon, Feb 14, 2022 at 08:38:42AM -0400, Jason Gunthorpe wrote: > > On Mon, Feb 14, 2022 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > > > On Tue, Jan 04, 2022 at 09:56:37AM +0800, Lu Baolu wrote: > > > > Multiple PCI

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Greg Kroah-Hartman
On Mon, Feb 14, 2022 at 08:38:42AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > > On Tue, Jan 04, 2022 at 09:56:37AM +0800, Lu Baolu wrote: > > > Multiple PCI devices may be placed in the same IOMMU group because > > > they cannot be

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Jason Gunthorpe via iommu
On Mon, Feb 14, 2022 at 11:03:42AM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 04, 2022 at 09:56:37AM +0800, Lu Baolu wrote: > > Multiple PCI 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

Re: [PATCH v5 07/14] PCI: Add driver dma ownership management

2022-02-14 Thread Greg Kroah-Hartman
On Tue, Jan 04, 2022 at 09:56:37AM +0800, Lu Baolu wrote: > Multiple PCI 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

[PATCH v5 07/14] PCI: Add driver dma ownership management

2022-01-03 Thread Lu Baolu
Multiple PCI 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 during