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
diff --git a/kernel/ethosu_network.c b/kernel/ethosu_network.c
index 0654a79..86ae410 100644
--- a/kernel/ethosu_network.c
+++ b/kernel/ethosu_network.c
@@ -104,6 +104,9 @@
 	ret = ethosu_network_info_wait(info, 3000);
 	mutex_lock(&net->edev->mutex);
 
+	if (ret)
+		info->msg.fail(&info->msg);
+
 	ethosu_network_info_put(info);
 
 	return ret;
@@ -240,7 +243,7 @@
 	kref_get(&net->kref);
 }
 
-void ethosu_network_put(struct ethosu_network *net)
+int ethosu_network_put(struct ethosu_network *net)
 {
-	kref_put(&net->kref, ethosu_network_destroy);
+	return kref_put(&net->kref, ethosu_network_destroy);
 }