diff options
author | Tomer Tayar <ttayar@habana.ai> | 2022-09-01 14:12:56 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-09-19 15:08:38 +0300 |
commit | a0fc8688c003172455f99b6b7e185b167ed964a0 (patch) | |
tree | dfb64be8f9653abbb2d0e075e6d1a309f790e707 /drivers/misc/habanalabs | |
parent | aee3fd74fe579b6de5d8661dac559df91ab36b12 (diff) | |
download | linux-stable-a0fc8688c003172455f99b6b7e185b167ed964a0.tar.gz linux-stable-a0fc8688c003172455f99b6b7e185b167ed964a0.tar.bz2 linux-stable-a0fc8688c003172455f99b6b7e185b167ed964a0.zip |
habanalabs/gaudi2: read F/W security indication after hard reset
F/W security status might change after every reset.
Add the reading of the preboot status to the hard reset sequence, which
among others reads this security indication.
As this preboot status reading includes the waiting for the preboot to
be ready, it can be removed from the CPU init which is done in a later
stage.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 7 | ||||
-rw-r--r-- | drivers/misc/habanalabs/common/firmware_if.c | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 5f6407ed3b04..cc392d062f0d 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1563,6 +1563,13 @@ kill_processes: */ hdev->disabled = false; + /* F/W security enabled indication might be updated after hard-reset */ + if (hard_reset) { + rc = hl_fw_read_preboot_status(hdev); + if (rc) + goto out_err; + } + rc = hdev->asic_funcs->hw_init(hdev); if (rc) { dev_err(hdev->dev, "failed to initialize the H/W after reset\n"); diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c index cd2eb7e73be5..8bfb459a8282 100644 --- a/drivers/misc/habanalabs/common/firmware_if.c +++ b/drivers/misc/habanalabs/common/firmware_if.c @@ -2509,13 +2509,6 @@ static int hl_fw_dynamic_init_cpu(struct hl_device *hdev, */ dyn_regs = &fw_loader->dynamic_loader.comm_desc.cpu_dyn_regs; - /* if no preboot loaded indication- wait for preboot */ - if (!(hdev->fw_loader.fw_comp_loaded & FW_TYPE_PREBOOT_CPU)) { - rc = hl_fw_wait_preboot_ready(hdev); - if (rc) - return -EIO; - } - rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_RST_STATE, 0, true, fw_loader->cpu_timeout); |