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

From: Christoph Hellwig
Date: Mon Mar 23 2020 - 04:51:07 EST


On Mon, Mar 23, 2020 at 09:37:05AM +0100, Christoph Hellwig wrote:
> > > + /*
> > > + * Allows IOMMU drivers to bypass dynamic translations if the DMA mask
> > > + * is large enough.
> > > + */
> > > + if (dev->dma_ops_bypass) {
> > > + if (min_not_zero(dev->coherent_dma_mask, dev->bus_dma_limit) >=
> > > + dma_direct_get_required_mask(dev))
> > > + return true;
> > > + }
> >
> >
> > Why not do this in dma_map_direct() as well?
>
> Mostly beacuse it is a relatively expensive operation, including a
> fls64.

Which I guess isn't too bad compared to a dynamic IOMMU mapping. Can
you just send a draft patch for what you'd like to see for ppc?