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
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 @@
 				      &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);