mt76: mt76_vif_phy() return hw->priv when chanctx is absent - #16
Open
EdinsonMoreno wants to merge 1 commit into
Open
mt76: mt76_vif_phy() return hw->priv when chanctx is absent#16EdinsonMoreno wants to merge 1 commit into
EdinsonMoreno wants to merge 1 commit into
Conversation
On single-radio setups or during early STA association events, mlink->ctx may not be assigned yet. Returning NULL in that case propagates as -EINVAL (-22) to callers such as sta_add, causing station insertion to fail with: wlp3s0: failed to insert STA entry for the AP (error -22) Return hw->priv (the primary PHY) instead, matching the existing behavior already applied for kernels >= 6.15 with n_radio == 0. Reported-by: oswystk15662 <hmtheboy154#11 (comment)>
|
Thanks for the work, but if this isn't for a specific version of the kernel if I understand it right, shouldn't this be submitted upstream as well? |
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.
Problem
On single-radio setups or during early STA association events,
mlink->ctxmay not be assigned yet.mt76_vif_phy()currently returnsNULLin this case, which propagates as-EINVAL(-22) to any caller that doesn't explicitly guard against NULL, causing station insertion to fail:Reported by @oswystk15662 in issue #11: #11 (comment)
Fix
Return
hw->priv(the primary PHY) instead ofNULLwhenmlink->ctx == NULL. This matches the behavior already implemented for kernels >= 6.15 with!hw->wiphy->n_radio:The same logic applies here: on a single-radio device with no chanctx assigned yet,
hw->privis always the correct PHY to return.Tested on
14c3:7902)Note
This fix was verified independently by @oswystk15662 (Ubuntu 22.04, kernel 6.8.0) as resolving the
-22error on their setup.