feat: interrupt-driven xHCI keyboard — eliminate 20ms poll latency#241
Merged
feat: interrupt-driven xHCI keyboard — eliminate 20ms poll latency#241
Conversation
The xHCI MSI handler was disabling the GIC SPI after each interrupt and relying on a rate-limited timer poll (50 Hz / 20ms) to re-enable it. This meant every keystroke after the first waited up to 20ms+ for the next poll tick, defeating the purpose of MSI interrupts entirely. Now handle_interrupt() re-enables the SPI after draining the event ring, so the next USB event gets a real interrupt immediately. The timer poll remains as housekeeping (endpoint resets, deferred init) but no longer gates keyboard responsiveness. Changes: - Re-enable GIC SPI at end of handle_interrupt() after event drain - Remove poll % 4 rate-limiting from poll_hid_events() (every tick now) - One-shot SPI activation via SPI_ACTIVATED flag (250ms after init) - Reduce deferred doorbell re-ring from poll=300 to poll=75 - Gate procfs xhci module behind cfg(target_arch = "aarch64") - Graphics and page table performance experiments (WIP) Co-Authored-By: Ryan Breen <rbreen@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handle_interrupt()after draining the event ring, so the next USB event gets a real MSI interrupt immediately instead of waiting for a timer pollpoll % 4rate-limiting frompoll_hid_events()— was throttling to 50 Hz (20ms), now runs every tick (200 Hz / 5ms) as pure housekeepingSPI_ACTIVATEDflag at 250ms post-init (down from 1 second)cfg(target_arch = "aarch64")(fixes x86-64 build)Test plan
🤖 Generated with Claude Code