From: Oded Gabbay Date: Fri, 27 Mar 2020 13:32:33 +0000 (+0300) Subject: habanalabs: print warning when reset is requested X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=49aba0bbab20a581dc3e32a6ee636c07a542eb9e;p=linux.git habanalabs: print warning when reset is requested 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 Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/sysfs.c b/drivers/misc/habanalabs/sysfs.c index 4cd622b017b9a..e478a191e5f5c 100644 --- a/drivers/misc/habanalabs/sysfs.c +++ b/drivers/misc/habanalabs/sysfs.c @@ -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: