habanalabs: fix debugfs address translation
authorfarah kassabri <fkassabri@habana.ai>
Sun, 28 Feb 2021 09:06:14 +0000 (11:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:16:09 +0000 (09:16 +0100)
commit15097e9338ed3de2f5c5904d3dc776ef1b650edc
treeb066cf89150040287d3c8330c4ef97cf8f8b76f2
parentffd123fe839700366ea79b19ac3683bf56817372
habanalabs: fix debugfs address translation

when user uses virtual addresses to access dram through debugfs,
driver translate this address to physical and use it
for the access through the pcie bar.
in case dram page size is different than the dmmu
page size, we need to have special treatment
for adding the page offset to the actual address, which
is to use the dram page size mask to fetch the page offset
from the virtual address, instead of the dmmu last hop shift.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/mmu/mmu.c