Skip to content

[kernel] Prevent potential hang on 16550A UART by loop-reading FIFO on each interrupt#2624

Merged
ghaerr merged 2 commits intomasterfrom
serfast
Feb 21, 2026
Merged

[kernel] Prevent potential hang on 16550A UART by loop-reading FIFO on each interrupt#2624
ghaerr merged 2 commits intomasterfrom
serfast

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Feb 20, 2026

As was reported in testing on real hardware on TLVC in Mellvik/TLVC#228 and Mellvik/TLVC#229, the 16550A and subsequent UARTs require special handling of the interrupt enable register, unless the FIFO is completely read during each interrupt received.

This is because the 16650 uses level-active interrupt signaling while the 8259 PIC is configured for edge-triggered interrupt detection. Reading all the bytes from the UART receive data register per interrupt ensures that the next byte received causes an edge transition on the interrupt pin of the 16550, which fixes the UART hang bug seen.

Thanks @Mellvik for the identification and testing of this problem!

@ghaerr ghaerr merged commit 4fab00a into master Feb 21, 2026
1 check passed
@ghaerr ghaerr deleted the serfast branch February 21, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant