diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-02-28 10:46:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-28 13:07:52 +0100 |
commit | af5f7eea45e1b177db961c4706625f4cf545c063 (patch) | |
tree | a59b3f71bb2aa0dbd1f7e39129f5e30b75a11a4e /drivers/misc/habanalabs/goya/goya.c | |
parent | efaa281219fd37cb1ee5cdef483aa67a16b0a087 (diff) | |
download | lwn-af5f7eea45e1b177db961c4706625f4cf545c063.tar.gz lwn-af5f7eea45e1b177db961c4706625f4cf545c063.zip |
habanalabs: soft-reset device if context-switch fails
This patch fix a bug in the driver, where if the TPC or MME remains in
non-IDLE even after all the command submissions are done (due to user bug
or malicious user), then future command submissions will fail in the
context-switch stage and the driver will remain in "stuck" mode.
The fix is to do a soft-reset of the device in case the context-switch
fails, because the device should be IDLE during context-switch. If it is
not IDLE, then something is wrong and we should reset the compute engines.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/goya/goya.c')
-rw-r--r-- | drivers/misc/habanalabs/goya/goya.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c index 39824214ce61..11597432f519 100644 --- a/drivers/misc/habanalabs/goya/goya.c +++ b/drivers/misc/habanalabs/goya/goya.c @@ -3138,7 +3138,7 @@ static int goya_send_job_on_qman0(struct hl_device *hdev, struct hl_cs_job *job) if (!hdev->asic_funcs->is_device_idle(hdev)) { dev_err_ratelimited(hdev->dev, "Can't send KMD job on QMAN0 if device is not idle\n"); - return -EFAULT; + return -EBUSY; } fence_ptr = hdev->asic_funcs->dma_pool_zalloc(hdev, 4, GFP_KERNEL, |