summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKoby Elbaz <kelbaz@habana.ai>2023-06-05 11:11:05 +0300
committerOded Gabbay <ogabbay@kernel.org>2023-10-09 12:37:18 +0300
commit2b541cf91373b1bc1634a82b668022d50c05603c (patch)
treec6e7ae57b467b98f2d9e8b69cf81e672854b82dd /drivers
parentbffd2f16ae374decdeb5bc714b1aa2e0c23f3708 (diff)
accel/habanalabs: print return code when process termination fails
As part of driver teardown, we attempt to kill all user processes. It shouldn't fail, but if it does we want to print the error code that the kapi returned to us. Signed-off-by: Koby Elbaz <kelbaz@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/accel/habanalabs/common/device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 5973e4d64e19..764d40c0d666 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -1352,7 +1352,8 @@ static int device_kill_open_processes(struct hl_device *hdev, u32 timeout, bool
* we don't need to kill it.
*/
dev_dbg(hdev->dev,
- "Can't get task struct for user process, assuming process was killed from outside the driver\n");
+ "Can't get task struct for user process %d, assuming process was killed from outside the driver\n",
+ pid_nr(hpriv->taskpid));
}
}
@@ -2438,14 +2439,14 @@ void hl_device_fini(struct hl_device *hdev)
hdev->process_kill_trial_cnt = 0;
rc = device_kill_open_processes(hdev, HL_WAIT_PROCESS_KILL_ON_DEVICE_FINI, false);
if (rc) {
- dev_crit(hdev->dev, "Failed to kill all open processes\n");
+ dev_crit(hdev->dev, "Failed to kill all open processes (%d)\n", rc);
device_disable_open_processes(hdev, false);
}
hdev->process_kill_trial_cnt = 0;
rc = device_kill_open_processes(hdev, 0, true);
if (rc) {
- dev_crit(hdev->dev, "Failed to kill all control device open processes\n");
+ dev_crit(hdev->dev, "Failed to kill all control device open processes (%d)\n", rc);
device_disable_open_processes(hdev, true);
}