accel/habanalabs: in hl_device_reset remove 'hard_instead_of_soft'
authorDafna Hirschfeld <dhirschfeld@habana.ai>
Wed, 8 Feb 2023 13:17:43 +0000 (15:17 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 15 Mar 2023 11:29:13 +0000 (13:29 +0200)
Because this field is only used for debug print,
we can do more precise debug directly instead.

Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
drivers/accel/habanalabs/common/device.c

index 0e405e4..47ed2fe 100644 (file)
@@ -1474,9 +1474,8 @@ static void handle_reset_trigger(struct hl_device *hdev, u32 flags)
  */
 int hl_device_reset(struct hl_device *hdev, u32 flags)
 {
-       bool hard_reset, from_hard_reset_thread, fw_reset, hard_instead_soft = false,
-                       reset_upon_device_release, schedule_hard_reset = false,
-                       delay_reset, from_dev_release, from_watchdog_thread;
+       bool hard_reset, from_hard_reset_thread, fw_reset, reset_upon_device_release,
+               schedule_hard_reset = false, delay_reset, from_dev_release, from_watchdog_thread;
        u64 idle_mask[HL_BUSY_ENGINES_MASK_EXT_SIZE] = {0};
        struct hl_ctx *ctx;
        int i, rc;
@@ -1500,7 +1499,7 @@ int hl_device_reset(struct hl_device *hdev, u32 flags)
        }
 
        if (!hard_reset && !hdev->asic_prop.supports_compute_reset) {
-               hard_instead_soft = true;
+               dev_dbg(hdev->dev, "asic doesn't support compute reset - do hard-reset instead\n");
                hard_reset = true;
        }
 
@@ -1515,13 +1514,11 @@ int hl_device_reset(struct hl_device *hdev, u32 flags)
        }
 
        if (!hard_reset && !hdev->asic_prop.allow_inference_soft_reset) {
-               hard_instead_soft = true;
+               dev_dbg(hdev->dev,
+                       "asic doesn't allow inference soft reset - do hard-reset instead\n");
                hard_reset = true;
        }
 
-       if (hard_instead_soft)
-               dev_dbg(hdev->dev, "Doing hard-reset instead of compute reset\n");
-
 do_reset:
        /* Re-entry of reset thread */
        if (from_hard_reset_thread && hdev->process_kill_trial_cnt)