diff options
author | Christoph Hellwig <hch@lst.de> | 2018-03-19 06:38:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-20 05:01:56 -0400 |
commit | 038d07a283d62336b32cc23b62aecdf9418cfc11 (patch) | |
tree | f47625ddf15e599aca16e56262b37968bd3a1779 /drivers/xen/swiotlb-xen.c | |
parent | 3eb93ea3272d428aab3c03e2dd272a78a7729ba8 (diff) |
x86/dma: Remove dma_alloc_coherent_mask()
These days all devices (including the ISA fallback device) have a coherent
DMA mask set, so remove the workaround.
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Jon Mason <jdmason@kudzu.us>
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-3-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/xen/swiotlb-xen.c')
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 5bb72d3f8337..e1c60899fdbc 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -53,20 +53,6 @@ | |||
53 | * API. | 53 | * API. |
54 | */ | 54 | */ |
55 | 55 | ||
56 | #ifndef CONFIG_X86 | ||
57 | static unsigned long dma_alloc_coherent_mask(struct device *dev, | ||
58 | gfp_t gfp) | ||
59 | { | ||
60 | unsigned long dma_mask = 0; | ||
61 | |||
62 | dma_mask = dev->coherent_dma_mask; | ||
63 | if (!dma_mask) | ||
64 | dma_mask = (gfp & GFP_DMA) ? DMA_BIT_MASK(24) : DMA_BIT_MASK(32); | ||
65 | |||
66 | return dma_mask; | ||
67 | } | ||
68 | #endif | ||
69 | |||
70 | #define XEN_SWIOTLB_ERROR_CODE (~(dma_addr_t)0x0) | 56 | #define XEN_SWIOTLB_ERROR_CODE (~(dma_addr_t)0x0) |
71 | 57 | ||
72 | static char *xen_io_tlb_start, *xen_io_tlb_end; | 58 | static char *xen_io_tlb_start, *xen_io_tlb_end; |
@@ -328,7 +314,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
328 | return ret; | 314 | return ret; |
329 | 315 | ||
330 | if (hwdev && hwdev->coherent_dma_mask) | 316 | if (hwdev && hwdev->coherent_dma_mask) |
331 | dma_mask = dma_alloc_coherent_mask(hwdev, flags); | 317 | dma_mask = hwdev->coherent_dma_mask; |
332 | 318 | ||
333 | /* At this point dma_handle is the physical address, next we are | 319 | /* At this point dma_handle is the physical address, next we are |
334 | * going to set it to the machine address. | 320 | * going to set it to the machine address. |