Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-30 Thread Jason Gunthorpe via iommu
On Thu, Dec 23, 2021 at 03:23:54PM +0800, Lu Baolu wrote: > > If this is a bug in the existing kernel, please submit it as a separate > > patch so that it can be properly backported to all affected kernels. > > Never bury it in an unrelated change that will never get sent to older > > kernels. >

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Lu Baolu
On 12/23/21 3:13 PM, Greg Kroah-Hartman wrote: On Thu, Dec 23, 2021 at 11:02:54AM +0800, Lu Baolu wrote: Hi Greg, On 12/22/21 8:47 PM, Greg Kroah-Hartman wrote: + + return ret; +} + +static void device_dma_cleanup(struct device *dev, struct device_driver *drv) +{ + if

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Greg Kroah-Hartman
On Thu, Dec 23, 2021 at 11:02:54AM +0800, Lu Baolu wrote: > Hi Greg, > > On 12/22/21 8:47 PM, Greg Kroah-Hartman wrote: > > > + > > > + return ret; > > > +} > > > + > > > +static void device_dma_cleanup(struct device *dev, struct device_driver > > > *drv) > > > +{ > > > + if

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Lu Baolu
Hi Greg, On 12/22/21 8:47 PM, Greg Kroah-Hartman wrote: + + return ret; +} + +static void device_dma_cleanup(struct device *dev, struct device_driver *drv) +{ + if (!dev->bus->dma_configure) + return; + + if (!drv->suppress_auto_claim_dma_owner) +

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Lu Baolu
Hi Greg, On 12/22/21 8:47 PM, Greg Kroah-Hartman wrote: Which one will actually care about the iommu_device_set_dma_owner() call? All of them? None of them? Some of them? Again, why can't this just happen in the (very few) bus callbacks that care about this? In following patches in this

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Jason Gunthorpe via iommu
On Wed, Dec 22, 2021 at 01:47:34PM +0100, Greg Kroah-Hartman wrote: > Right now we only have 4 different "busses" that care about this. Out > of the following callbacks: > fsl_mc_dma_configure > host1x_dma_configure > pci_dma_configure > platform_dma_configure > > Which

Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-22 Thread Greg Kroah-Hartman
On Fri, Dec 17, 2021 at 02:36:57PM +0800, Lu Baolu wrote: > This extends really_probe() to allow checking for dma ownership conflict > during the driver binding process. By default, the DMA_OWNER_DMA_API is > claimed for the bound driver before calling its .probe() callback. If this > operation

[PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind

2021-12-16 Thread Lu Baolu
This extends really_probe() to allow checking for dma ownership conflict during the driver binding process. By default, the DMA_OWNER_DMA_API is claimed for the bound driver before calling its .probe() callback. If this operation fails (e.g. the iommu group of the target device already has the