habanalabs: report correct dram size in info ioctl
authorOfir Bitton <obitton@habana.ai>
Thu, 31 Dec 2020 10:00:55 +0000 (12:00 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 27 Jan 2021 19:03:49 +0000 (21:03 +0200)
commit6769cea8de590920c95603c4f3ce063e38033423
tree7a97ce662c2b296836021b61df7aa9ede4461c3b
parentb19dc67aa8c008661b10b1c2372a29f403bf5dac
habanalabs: report correct dram size in info ioctl

In case MMU is enabled, we must take MMU page size into
consideration when reporting dram size to the user.
This is because the MMU page size can be a value which is NOT
a power-of-2 value. As a result, the total DRAM size (which is always
a power-of-2 value) needed to be rounded-down.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/habanalabs_ioctl.c