xiaoxiang781216 commented on code in PR #20782:
URL: https://github.com/apache/nuttx/pull/20782#discussion_r4372286759


##########
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?
   
   Both, so both the keepalive logic and most Kconfig can be reused.
   
   > 
   > 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, 
   
   yes, we need switch to spinlock.
   
   > and an idle trigger would not feed if the CPU never goes idle. I want to 
be sure I pick the right trade-off.
   > 
   
   yes, if user select idle, which mean the system can't busy without enter 
sleeping.
   



-- 
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