]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix calculation of DRAM base address in PCIe BAR
authorTomer Tayar <ttayar@habana.ai>
Mon, 15 Aug 2022 17:13:30 +0000 (20:13 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 18 Sep 2022 10:29:52 +0000 (13:29 +0300)
commitb9fab45b3fb457a2129197607b11008627c0e45f
tree4dc5c0ed7877aa094649e7f5c77749bfcc8ed527
parent4c730fa92d838c14be068d860db55cc84a69b9b8
habanalabs: fix calculation of DRAM base address in PCIe BAR

The calculation of the device DRAM base address before setting the
relevant PCIe BAR to point at it, has an assumption that this BAR is
used to access only the DRAM, and thus the covered DRAM size is a power
of 2.
In future ASICs it is not necessarily true, so need to update the
calculation to support also a non-power-of-2 size.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c