aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_inference.h
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2022-03-17 17:15:52 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-04-04 15:34:47 +0200
commit442fefb74a28307cfcd009723504ea5ac1353430 (patch)
treee22c128b2888de206d84c48f19e4d268f782d10e /kernel/ethosu_inference.h
parentf5b98c965c51def4f63d7fb198f70180e195b2e8 (diff)
downloadethos-u-linux-driver-stack-442fefb74a28307cfcd009723504ea5ac1353430.tar.gz
Reset firmware
Reset the firmware if it becomes unresponsive. Use ping to send keep alive requests. Only monitor ping and inference request messages. The other messages pass no resources to the firmware and can be cancelled without resetting the firmware. Change-Id: Ifbcc370f02d79a64f25598f11376a1dc84a7a066
Diffstat (limited to 'kernel/ethosu_inference.h')
-rw-r--r--kernel/ethosu_inference.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/kernel/ethosu_inference.h b/kernel/ethosu_inference.h
index a41043a..66d4ff9 100644
--- a/kernel/ethosu_inference.h
+++ b/kernel/ethosu_inference.h
@@ -25,6 +25,7 @@
* Includes
****************************************************************************/
+#include "ethosu_mailbox.h"
#include "uapi/ethosu.h"
#include <linux/kref.h>
@@ -48,10 +49,10 @@ struct file;
* @file: File handle
* @kref: Reference counter
* @waitq: Wait queue
+ * @done: Wait condition is done
* @ifm: Pointer to IFM buffer
* @ofm: Pointer to OFM buffer
* @net: Pointer to network
- * @pending: Pending response from the firmware
* @status: Inference status
* @pmu_event_config: PMU event configuration
* @pmu_event_count: PMU event count after inference
@@ -59,22 +60,22 @@ struct file;
* @pmu_cycle_counter_count: PMU cycle counter count after inference
*/
struct ethosu_inference {
- struct ethosu_device *edev;
- struct file *file;
- struct kref kref;
- wait_queue_head_t waitq;
- uint32_t ifm_count;
- struct ethosu_buffer *ifm[ETHOSU_FD_MAX];
- uint32_t ofm_count;
- struct ethosu_buffer *ofm[ETHOSU_FD_MAX];
- struct ethosu_network *net;
- bool pending;
- enum ethosu_uapi_status status;
- uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX];
- uint32_t pmu_event_count[ETHOSU_PMU_EVENT_MAX];
- uint32_t pmu_cycle_counter_enable;
- uint64_t pmu_cycle_counter_count;
- struct list_head list;
+ struct ethosu_device *edev;
+ struct file *file;
+ struct kref kref;
+ wait_queue_head_t waitq;
+ bool done;
+ uint32_t ifm_count;
+ struct ethosu_buffer *ifm[ETHOSU_FD_MAX];
+ uint32_t ofm_count;
+ struct ethosu_buffer *ofm[ETHOSU_FD_MAX];
+ struct ethosu_network *net;
+ enum ethosu_uapi_status status;
+ uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX];
+ uint32_t pmu_event_count[ETHOSU_PMU_EVENT_MAX];
+ uint32_t pmu_cycle_counter_enable;
+ uint64_t pmu_cycle_counter_count;
+ struct ethosu_mailbox_msg msg;
};
/****************************************************************************
@@ -108,8 +109,10 @@ void ethosu_inference_get(struct ethosu_inference *inf);
/**
* ethosu_inference_put() - Put inference
+ *
+ * Return: 1 if object was removed, else 0.
*/
-void ethosu_inference_put(struct ethosu_inference *inf);
+int ethosu_inference_put(struct ethosu_inference *inf);
/**
* ethosu_inference_rsp() - Handle inference response