From: Oded Gabbay Date: Thu, 29 Oct 2020 16:38:31 +0000 (+0200) Subject: habanalabs: restore vm_pgoff after mmap X-Git-Tag: accepted/tizen/unified/20230118.172025~8316^2~60^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28e052c95292410922d487c48d2f841ccd6495e7;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/drivers/misc/habanalabs/common/command_buffer.c b/drivers/misc/habanalabs/common/command_buffer.c index 03ffcea..0c48235 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;