acassis opened a new pull request, #21551:
URL: https://github.com/apache/nuttx/pull/21551

   ## Summary
   
   With CONFIG_ARCH_HIPRI_INTERRUPT, arm_doirq() passes PendSV to 
irq_dispatch(), because a high priority interrupt can pend PendSV to get back 
into the OS and a handler may be attached for that.
   
   But the OS also pends PendSV itself: up_schedule_sigaction() does it to 
deliver a signal to the running task, and exception_direct() to switch context. 
 When no handler is attached, irq_dispatch() then calls irq_unexpected_isr() 
and the system panics.  This was seen on an i.MX RT1052 board (ddcnc-ec300) 
using a zero latency interrupt: the first PHY notification signal to the 
NETINIT monitor thread halted the system, before the network interface was ever 
brought up.
   
   Dispatch PendSV only when a handler was attached to it, and otherwise 
continue with the normal PendSV processing, as without 
CONFIG_ARCH_HIPRI_INTERRUPT.
   
   Note: many chips attach a diagnostic PendSV handler that panics (when 
CONFIG_DEBUG_FEATURES is set) without checking for CONFIG_ARCH_HIPRI_INTERRUPT, 
e.g. imxrt, stm32f7, samv7, kinetis, lpc43xx, rp2040, nrf53, s32k3xx; stm32h7, 
stm32l4 and nrf52 already skip the panic in that case.  Such a handler is only 
reached when PendSV is dispatched, which happens only with high priority 
interrupts, where PendSV is not an error.
   
   ## Impact
   
   Improvement
   
   ## Testing
   
   Tested on the ddcnc-ec300 (Cortex-M7) with a zero latency step timer
   interrupt: the network comes up and signals are delivered.  Build
   tested for armv6-m (nucleo-g071rb:nsh), armv7-m with and without
   CONFIG_ARCH_HIPRI_INTERRUPT, and armv8-m with it (nucleo-l552ze:nsh).


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