aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
authorDavide Grohmann <davide.grohmann@arm.com>2022-03-23 12:48:45 +0100
committerDavide Grohmann <davide.grohmann@arm.com>2022-05-05 11:13:04 +0200
commit7e8f508765632c42cc44fd8ad704c9d90943ab32 (patch)
tree42dcfb929accf5470d6aa61810da20356c39eb75 /kernel/ethosu_mailbox.c
parent82d225899bd3d4fd07d70cac80f50c1b288dc4a3 (diff)
downloadethos-u-linux-driver-stack-7e8f508765632c42cc44fd8ad704c9d90943ab32.tar.gz
Add support for inference cancellation
Send cancel inference messages to the ethosu subsystem to abort inference execution there. Also mark inference as aborted in the linux driver stack itself, so pending inference messages are not resent when resetting the firmware. Change-Id: I244c2b119fd7995d14e3859815abf2a00c7f0583
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-rw-r--r--kernel/ethosu_mailbox.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 7355361..5343e56 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -418,6 +418,20 @@ int ethosu_mailbox_network_info_request(struct ethosu_mailbox *mbox,
&info, sizeof(info));
}
+int ethosu_mailbox_cancel_inference(struct ethosu_mailbox *mbox,
+ void *user_arg,
+ void *inference_handle)
+{
+ struct ethosu_core_cancel_inference_req req;
+
+ req.user_arg = (ptrdiff_t)user_arg;
+ req.inference_handle = (ptrdiff_t)inference_handle;
+
+ return ethosu_queue_write_msg(mbox,
+ ETHOSU_CORE_MSG_CANCEL_INFERENCE_REQ,
+ &req, sizeof(req));
+}
+
static void ethosu_mailbox_rx_work(struct work_struct *work)
{
struct ethosu_mailbox *mbox = container_of(work, typeof(*mbox), work);