habanalabs: refactor reset log message
authorOded Gabbay <ogabbay@kernel.org>
Thu, 30 Sep 2021 08:53:37 +0000 (11:53 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 18 Oct 2021 09:05:46 +0000 (12:05 +0300)
Reset to the device is not necessarily due to an error, so print it
as info instead of error.

In addition, print the type of reset we are doing:
- reset of the entire device (aka hard reset)
- reset of the device after user have released it (less than hard reset)
- lighter reset of an inference device (aka soft reset)

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c

index 8f96f2b..be18ad0 100644 (file)
@@ -1018,7 +1018,14 @@ do_reset:
 
                take_release_locks(hdev);
 
-               dev_err(hdev->dev, "Going to RESET device!\n");
+               if (hard_reset)
+                       dev_info(hdev->dev, "Going to reset device\n");
+               else if (flags & HL_RESET_DEVICE_RELEASE)
+                       dev_info(hdev->dev,
+                               "Going to reset device after it was released by user\n");
+               else
+                       dev_info(hdev->dev,
+                               "Going to reset compute engines of inference device\n");
        }
 
 again: