aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_cancel_inference.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/ethosu_cancel_inference.c')
-rw-r--r--kernel/ethosu_cancel_inference.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/ethosu_cancel_inference.c b/kernel/ethosu_cancel_inference.c
index ee630f5..6661522 100644
--- a/kernel/ethosu_cancel_inference.c
+++ b/kernel/ethosu_cancel_inference.c
@@ -28,6 +28,7 @@
#include "ethosu_device.h"
#include "ethosu_inference.h"
+#include <linux/remoteproc.h>
#include <linux/wait.h>
/****************************************************************************
@@ -110,6 +111,7 @@ int ethosu_cancel_inference_request(struct device *dev,
/* Unlock the mutex before going to block on the condition */
device_unlock(dev);
+
/* wait for response to arrive back */
timeout = wait_for_completion_timeout(&cancellation->done,
msecs_to_jiffies(
@@ -123,11 +125,14 @@ int ethosu_cancel_inference_request(struct device *dev,
dev_warn(dev,
"Msg: Cancel Inference response lost - timeoutdev");
ret = -EIO;
+
+ rproc_report_crash(rproc_get_by_child(dev), RPROC_FATAL_ERROR);
goto deregister;
}
if (cancellation->errno) {
ret = cancellation->errno;
+ rproc_report_crash(rproc_get_by_child(dev), RPROC_FATAL_ERROR);
goto deregister;
}
@@ -138,6 +143,7 @@ deregister:
kfree:
dev_info(dev,
"Cancel inference destroy. cancel=0x%pK", cancellation);
+
/* decrease the reference on the inference we are refering to */
ethosu_inference_put(cancellation->inf);
devm_kfree(dev, cancellation);