Commit a12428ac authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Oded Gabbay

accel/habanalabs: check fw version using sw version

The fw inner version is less trustable, instead use the fw general
sw release version.
Signed-off-by: default avatarDafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent dd5667ff
...@@ -3553,9 +3553,15 @@ struct hl_ioctl_desc { ...@@ -3553,9 +3553,15 @@ struct hl_ioctl_desc {
hl_ioctl_t *func; hl_ioctl_t *func;
}; };
static inline bool hl_is_fw_ver_below_1_9(struct hl_device *hdev) static inline bool hl_is_fw_sw_ver_below(struct hl_device *hdev, u32 fw_sw_major, u32 fw_sw_minor)
{ {
return (hdev->fw_inner_major_ver < 42); if (hdev->fw_sw_major_ver < fw_sw_major)
return true;
if (hdev->fw_sw_major_ver > fw_sw_major)
return false;
if (hdev->fw_sw_minor_ver < fw_sw_minor)
return true;
return false;
} }
/* /*
......
...@@ -8043,7 +8043,7 @@ static void gaudi2_ack_module_razwi_event_handler(struct hl_device *hdev, ...@@ -8043,7 +8043,7 @@ static void gaudi2_ack_module_razwi_event_handler(struct hl_device *hdev,
case RAZWI_TPC: case RAZWI_TPC:
hbw_rtr_id = gaudi2_tpc_initiator_hbw_rtr_id[module_idx]; hbw_rtr_id = gaudi2_tpc_initiator_hbw_rtr_id[module_idx];
if (hl_is_fw_ver_below_1_9(hdev) && if (hl_is_fw_sw_ver_below(hdev, 1, 9) &&
!hdev->asic_prop.fw_security_enabled && !hdev->asic_prop.fw_security_enabled &&
((module_idx == 0) || (module_idx == 1))) ((module_idx == 0) || (module_idx == 1)))
lbw_rtr_id = DCORE0_RTR0; lbw_rtr_id = DCORE0_RTR0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment