]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit84d6842516ba7e95030c46ba7798aa512f663ebd
treeb066cf89150040287d3c8330c4ef97cf8f8b76f2
parentb4430fe223c00d09c794fbbc3571f0ea2b260455
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