Repository navigation
wifi: mt7932: acknowledge interrupts before servicing the rings - #265
Merged
Merged
Conversation
mt_service() drains the RX rings and retires TX descriptors first and only then writes the causes it read back to the interrupt status register. A completion that the device posts after a ring has been drained but before that write sets a status bit that the write clears again. Its descriptor then waits, unserviced, until some unrelated interrupt arrives; for a command reply that can be the full command timeout. Acknowledge the causes, then service the rings, as other MediaTek PCIe drivers do. Read the status register back after the write so that the acknowledgment has reached the device, and the descriptors written before it are visible, before the rings are read. A completion that arrives while the rings are being serviced now leaves its status bit set, and the device interrupts again once the mask is restored. Fixes: 8709ef5 ("wifi: add existing J700 MT7932 fullmac implementation") Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 19, 2026
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.
Acknowledge MT7932 interrupts before servicing the rings
The bug
mt_service()drained the RX rings and retired TX descriptors first, and only then wrote the causes ithad read back to the interrupt status register (write-1-to-clear). A completion that the device posted
after its ring had been drained, but before that write, set a status bit that the write then cleared. Its
descriptor waited, unserviced, for some unrelated interrupt. For a firmware command reply that can mean
the full 5 s command timeout.
The fix
Read the causes, acknowledge them (including the MCU software interrupt), read the status register back
so the acknowledgment has reached the device and the descriptors written before it are visible, and only
then service the rings, which is the order other MediaTek PCIe drivers use. A completion that arrives while
the rings are being serviced keeps its status bit, and the device interrupts again when the mask is
restored. Polled mode (
poll_test) uses the same function and gets the same order.Testing
Written for this tree; tested on a MacBook Neo (J700), 5 GHz channel 149 at 40 MHz: 120 s
bidirectional iperf3 with 20 concurrent scans, on three boots with this change and twice without it.
With the change, every scan returned 0 in 1.06-1.18 s, iperf3 completed both directions, the station
stayed associated, and there were no
timeout PCI commandorrecovery requiredlines. Shortzero-throughput intervals (1-3 s) coincide with the scans with and without the change.
Image modules apple/t8140-j700.dtbwith the J700 config, clang 22.1.6;W=1build ofdrivers/net/wireless/mediatek/mt7932/anddrivers/bluetooth/mt7932_bt_pcie.owith no diagnostics.checkpatch.pl --strict: clean apart from theAssisted-by:format note.(results to be added).
🤖 Generated with Claude Code