Skip to content

Commit 7e63f31

Browse files
KobyElbazogabbay
authored andcommitted
accel/habanalabs: update state when loading boot fit
Any FW component we load must be followed by a corresponding state update. However, it seems that so far we skipped doing so for the bootfit case, so fix that. Signed-off-by: Koby Elbaz <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
1 parent 6092ced commit 7e63f31

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

drivers/accel/habanalabs/common/firmware_if.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,16 +2486,6 @@ static int hl_fw_dynamic_load_image(struct hl_device *hdev,
24862486
if (rc)
24872487
goto release_fw;
24882488

2489-
/* update state according to boot stage */
2490-
if (cur_fwc == FW_COMP_BOOT_FIT) {
2491-
struct cpu_dyn_regs *dyn_regs;
2492-
2493-
dyn_regs = &fw_loader->dynamic_loader.comm_desc.cpu_dyn_regs;
2494-
hl_fw_boot_fit_update_state(hdev,
2495-
le32_to_cpu(dyn_regs->cpu_boot_dev_sts0),
2496-
le32_to_cpu(dyn_regs->cpu_boot_dev_sts1));
2497-
}
2498-
24992489
/* copy boot fit to space allocated by FW */
25002490
rc = hl_fw_dynamic_copy_image(hdev, fw, fw_loader);
25012491
if (rc)
@@ -2798,6 +2788,14 @@ static int hl_fw_dynamic_init_cpu(struct hl_device *hdev,
27982788
goto protocol_err;
27992789
}
28002790

2791+
rc = hl_fw_dynamic_wait_for_boot_fit_active(hdev, fw_loader);
2792+
if (rc)
2793+
goto protocol_err;
2794+
2795+
hl_fw_boot_fit_update_state(hdev,
2796+
le32_to_cpu(dyn_regs->cpu_boot_dev_sts0),
2797+
le32_to_cpu(dyn_regs->cpu_boot_dev_sts1));
2798+
28012799
/*
28022800
* when testing FW load (without Linux) on PLDM we don't want to
28032801
* wait until boot fit is active as it may take several hours.
@@ -2807,10 +2805,6 @@ static int hl_fw_dynamic_init_cpu(struct hl_device *hdev,
28072805
if (hdev->pldm && !(hdev->fw_components & FW_TYPE_LINUX))
28082806
return 0;
28092807

2810-
rc = hl_fw_dynamic_wait_for_boot_fit_active(hdev, fw_loader);
2811-
if (rc)
2812-
goto protocol_err;
2813-
28142808
/* Enable DRAM scrambling before Linux boot and after successful
28152809
* UBoot
28162810
*/
@@ -2844,7 +2838,8 @@ static int hl_fw_dynamic_init_cpu(struct hl_device *hdev,
28442838
if (rc)
28452839
goto protocol_err;
28462840

2847-
hl_fw_linux_update_state(hdev, le32_to_cpu(dyn_regs->cpu_boot_dev_sts0),
2841+
hl_fw_linux_update_state(hdev,
2842+
le32_to_cpu(dyn_regs->cpu_boot_dev_sts0),
28482843
le32_to_cpu(dyn_regs->cpu_boot_dev_sts1));
28492844

28502845
hl_fw_dynamic_update_linux_interrupt_if(hdev);

0 commit comments

Comments
 (0)