Fix a race condition when receiving events before unmasking interrupts

This commit is contained in:
bjorn3
2026-07-13 20:23:20 +02:00
parent b2ed85ea0d
commit a01d3ce6e5
+11
View File
@@ -240,9 +240,20 @@ impl<const N: usize> IrqReactor<N> {
warn!("xhci: Received interrupt, but no event was found in the event ring. Ignoring interrupt.")
}
self.unmask_interrupts();
// Process any events received between the NoEvent and unmasking interrupts
loop {
match self.process_one_event(&mut event_ring, &mut event_trb_index) {
EventProcessResult::NoEvent => break,
EventProcessResult::EventRingFull
| EventProcessResult::RegularEvent => {}
}
}
continue 'trb_loop;
}
EventProcessResult::EventRingFull => {
// FIXME can this use the RegularEvent path?
if self.hci.interrupt_is_pending(0) {
warn!("After incrementing the dequeue pointer, the interrupt bit is still pending.")
} else {