]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
habanalabs: report dram_page_size in hw_ip_info ioctl
authorMoti Haimovski <mhaimovski@habana.ai>
Mon, 7 Dec 2020 07:10:34 +0000 (09:10 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 27 Jan 2021 19:03:49 +0000 (21:03 +0200)
Instead of having it hard-coded as a define, pass it to the user
in runtime.

Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/habanalabs_ioctl.c
include/uapi/misc/habanalabs.h

index d25892d61ec9ddc2ceda987b39d45d0ec6ec75d9..394a2e1767ce4361c37c83c778d382d5297d95eb 100644 (file)
@@ -63,6 +63,7 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args)
        hw_ip.dram_size = prop->dram_size - dram_kmd_size;
        if (hw_ip.dram_size > PAGE_SIZE)
                hw_ip.dram_enabled = 1;
+       hw_ip.dram_page_size = prop->dram_page_size;
        hw_ip.num_of_events = prop->num_of_events;
 
        memcpy(hw_ip.cpucp_version, prop->cpucp_info.cpucp_version,
index b9afe1cdac2419c7d024606fa0351c5f446626d1..b431a70e1b8bc2c2d1ee1917f982e230894ca233 100644 (file)
@@ -320,6 +320,8 @@ struct hl_info_hw_ip_info {
        __u8 pad[2];
        __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN];
        __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
+       __u64 reserved2;
+       __u64 dram_page_size;
 };
 
 struct hl_info_dram_usage {