aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/device.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-03-19 11:38:16 +0100
committerIngo Molnar <mingo@kernel.org>2018-03-20 10:01:57 +0100
commit6e4bf586778315b3fc53b728c53eefc247cfc3ff (patch)
tree79e9df0ee0eaa2b3b8bcd75836c7a0f4dd4ba9bc /arch/x86/include/asm/device.h
parentx86/dma: Use DMA-direct (CONFIG_DMA_DIRECT_OPS=y) (diff)
downloadlinux-dev-6e4bf586778315b3fc53b728c53eefc247cfc3ff.tar.xz
linux-dev-6e4bf586778315b3fc53b728c53eefc247cfc3ff.zip
x86/dma: Use generic swiotlb_ops
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: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Thomas 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.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/device.h')
-rw-r--r--arch/x86/include/asm/device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/device.h b/arch/x86/include/asm/device.h
index 5e12c63b47aa..a8f6c809d9b1 100644
--- a/arch/x86/include/asm/device.h
+++ b/arch/x86/include/asm/device.h
@@ -6,6 +6,9 @@ struct dev_archdata {
#if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_AMD_IOMMU)
void *iommu; /* hook for IOMMU specific extension */
#endif
+#ifdef CONFIG_STA2X11
+ bool is_sta2x11;
+#endif
};
#if defined(CONFIG_X86_DEV_DMA_OPS) && defined(CONFIG_PCI_DOMAINS)