raiden00pl opened a new pull request, #22417: URL: https://github.com/apache/nuttx/pull/22417
## Summary `kvaser_sock_interrupt()` always ran `CONFIG_CAN_KVASER_IRQ_PASSES` passes over the SJA1000 interrupt register and acted on the bits of interrupt sources that are disabled. The RX bit reads as set while the RX FIFO is not empty, also while the ISR keeps the RX interrupt masked for the deferred poll, so every TX interrupt re-masked RX and accessed the registers 16 times or more. The RX poll then drained the FIFO too slowly and it overran, losing received frames. The ISR now handles only the enabled interrupt sources and leaves the loop at the first pass that finds none. ## Impact Kvaser PCI in SocketCAN mode. Fewer register accesses per interrupt, and no RX FIFO overruns under sustained receive load. ## Testing qemu-intel64 (KVM, `-smp 4`, `kvaser_pci` on a host SocketCAN bus): three concurrent ISO-TP sessions receiving 255-byte messages from the host (STmin 1 ms), 10 runs per build, interleaved with master: - master: 28 of 30 runs lost an ISO-TP consecutive frame (SJA1000 data overrun). - this PR: 40 of 40 runs passed. CAN raw, CAN FD and ISO-TP socket tests on the same target pass as on master. -- 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]
