Skip to content

Commit c517068

Browse files
Tomer Tayarogabbay
authored andcommitted
accel/habanalabs: keep explicit size of reserved memory for FW
The reserved memory for FW is currently saved in an ASIC property in units of MB, just like the value that comes from FW. Except the fact that it is not clear from the property's name, it means also that a calculation to actual size is required everywhere that it is used. Modify the property to hold the size in bytes. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
1 parent db45bbd commit c517068

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/accel/habanalabs/common/firmware_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,7 @@ static int hl_fw_dynamic_init_cpu(struct hl_device *hdev,
27242724

27252725
if (hdev->asic_prop.support_dynamic_resereved_fw_size)
27262726
hdev->asic_prop.reserved_fw_mem_size =
2727-
le32_to_cpu(fw_loader->dynamic_loader.comm_desc.rsvd_mem_size_mb);
2727+
le32_to_cpu(fw_loader->dynamic_loader.comm_desc.rsvd_mem_size_mb) * SZ_1M;
27282728

27292729
if (!(hdev->fw_components & FW_TYPE_BOOT_CPU)) {
27302730
struct lkd_fw_binning_info *binning_info;

drivers/accel/habanalabs/common/habanalabs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ struct hl_hints_range {
650650
* @glbl_err_max_cause_num: global err max cause number.
651651
* @hbw_flush_reg: register to read to generate HBW flush. value of 0 means HBW flush is
652652
* not supported.
653-
* @reserved_fw_mem_size: size in MB of dram memory reserved for FW.
653+
* @reserved_fw_mem_size: size of dram memory reserved for FW.
654654
* @collective_first_sob: first sync object available for collective use
655655
* @collective_first_mon: first monitor available for collective use
656656
* @sync_stream_first_sob: first sync object available for sync stream use

0 commit comments

Comments
 (0)