summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2020-10-29 19:38:31 +0300
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 11:47:33 +0300
commit28e052c95292410922d487c48d2f841ccd6495e7 (patch)
tree4daa31b0d652d6954e4661f098186316b9d03be1
parent66a76401c50b2638fd95dd31f365fd64be307d6a (diff)
downloadlinux-28e052c95292410922d487c48d2f841ccd6495e7.tar.xz
habanalabs: restore vm_pgoff after mmap
Due to using dma_mmap_coherent() to perform mmap of dma memory, we had to clear the vm_pgoff field before calling that function. However, that broke the userspace (profiler tool) as they relied on searching the /proc/self/maps for these values to correctly "disassemble" the topology recipe. To re-enable that functionality, the driver can simply restore the value of vm_pgoff before returning to userspace but after calling dma_mmap_coherent(). Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
-rw-r--r--drivers/misc/habanalabs/common/command_buffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/command_buffer.c b/drivers/misc/habanalabs/common/command_buffer.c
index 03ffcead1855..0c482358f350 100644
--- a/drivers/misc/habanalabs/common/command_buffer.c
+++ b/drivers/misc/habanalabs/common/command_buffer.c
@@ -517,6 +517,7 @@ int hl_cb_mmap(struct hl_fpriv *hpriv, struct vm_area_struct *vma)
}
cb->mmap_size = cb->size;
+ vma->vm_pgoff = handle;
return 0;