daniel-p-carvalho commented on code in PR #20782:
URL: https://github.com/apache/nuttx/pull/20782#discussion_r4372098891


##########
drivers/timers/watchdog.c:
##########
@@ -466,12 +510,266 @@ static int wdog_notifier(FAR struct notifier_block *nb, 
unsigned long action,
 }
 #endif
 
-static void wdog_callback(wdparm_t arg)
+#ifdef CONFIG_WATCHDOG_TASKMONITOR
+/* Restart the timeout of a channel, if it is armed */
+
+static void watchdog_taskmonitor_feed(FAR struct watchdog_user_s *user)
+{
+  if (user->armed)
+    {
+      user->deadline = clock_systime_ticks() + user->timeout;
+    }
+}
+
+/* Feed the lower half while no armed channel timed out.  Running from the
+ * low priority work queue also makes the hardware reset the system if that
+ * queue stops.

Review Comment:
   Just to make sure I understand what you have in mind: do you want the task 
monitor to be selectable between the same triggers as AUTOMONITOR (wdog / 
wqueue / idle), reusing that code, or do you want the two monitors to run 
together (per-task supervision plus the global "system alive" feed)? Or both?
   
   Currently the task monitor feeds from a LPWORK worker, which has the side 
effect of resetting the system if that queue stops. A wdog trigger would run in 
interrupt context, so the channel list could not be protected by the mutex, and 
an idle trigger would not feed if the CPU never goes idle. I want to be sure I 
pick the right trade-off.
   
   I'm happy to do it in this PR if you prefer, or in a follow-up to keep this 
one focused. Let me know which you'd rather have.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to