mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
arm: dma-mapping: DMA buf may not have cpu virtual addr
DMA buffers may not have cpu virtual addresses when allocated using DMA_ATTR_NO_KERNEL_MAPPING attribute. Page address should therefore be looked up while searching for such dma bufs. Also fix the printk format specifier to '%pK' to print kernel pointers. Change-Id: I5754cde63ace19aed88624a36186d012309d475b Signed-off-by: Shiraz Hashim <shashim@codeaurora.org> Signed-off-by: Charan Teja Reddy <charante@codeaurora.org> Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org> Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
This commit is contained in:
parent
bb7d10aa8e
commit
b7b349c452
1 changed files with 3 additions and 2 deletions
|
|
@ -858,9 +858,10 @@ static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
|||
.page = page,
|
||||
.want_vaddr = ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) == 0),
|
||||
};
|
||||
void *addr = (args.want_vaddr) ? cpu_addr : page;
|
||||
|
||||
buf = arm_dma_buffer_find(cpu_addr);
|
||||
if (WARN(!buf, "Freeing invalid buffer %p\n", cpu_addr))
|
||||
buf = arm_dma_buffer_find(addr);
|
||||
if (WARN(!buf, "Freeing invalid buffer %pK\n", addr))
|
||||
return;
|
||||
|
||||
buf->allocator->free(&args);
|
||||
|
|
|
|||
Loading…
Reference in a new issue