aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_cancel_inference.c
diff options
context:
space:
mode:
authorDavide Grohmann <davide.grohmann@arm.com>2022-04-07 16:58:32 +0200
committerDavide Grohmann <davide.grohmann@arm.com>2022-05-09 09:38:51 +0200
commit8b1fe55bf4788ac85a0d8f9059ca0305904ddc5d (patch)
tree248f62319537bd4daecb62db44171b533d7a4ffe /kernel/ethosu_cancel_inference.c
parent7e8f508765632c42cc44fd8ad704c9d90943ab32 (diff)
downloadethos-u-linux-driver-stack-22.05-rc1.tar.gz
Reset firmware when inference cancellation fails22.05-rc1
If an inference fails to be cancelled and it is still in a pending state, reset the whole firmware. Indeed the assumption is that something is at fault on the firmware side and it is not progressing. Change-Id: I2f568b2167d86cda3cb96a5e83551b018f5fc55d
Diffstat (limited to 'kernel/ethosu_cancel_inference.c')
-rw-r--r--kernel/ethosu_cancel_inference.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/ethosu_cancel_inference.c b/kernel/ethosu_cancel_inference.c
index 09778ee..befdd2f 100644
--- a/kernel/ethosu_cancel_inference.c
+++ b/kernel/ethosu_cancel_inference.c
@@ -159,6 +159,15 @@ int ethosu_cancel_inference_request(struct ethosu_inference *inf,
goto put_kref;
}
+ /* if cancellation failed and the inference did not complete then reset
+ * the firmware */
+ if (cancellation->uapi->status == ETHOSU_UAPI_STATUS_ERROR &&
+ !cancellation->inf->done) {
+ ret = ethosu_firmware_reset(cancellation->edev);
+ if (ret)
+ goto put_kref;
+ }
+
put_kref:
kref_put(&cancellation->kref, &ethosu_cancel_inference_destroy);