mirror of https://gitee.com/openkylin/linux.git
dma/swiotlb: Remove swiotlb_{alloc,free}_coherent()
Unused now that everyone uses swiotlb_{alloc,free}(). 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-15-hch@lst.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
c10f07aa27
commit
16e73adbca
|
@ -72,14 +72,6 @@ void *swiotlb_alloc(struct device *hwdev, size_t size, dma_addr_t *dma_handle,
|
||||||
void swiotlb_free(struct device *dev, size_t size, void *vaddr,
|
void swiotlb_free(struct device *dev, size_t size, void *vaddr,
|
||||||
dma_addr_t dma_addr, unsigned long attrs);
|
dma_addr_t dma_addr, unsigned long attrs);
|
||||||
|
|
||||||
extern void
|
|
||||||
*swiotlb_alloc_coherent(struct device *hwdev, size_t size,
|
|
||||||
dma_addr_t *dma_handle, gfp_t flags);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
swiotlb_free_coherent(struct device *hwdev, size_t size,
|
|
||||||
void *vaddr, dma_addr_t dma_handle);
|
|
||||||
|
|
||||||
extern dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
|
extern dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
|
||||||
unsigned long offset, size_t size,
|
unsigned long offset, size_t size,
|
||||||
enum dma_data_direction dir,
|
enum dma_data_direction dir,
|
||||||
|
|
|
@ -157,13 +157,6 @@ unsigned long swiotlb_size_or_default(void)
|
||||||
return size ? size : (IO_TLB_DEFAULT_SIZE);
|
return size ? size : (IO_TLB_DEFAULT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note that this doesn't work with highmem page */
|
|
||||||
static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
|
|
||||||
volatile void *address)
|
|
||||||
{
|
|
||||||
return phys_to_dma(hwdev, virt_to_phys(address));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool no_iotlb_memory;
|
static bool no_iotlb_memory;
|
||||||
|
|
||||||
void swiotlb_print_info(void)
|
void swiotlb_print_info(void)
|
||||||
|
@ -752,28 +745,6 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
|
||||||
swiotlb_alloc_coherent(struct device *hwdev, size_t size,
|
|
||||||
dma_addr_t *dma_handle, gfp_t flags)
|
|
||||||
{
|
|
||||||
int order = get_order(size);
|
|
||||||
unsigned long attrs = (flags & __GFP_NOWARN) ? DMA_ATTR_NO_WARN : 0;
|
|
||||||
void *ret;
|
|
||||||
|
|
||||||
ret = (void *)__get_free_pages(flags, order);
|
|
||||||
if (ret) {
|
|
||||||
*dma_handle = swiotlb_virt_to_bus(hwdev, ret);
|
|
||||||
if (dma_coherent_ok(hwdev, *dma_handle, size)) {
|
|
||||||
memset(ret, 0, size);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
free_pages((unsigned long)ret, order);
|
|
||||||
}
|
|
||||||
|
|
||||||
return swiotlb_alloc_buffer(hwdev, size, dma_handle, attrs);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(swiotlb_alloc_coherent);
|
|
||||||
|
|
||||||
static bool swiotlb_free_buffer(struct device *dev, size_t size,
|
static bool swiotlb_free_buffer(struct device *dev, size_t size,
|
||||||
dma_addr_t dma_addr)
|
dma_addr_t dma_addr)
|
||||||
{
|
{
|
||||||
|
@ -793,15 +764,6 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
|
|
||||||
dma_addr_t dev_addr)
|
|
||||||
{
|
|
||||||
if (!swiotlb_free_buffer(hwdev, size, dev_addr))
|
|
||||||
free_pages((unsigned long)vaddr, get_order(size));
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(swiotlb_free_coherent);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
|
swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
|
||||||
int do_panic)
|
int do_panic)
|
||||||
|
|
Loading…
Reference in New Issue