From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Alon Mizrahi <amizrahi@habana.ai>
Subject: [PATCH 7/8] habanalabs: return dram virtual address in info ioctl
Date: Tue, 29 Dec 2020 23:36:52 +0200 [thread overview]
Message-ID: <20201229213653.29749-7-ogabbay@kernel.org> (raw)
In-Reply-To: <20201229213653.29749-1-ogabbay@kernel.org>
From: Alon Mizrahi <amizrahi@habana.ai>
When working with DRAM MMU, we should supply the userspace with the
virtual start address of the DRAM instead of the physical one. This
is because the physical one has no meaning for the user as he only
knows the virtual address range.
Signed-off-by: Alon Mizrahi <amizrahi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
drivers/misc/habanalabs/common/habanalabs_ioctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/common/habanalabs_ioctl.c b/drivers/misc/habanalabs/common/habanalabs_ioctl.c
index ed325de04e35..64a82c966836 100644
--- a/drivers/misc/habanalabs/common/habanalabs_ioctl.c
+++ b/drivers/misc/habanalabs/common/habanalabs_ioctl.c
@@ -57,7 +57,9 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args)
hw_ip.device_id = hdev->asic_funcs->get_pci_id(hdev);
hw_ip.sram_base_address = prop->sram_user_base_address;
- hw_ip.dram_base_address = prop->dram_user_base_address;
+ hw_ip.dram_base_address =
+ hdev->mmu_enable && prop->dram_supports_virtual_memory ?
+ prop->dmmu.start_addr : prop->dram_user_base_address;
hw_ip.tpc_enabled_mask = prop->tpc_enabled_mask;
hw_ip.sram_size = prop->sram_size - sram_kmd_size;
hw_ip.dram_size = prop->dram_size - dram_kmd_size;
--
2.25.1
next prev parent reply other threads:[~2020-12-29 21:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 21:36 [PATCH 1/8] habanalabs: replace WARN/WARN_ON with dev_crit in driver Oded Gabbay
2020-12-29 21:36 ` [PATCH 2/8] habanalabs: kernel doc format in memory functions Oded Gabbay
2020-12-29 21:36 ` [PATCH 3/8] habanalabs: modify memory functions signatures Oded Gabbay
2020-12-29 21:36 ` [PATCH 4/8] habanalabs/gaudi: add debug prints for security status Oded Gabbay
2020-12-29 21:36 ` [PATCH 5/8] habanalabs: add ASIC property of functional HBMs Oded Gabbay
2020-12-29 21:36 ` [PATCH 6/8] habanalabs: update to latest hl_boot_if.h Oded Gabbay
2020-12-29 21:36 ` Oded Gabbay [this message]
2020-12-29 21:36 ` [PATCH 8/8] habanalabs/gaudi: set uninitialized symbol Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201229213653.29749-7-ogabbay@kernel.org \
--to=ogabbay@kernel.org \
--cc=amizrahi@habana.ai \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.