Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-19 Thread Alexey Kardashevskiy
On 19/04/2020 22:25, Joerg Roedel wrote: > On Sun, Apr 19, 2020 at 10:00:58AM +0200, Christoph Hellwig wrote: >> The difference is that NULL ops mean imply the direct mapping is always >> used, dma_ops_bypass means a direct mapping is used if no bounce buffering >> using swiotlb is needed,

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-19 Thread Joerg Roedel
On Sun, Apr 19, 2020 at 10:00:58AM +0200, Christoph Hellwig wrote: > The difference is that NULL ops mean imply the direct mapping is always > used, dma_ops_bypass means a direct mapping is used if no bounce buffering > using swiotlb is needed, which should also answer your first question. > The

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-19 Thread Christoph Hellwig
On Sat, Apr 18, 2020 at 02:42:05PM +0200, Joerg Roedel wrote: > Hi Christoph, > > On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote: > > +static inline bool dma_map_direct(struct device *dev, > > + const struct dma_map_ops *ops) > > +{ > > + if (likely(!ops)) > > +

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-18 Thread Joerg Roedel
Hi Christoph, On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote: > +static inline bool dma_map_direct(struct device *dev, > + const struct dma_map_ops *ops) > +{ > + if (likely(!ops)) > + return true; > + if (!dev->dma_ops_bypass) > +

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-14 Thread Greg Kroah-Hartman
On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote: > Several IOMMU drivers have a bypass mode where they can use a direct > mapping if the devices DMA mask is large enough. Add generic support > to the core dma-mapping code to do that to switch those drivers to > a common

[PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-14 Thread Christoph Hellwig
Several IOMMU drivers have a bypass mode where they can use a direct mapping if the devices DMA mask is large enough. Add generic support to the core dma-mapping code to do that to switch those drivers to a common solution. Signed-off-by: Christoph Hellwig --- include/linux/device.h | 6