aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_inference.h
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2023-01-20 13:38:13 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2023-02-02 16:30:39 +0100
commitec47704ab3fd50a9ef8339f33139ddae4caa00b6 (patch)
tree87698ce04f75b460580dfbc637d453dbfc141c37 /kernel/ethosu_inference.h
parentd779a08a0f7ca3cdde16941720ddc7af96e74520 (diff)
downloadethos-u-linux-driver-stack-ec47704ab3fd50a9ef8339f33139ddae4caa00b6.tar.gz
Break circulare dependency on struct ethosu_device
The 'struct ethosu_device' has been passed as argument to classes. This creates a circular dependency dependency and it gives all classes full visibility to all resources in the device struct. This patch removes the circular dependency. Using device_lock() and device_unlock() to for synchronization. Change-Id: I8322e6530c72d7bd67f48f411b4f14b612be2706
Diffstat (limited to 'kernel/ethosu_inference.h')
-rw-r--r--kernel/ethosu_inference.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/ethosu_inference.h b/kernel/ethosu_inference.h
index 5a3b860..9fa0a4a 100644
--- a/kernel/ethosu_inference.h
+++ b/kernel/ethosu_inference.h
@@ -37,7 +37,6 @@
struct ethosu_buffer;
struct ethosu_core_msg_inference_rsp;
-struct ethosu_device;
struct ethosu_network;
struct ethosu_uapi_inference_create;
struct file;
@@ -60,7 +59,8 @@ struct file;
* @msg: Mailbox message
*/
struct ethosu_inference {
- struct ethosu_device *edev;
+ struct device *dev;
+ struct ethosu_mailbox *mailbox;
struct file *file;
struct kref kref;
wait_queue_head_t waitq;
@@ -89,7 +89,8 @@ struct ethosu_inference {
*
* Return: fd on success, else error code.
*/
-int ethosu_inference_create(struct ethosu_device *edev,
+int ethosu_inference_create(struct device *dev,
+ struct ethosu_mailbox *mailbox,
struct ethosu_network *net,
struct ethosu_uapi_inference_create *uapi);
@@ -117,7 +118,7 @@ int ethosu_inference_put(struct ethosu_inference *inf);
/**
* ethosu_inference_rsp() - Handle inference response
*/
-void ethosu_inference_rsp(struct ethosu_device *edev,
+void ethosu_inference_rsp(struct ethosu_mailbox *mailbox,
int msg_id,
struct ethosu_core_msg_inference_rsp *rsp);