• Christoph Hellwig's avatar
    dma-direct: relax addressability checks in dma_direct_supported · 91ef26f9
    Christoph Hellwig authored
    dma_direct_supported tries to find the minimum addressable bitmask
    based on the end pfn and optional magic that architectures can use
    to communicate the size of the magic ZONE_DMA that can be used
    for bounce buffering.  But between the DMA offsets that can change
    per device (or sometimes even region), the fact the ZONE_DMA isn't
    even guaranteed to be the lowest addresses and failure of having
    proper interfaces to the MM code this fails at least for one
    arm subarchitecture.
    
    As all the legacy DMA implementations have supported 32-bit DMA
    masks, and 32-bit masks are guranteed to always work by the API
    contract (using bounce buffers if needed), we can short cut the
    complicated check and always return true without breaking existing
    assumptions.  Hopefully we can properly clean up the interaction
    with the arch defined zones and the bootmem allocator eventually.
    
    Fixes: ad3c7b18 ("arm: use swiotlb for bounce buffering on LPAE configs")
    Reported-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Tested-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    91ef26f9
direct.c 14.1 KB