• Christoph Hellwig's avatar
    x86/dma: Use generic swiotlb_ops · 6e4bf586
    Christoph Hellwig authored
    The generic swiotlb DMA ops were based on the x86 ones and provide
    equivalent functionality, so use them.
    
    Also fix the sta2x11 case.  For that SOC the DMA map ops need an
    additional physical to DMA address translations.  For swiotlb buffers
    that is done throught the phys_to_dma helper, but the sta2x11_dma_ops
    also added an additional translation on the return value from
    x86_swiotlb_alloc_coherent, which is only correct if that functions
    returns a direct allocation and not a swiotlb buffer.  With the
    generic swiotlb and DMA-direct code phys_to_dma is not always used
    and the separate sta2x11_dma_ops can be replaced with a simple
    bit that marks if the additional physical to DMA address translation
    is needed.
    Tested-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: David Woodhouse <dwmw2@infradead.org>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: Jon Mason <jdmason@kudzu.us>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Muli Ben-Yehuda <mulix@mulix.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: iommu@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/20180319103826.12853-5-hch@lst.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    6e4bf586
pci-swiotlb.c 1.81 KB