habanalabs: read F/W versions before failure
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 20 Oct 2019 08:07:11 +0000 (11:07 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 21 Nov 2019 09:35:45 +0000 (11:35 +0200)
Move the read of the F/W boot versions before exiting on possible failures
of the F/W boot. This will help debug boot failures as we will be able to
know the F/W boot version.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
drivers/misc/habanalabs/goya/goya.c

index d3ee9e2aa57ef05a2977032610ef7ecf427e5c06..4e767e1d78e46bb167bfafd67b54c66162bb09c9 100644 (file)
@@ -2296,6 +2296,10 @@ static int goya_init_cpu(struct hl_device *hdev, u32 cpu_timeout)
                10000,
                cpu_timeout);
 
+       /* Read U-Boot version now in case we will later fail */
+       goya_read_device_fw_version(hdev, FW_COMP_UBOOT);
+       goya_read_device_fw_version(hdev, FW_COMP_PREBOOT);
+
        if (rc) {
                dev_err(hdev->dev, "Error in ARM u-boot!");
                switch (status) {
@@ -2347,10 +2351,6 @@ static int goya_init_cpu(struct hl_device *hdev, u32 cpu_timeout)
                return -EIO;
        }
 
-       /* Read U-Boot version now in case we will later fail */
-       goya_read_device_fw_version(hdev, FW_COMP_UBOOT);
-       goya_read_device_fw_version(hdev, FW_COMP_PREBOOT);
-
        if (!hdev->fw_loading) {
                dev_info(hdev->dev, "Skip loading FW\n");
                goto out;