habanalabs: handle F/W failure for sensor initialization
authorOded Gabbay <oded.gabbay@gmail.com>
Mon, 16 Sep 2019 06:16:29 +0000 (09:16 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 21 Nov 2019 09:35:44 +0000 (11:35 +0200)
In case the F/W fails to initialize the thermal sensors, print an
appropriate error message to kernel log and fail the device
initialization.

Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/include/hl_boot_if.h

index 6fba14b..09caef7 100644 (file)
@@ -2328,6 +2328,11 @@ static int goya_init_cpu(struct hl_device *hdev, u32 cpu_timeout)
                                "ARM status %d - u-boot stopped by user\n",
                                status);
                        break;
+               case CPU_BOOT_STATUS_TS_INIT_FAIL:
+                       dev_err(hdev->dev,
+                               "ARM status %d - Thermal Sensor initialization failed\n",
+                               status);
+                       break;
                default:
                        dev_err(hdev->dev,
                                "ARM status %d - Invalid status code\n",
index 4cd04c0..2853a2d 100644 (file)
@@ -20,6 +20,8 @@ enum cpu_boot_status {
        CPU_BOOT_STATUS_DRAM_INIT_FAIL,
        CPU_BOOT_STATUS_FIT_CORRUPTED,
        CPU_BOOT_STATUS_UBOOT_NOT_READY,
+       CPU_BOOT_STATUS_RESERVED,
+       CPU_BOOT_STATUS_TS_INIT_FAIL,
 };
 
 enum kmd_msg {