hujun260 commented on code in PR #17958:
URL: https://github.com/apache/nuttx/pull/17958#discussion_r2700802370


##########
sched/irq/irq_attach_wqueue.c:
##########
@@ -128,9 +128,12 @@ static void irq_work_handler(FAR void *arg)
 static int irq_default_handler(int irq, FAR void *regs, FAR void *arg)
 {
   FAR struct irq_work_info_s *info = arg;
-  int ret;
+  int ret = IRQ_WAKE_THREAD;
 
-  ret = info->handler(irq, regs, arg);
+  if (info->handler)

Review Comment:
   In some interrupt scenarios, we don't need to perform extra actions in the 
hard interrupt context; we just need to trigger the interrupt thread. For 
instance, with certain timer interrupts that trigger at fixed intervals, we can 
set the handler to NULL to avoid a function call. Otherwise, we would have to 
provide a duplicate code implementation.
   
   Linux has a similar design where the handler can be NULL:
   
https://github.com/torvalds/linux/blob/983d014aafb14ee5e4915465bf8948e8f3a723b5/kernel/irq/manage.c#L2053-L2056



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