lkml.org 
[lkml]   [2020]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device
On Mon, Mar 23, 2020 at 12:14:08PM +0000, Robin Murphy wrote:
> On 2020-03-20 2:16 pm, 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 solution.
>
> Hmm, this is _almost_, but not quite the same as the case where drivers are
> managing their own IOMMU mappings, but still need to use streaming DMA for
> cache maintenance on the underlying pages.

In that case they should simply not call the DMA API at all. We'll just
need versions of the cache maintainance APIs that tie in with the raw
IOMMU API.

> For that we need the ops bypass
> to be a "true" bypass and also avoid SWIOTLB regardless of the device's DMA
> mask. That behaviour should in fact be fine for the opportunistic bypass
> case here as well, since the mask being "big enough" implies by definition
> that this should never need to bounce either.

In practice it does. But that means adding yet another code path
vs the simple direct call to dma_direct_* vs calling the DMA ops
which I'd rather avoid.

\
 
 \ /
  Last update: 2020-03-23 13:56    [W:0.122 / U:7.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site