linux-next: manual merge of the wireless-next tree with the origin tree
Subsystems (2)
Mark Brown
maintainerHi all,
Today's linux-next merge of the wireless-next tree got a conflict in:
net/mac80211/mlme.c
between commit:
035ed430ce6a2 ("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc")
from the origin tree and commit:
f13e573ab3f12 ("wifi: mac80211: notify driver before destroying assoc link")
from the wireless-next tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
net/mac80211/mlme.c +0 -0
@@@ -7140,7 -7191,8 +7193,8 @@@ static void ieee80211_rx_mgmt_assoc_res {struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data; +enum assoc_status assoc_status =ASSOC_ABANDON ; - u16 capab_info, status_code, aid; + u16 capab_info, status_code, aid = 0;struct ieee80211_elems_parse_params parse_params = { .bss =NULL , .link_id =-1 ,
Hi Mark,
Thanks for carrying the conflict resolution.
I noticed one semantic conflict later in ieee80211_rx_mgmt_assoc_resp().
Commit 035ed430ce6a2 ("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc") added:
else if (status_code == WLAN_STATUS_SUCCESS) goto abandon_assoc;
where abandon_assoc destroyed the association data with ASSOC_ABANDON and notified the driver.
After f13e573ab3f12 ("wifi: mac80211: notify driver before destroying assoc link") folds the driver notification into ieee80211_destroy_assoc_data(), the equivalent target is destroy_assoc_data, since assoc_status is initialized to ASSOC_ABANDON.
next-20260722 instead has:
else if (status_code == WLAN_STATUS_SUCCESS) goto notify_driver;
which bypasses ieee80211_destroy_assoc_data(). I believe this should instead be:
else if (status_code == WLAN_STATUS_SUCCESS) goto destroy_assoc_data;
Regards,
Zhao
Quoted 37 lines · Mark Brown
Hi all,
Today's linux-next merge of the wireless-next tree got a conflict in:
net/mac80211/mlme.cbetween commit:
035ed430ce6a2("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc")from the origin tree and commit:
f13e573ab3f12("wifi: mac80211: notify driver before destroying assoc link")from the wireless-next tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
net/mac80211/mlme.c +0
-0@@@ -7140,7 -7191,8 +7193,8 @@@ static void ieee80211_rx_mgmt_assoc_res{
structieee80211_if_managed*ifmgd =&sdata->u.mgd; structieee80211_mgd_assoc_data*assoc_data=ifmgd->assoc_data;
+ enumassoc_statusassoc_status=ASSOC_ABANDON;
- u16capab_info,status_code, aid;
+ u16capab_info,status_code, aid = 0;
structieee80211_elems_parse_paramsparse_params= { .bss = NULL,
.link_id = -1,
Mark Brown
maintainerQuoted 20 lines · Enderaoe Lyther
Thanks for carrying the conflict resolution.
I noticed one semantic conflict later in
ieee80211_rx_mgmt_assoc_resp().Commit
035ed430ce6a2("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc") added:else if (status_code == WLAN_STATUS_SUCCESS) goto abandon_assoc;where
abandon_assocdestroyed the association data withASSOC_ABANDONand notified the driver.After
f13e573ab3f12("wifi: mac80211: notify driver before destroying assoc link") folds the driver notification intoieee80211_destroy_assoc_data(), the equivalent target isdestroy_assoc_data, sinceassoc_statusis initialized toASSOC_ABANDON.next-20260722 instead has:
Quoted 8 lines
else if (status_code == WLAN_STATUS_SUCCESS) goto notify_driver;which bypasses
ieee80211_destroy_assoc_data(). I believe this should instead be:else if (status_code == WLAN_STATUS_SUCCESS) goto destroy_assoc_data;
I can't tell which bit of code you are talking about here. I see there is a block at line 7274 of -next:
if (elems->aid_resp)
aid = le16_to_cpu(elems->aid_resp->aid);
else if (!assoc_data->s1g)
aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
else if (status_code == WLAN_STATUS_SUCCESS)
goto notify_driver;but that is immediately after another goto notify_driver, there's further notify_driver error handling afterwards and all the earlier error handling is return statements so it looks at least unclear what's supposed to be going on.
Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed.
Quoted 7 lines · Mark Brown
Quoted 1 line · Enderaoe Lyther
I noticed one semantic conflict later in
ieee80211_rx_mgmt_assoc_resp().I can't tell which bit of code you are talking about here. I see there is a block at line 7274 of -next:
Quoted 6 lines
if (elems->aid_resp)
aid = le16_to_cpu(elems->aid_resp->aid);
else if (!assoc_data->s1g)
aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
else if (status_code == WLAN_STATUS_SUCCESS)
goto notify_driver;Sorry about the formatting in my earlier message. I should have quoted the code inline instead of top-posting.
That last branch was introduced by 035ed430ce6a ("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc") as:
else if (status_code == WLAN_STATUS_SUCCESS) goto abandon_assoc;
f13e573ab3f12 ("wifi: mac80211: notify driver before destroying assoc link") consolidated terminal association cleanup at destroy_assoc_data and removed abandon_assoc. The conflict resolution retargeted this branch to notify_driver, but notify_driver only calls drv_mgd_complete_tx() without destroying the association data.
Since assoc_status is initialized to ASSOC_ABANDON at function entry, the equivalent target is destroy_assoc_data. A successful S1G association response with no AID Response element otherwise leaves assoc_data live instead of abandoning it.
Quoted 4 lines
but that is immediately after another goto
notify_driver, there's furthernotify_drivererror handling afterwards and all the earlier error handling is return statements so it looks at least unclear what's supposed to be going on.
Other goto notify_driver targets are intentional:
- "if (!elems) goto notify_driver" is a pre-existing allocation failure bail-out; so association timeout handles cleanup.
- The comeback path WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY keeps assoc_data live deliberately for retry.
A successful S1G response without an AID Response element is terminal. It needs to abandon association immediately, so the target should be destroy_assoc_data rather than notify_driver.
Quoted 1 line
Please don't top post, reply in line with needed context.
Understood. Sorry for the unclear top-posted reply.
Zhao
Johannes Berg
maintainerQuoted 28 lines · Zhao Li
That last branch was introduced by
035ed430ce6a("wifi: mac80211: avoid non-S1G AID fallback for S1G assoc") as:else if (status_code == WLAN_STATUS_SUCCESS) goto abandon_assoc;
f13e573ab3f12("wifi: mac80211: notify driver before destroying assoc link") consolidated terminal association cleanup atdestroy_assoc_dataand removedabandon_assoc. The conflict resolution retargeted this branch tonotify_driver, butnotify_driveronly callsdrv_mgd_complete_tx()without destroying the association data.Since
assoc_statusis initialized toASSOC_ABANDONat function entry, the equivalent target isdestroy_assoc_data. A successful S1G association response with no AID Response element otherwise leavesassoc_datalive instead of abandoning it.Quoted 4 lines
but that is immediately after another goto
notify_driver, there's furthernotify_drivererror handling afterwards and all the earlier error handling is return statements so it looks at least unclear what's supposed to be going on.Other goto
notify_drivertargets are intentional:- "if (!elems) goto
notify_driver" is a pre-existing allocation failure bail-out; so association timeout handles cleanup.
Quoted 6 lines
- The comeback path
WLAN_STATUS_ASSOC_REJECTED_TEMPORARILYkeepsassoc_datalive deliberately for retry.A successful S1G response without an AID Response element is terminal. It needs to abandon association immediately, so the target should be
destroy_assoc_datarather thannotify_driver.
Actually, looking at this again because I was going to send a PR for wireless-next, I disagree.
From userspace perspective, you're right, we could and perhaps should abandon the assoc attempt entirely and send a "something went wrong" to userspace.
However, from the driver's perspective, we're going to need the notify_driver part, because we're done with the transmit/receive cycle. Just abandoning it there would introduce a bug around this area.
But because I don't think (a) we should fix that in the merge, and (b) it's actually very important, I'm just going to leave it as "notify_driver". Sure, this means that for a bogus association response we're going to try again (and who knows what the AP will do then), but that only risks confusing the AP and potentially wasting some time against a broken AP, rather than confusing the driver.
If we actually observe this in practice and want to get rid of the time wasting, I guess we could add a path out that does both, but I'm not sure it's worth it.
johannes
Quoted 3 lines · Johannes Berg
But because I don't think (a) we should fix that in the merge, and (b) it's actually very important, I'm just going to leave it as "
notify_driver".
I traced both paths again and I agree with you. Retrying against a broken AP is the better failure mode than confusing the driver, and the trigger needs an AP that reports success without an AID Response element, so it is not worth changing the merge resolution.
Quoted 3 lines
If we actually observe this in practice and want to get rid of the time wasting, I guess we could add a path out that does both, but I'm not sure it's worth it.
For the record, destroy_assoc_data already does both. Since f13e573ab3f12 moved drv_mgd_complete_tx() into ieee80211_destroy_assoc_data(), that label notifies the driver before the link is torn down, then abandons. No additional path would be needed. The impact is negligible either way, so I agree it is not worth touching now.
Thanks for looking at it.
Zhao
Johannes Berg
maintainerQuoted 6 lines · Zhao Li
For the record,
destroy_assoc_dataalready does both. Sincef13e573ab3f12moveddrv_mgd_complete_tx()intoieee80211_destroy_assoc_data(), that label notifies the driver before the link is torn down, then abandons. No additional path would be needed. The impact is negligible either way, so I agree it is not worth touching now.
D'oh. Now I even remember I asked Anji to do that... Oops.
Well, it's not merged yet, so I guess I can update my suggested merge resolution and send a message...
johannes