]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
habanalabs: check to load F/W before boot status
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 8 May 2019 09:22:41 +0000 (12:22 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Wed, 8 May 2019 09:22:41 +0000 (12:22 +0300)
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.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/goya/goya.c

index aaa88d442ffed73184dff25fa15048a6fd07a4a7..ccf9d925b6ed645d3b7049475473272f24c10535 100644 (file)
@@ -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;