]> asedeno.scripts.mit.edu Git - linux.git/commit
habanalabs: Fix virtual address access via debugfs for 2MB pages
authorTomer Tayar <ttayar@habana.ai>
Mon, 3 Jun 2019 11:25:04 +0000 (11:25 +0000)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 3 Jun 2019 11:25:04 +0000 (11:25 +0000)
commite4c814aa7105a6a8320f64ecc48f13bc089eea88
tree4880cc9e08c03141bc3d0eccf8f6c3ed0ee4049b
parentd724170160f800fa8dfd3c0cdebb8b093570b504
habanalabs: Fix virtual address access via debugfs for 2MB pages

The debugfs interface for accessing DRAM virtual addresses currently
uses the 12 LSBs of a virtual address as an offset.
However, it should use the 20 LSBs in case the device MMU page size is
2MB instead of 4KB.
This patch fixes the offset calculation to be based on the page size.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/debugfs.c