]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
habanalabs: print warning when reset is requested
authorOded Gabbay <oded.gabbay@gmail.com>
Fri, 27 Mar 2020 13:32:33 +0000 (16:32 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Sun, 17 May 2020 09:06:22 +0000 (12:06 +0300)
When the system administrator asks the driver to soft or hard reset the
device through sysfs, the driver should display a warning in the kernel log
to explain why it suddenly resets the device.

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

index 4cd622b017b9a9daa28dccf5b3263a0231d09876..e478a191e5f5c19e42bda97e7acc8fab87cc89ab 100644 (file)
@@ -183,6 +183,8 @@ static ssize_t soft_reset_store(struct device *dev,
                goto out;
        }
 
+       dev_warn(hdev->dev, "Soft-Reset requested through sysfs\n");
+
        hl_device_reset(hdev, false, false);
 
 out:
@@ -204,6 +206,8 @@ static ssize_t hard_reset_store(struct device *dev,
                goto out;
        }
 
+       dev_warn(hdev->dev, "Hard-Reset requested through sysfs\n");
+
        hl_device_reset(hdev, true, false);
 
 out: