diff options
| author | Laura Abbott <lauraa@codeaurora.org> | 2014-08-05 19:16:28 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:03:15 -0700 |
| commit | 623c8d195310846a7f9cee1b0a54fecf85c1a2d7 (patch) | |
| tree | 0a6dde200ff870ee4ac18bf69691fd852a05aae3 /drivers/base | |
| parent | 416cca9db2a961221ce0d8848fad2ab2ddeb6c30 (diff) | |
dma-mapping: Add dma_remap functions
After getting an allocation from dma_alloc_coherent, there
may be cases where it is neccessary to remap the handle
into the CPU's address space (e.g. no CPU side mapping was
requested at allocation time but now one is needed). Add
APIs to bring a handle into the CPU address space again.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[imaund@codeaurora.org: resolved context conflicts and added support
for remap 'no_warn' argument]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/dma-mapping.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index d95c5971c225..422f81ee692f 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -326,12 +326,14 @@ void *dma_common_contiguous_remap(struct page *page, size_t size, /* * unmaps a range previously mapped by dma_common_*_remap */ -void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags) +void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags, + bool no_warn) { struct vm_struct *area = find_vm_area(cpu_addr); if (!area || (area->flags & vm_flags) != vm_flags) { - WARN(1, "trying to free invalid coherent area: %p\n", cpu_addr); + WARN(!no_warn, "trying to free invalid coherent area: %p\n", + cpu_addr); return; } |
