aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_network_info.c
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2022-03-14 16:09:12 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-03-23 13:16:25 +0100
commitf5b98c965c51def4f63d7fb198f70180e195b2e8 (patch)
treed8457be3deed68b1c729b998c0720e9a5a63ecd9 /kernel/ethosu_network_info.c
parent3c6a260a705a668b5ff8e8159f04c257273fb458 (diff)
downloadethos-u-linux-driver-stack-f5b98c965c51def4f63d7fb198f70180e195b2e8.tar.gz
Kernel watchdog timeout
Implement kernel watchdog that detects when firmware becomes unresponsive. Change-Id: I5c5b58a56a2ce629e1fd7cabae83b61823239ea6
Diffstat (limited to 'kernel/ethosu_network_info.c')
-rw-r--r--kernel/ethosu_network_info.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/kernel/ethosu_network_info.c b/kernel/ethosu_network_info.c
index 2b1f841..24be677 100644
--- a/kernel/ethosu_network_info.c
+++ b/kernel/ethosu_network_info.c
@@ -47,6 +47,24 @@ static void ethosu_network_info_destroy(struct kref *kref)
devm_kfree(info->edev->dev, info);
}
+static int ethosu_network_info_send(struct ethosu_network_info *info)
+{
+ int ret;
+
+ /* Send network info request to firmware */
+ ret = ethosu_mailbox_network_info_request(&info->edev->mailbox,
+ info,
+ info->net->buf,
+ info->net->index);
+ if (ret)
+ return ret;
+
+ /* Increase reference count for the pending network info response */
+ ethosu_network_info_get(info);
+
+ return 0;
+}
+
struct ethosu_network_info *ethosu_network_info_create(
struct ethosu_device *edev,
struct ethosu_network *net,
@@ -71,17 +89,10 @@ struct ethosu_network_info *ethosu_network_info_create(
/* Get reference to network */
ethosu_network_get(net);
- /* Send network info request to firmware */
- ret = ethosu_mailbox_network_info_request(&info->edev->mailbox,
- info,
- info->net->buf,
- info->net->index);
+ ret = ethosu_network_info_send(info);
if (ret)
goto put_info;
- /* Increase reference count for the pending network info response */
- ethosu_network_info_get(info);
-
dev_info(edev->dev, "Network info create. handle=%p\n", info);
return info;