Commit 3cdc48b6 authored by Oded Gabbay's avatar Oded Gabbay Committed by Zheng Zengkai
Browse files

habanalabs: fix dma_addr passed to dma_mmap_coherent



stable inclusion
from stable-5.10.14
commit 2f2a4c04b8893de70f9d6ccc3fe9e2ccad9eb209
bugzilla: 48051

--------------------------------

[ Upstream commit a9d4ef64 ]

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: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 09a6059c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment