Skip to contentSkip to conversation

habanalabs: check to load F/W before boot status

PATCH New Oded Gabbay 1 participant 1 message May 8, 2019 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: check to load F/W before boot status

This patch changes the order of checks when initializing the device CPU. We want first to check if we need to load the F/W, and only if we need to, then we want to check the status of the CPU boot program.

---
 drivers/misc/habanalabs/goya/goya.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/misc/habanalabs/goya/goya.c +3 -3
index aaa88d442ffe..ccf9d925b6ed 100644
@@ -2277,14 +2277,14 @@ static int goya_init_cpu(struct hl_device *hdev, u32 cpu_timeout)
 	goya_read_device_fw_version(hdev, FW_COMP_UBOOT);
 	goya_read_device_fw_version(hdev, FW_COMP_PREBOOT);
 
-	if (status == CPU_BOOT_STATUS_SRAM_AVAIL)
-		goto out;
-
 	if (!hdev->fw_loading) {
 		dev_info(hdev->dev, "Skip loading FW\n");
 		goto out;
 	}
 
+	if (status == CPU_BOOT_STATUS_SRAM_AVAIL)
+		goto out;
+
 	rc = goya_push_linux_to_device(hdev);
 	if (rc)
 		return rc;
Signature · 1 line
2.17.1