]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix dma_addr passed to dma_mmap_coherent
authorOded Gabbay <ogabbay@kernel.org>
Mon, 11 Jan 2021 11:49:38 +0000 (13:49 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jan 2021 12:59:36 +0000 (14:59 +0200)
commit0aa1d5bafc3318d64553d3b5b05d8c692a88c41c
tree604002ce3acd1a60a91244a50010718fac626d2a
parentb54764c3953457cc9f16b673aa7dd201020f5ff6
habanalabs: fix dma_addr passed to dma_mmap_coherent

When doing dma_alloc_coherent in the driver, we add a certain hard-coded
offset to the DMA address before returning to the callee function. This
offset is needed when our device use this DMA address to perform
outbound transactions to the host.

However, if we want to map the DMA'able memory to the user via
dma_mmap_coherent(), we need to pass the original dma address, without
this offset. Otherwise, we will get erronouos mapping.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c