diff options
Diffstat (limited to 'kernel/ethosu_cancel_inference.c')
-rw-r--r-- | kernel/ethosu_cancel_inference.c | 9 |
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, ðosu_cancel_inference_destroy); |