diff options
author | Dafna Hirschfeld <dhirschfeld@habana.ai> | 2023-04-18 11:39:44 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2023-06-05 15:31:33 +0300 |
commit | a12428acf823a1a367d38a4113b7365e3e5603bf (patch) | |
tree | c909eda03e32f461cc4b4074af6c40658c803f73 /drivers/accel | |
parent | dd5667ff6f9c52c6a49aa9725b80542793613036 (diff) | |
download | linux-a12428acf823a1a367d38a4113b7365e3e5603bf.tar.gz linux-a12428acf823a1a367d38a4113b7365e3e5603bf.tar.bz2 linux-a12428acf823a1a367d38a4113b7365e3e5603bf.zip |
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: Dafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r-- | drivers/accel/habanalabs/common/habanalabs.h | 10 | ||||
-rw-r--r-- | drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index d6f454b1cde4..02620654ccdf 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -3553,9 +3553,15 @@ struct hl_ioctl_desc { 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; } /* diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index acc304ebca82..6e3aa89b19c2 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -8043,7 +8043,7 @@ static void gaudi2_ack_module_razwi_event_handler(struct hl_device *hdev, case RAZWI_TPC: 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 && ((module_idx == 0) || (module_idx == 1))) lbw_rtr_id = DCORE0_RTR0; |