Kaben123 opened a new pull request, #22579:
URL: https://github.com/apache/nuttx/pull/22579
## Summary
`irq_unexpected_isr()` always panics. On some systems an unexpected
interrupt (spurious hardware event or a software mistake) should not bring
the whole system down; logging it and disabling the line is enough.
Add `CONFIG_IRQ_UNEXPECTED_PANIC`:
- `y` (default): unchanged behavior, log the IRQ number and `PANIC()`.
- `n`: log the IRQ number, disable the line with `up_disable_irq()` and
return.
The option depends on `!ARCH_NOINTC`, because those architectures have no
`up_disable_irq()`; they always panic.
The second commit documents the option in
`Documentation/os/interrupts/index.rst`.
## Impact
- Default behavior unchanged (`default y`).
- With `n`: note that some GPIO drivers (tiva, cc13xx, at32uc3) also use
`irq_unexpected_isr` as the default handler of GPIO pin interrupts; in that
case the number passed to `up_disable_irq()` is the GPIO pin IRQ number.
- Documentation updated.
## Testing
Host: Ubuntu 22.04.5 x86_64, GCC 13.1.0, arm-none-eabi-gcc 13.2.1. Base:
apache/nuttx master 75b4dc85275, apache/nuttx-apps master 9a2c68962.
- Builds without new warnings, Make: `sim:nsh` and `stm32f4discovery:nsh`,
each with `CONFIG_IRQ_UNEXPECTED_PANIC=y` and `=n`; CMake: `sim:nsh` with
`y` and `n`.
- `sim:nsh` with `CONFIG_IRQ_UNEXPECTED_PANIC=n` boots to nsh normally.
- The `n` path (an actual unexpected interrupt) was not triggered on
hardware.
- `tools/checkpatch.sh -c -u -m -g` passes.
--
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]