Skip to content

Commit 44ff9da

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: mac80211: only assign chanctx in reconfig
At the end of reconfig we are activating all the links that were active before the error. During the activation, _ieee80211_link_use_channel will unassign and re-assign the chanctx from/to the link. But we only need to do the assign, as we are re-building the state as it was before the reconfig. Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250709233537.6245c3ae7031.Ia5f68992c7c112bea8a426c9339f50c88be3a9ca@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 2813d22 commit 44ff9da

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/mac80211/chan.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
910910
conf = rcu_dereference_protected(link->conf->chanctx_conf,
911911
lockdep_is_held(&local->hw.wiphy->mtx));
912912

913-
if (conf) {
913+
if (conf && !local->in_reconfig) {
914914
curr_ctx = container_of(conf, struct ieee80211_chanctx, conf);
915915

916916
drv_unassign_vif_chanctx(local, sdata, link->conf, curr_ctx);
@@ -930,8 +930,9 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
930930

931931
/* succeeded, so commit it to the data structures */
932932
conf = &new_ctx->conf;
933-
list_add(&link->assigned_chanctx_list,
934-
&new_ctx->assigned_links);
933+
if (!local->in_reconfig)
934+
list_add(&link->assigned_chanctx_list,
935+
&new_ctx->assigned_links);
935936
}
936937
} else {
937938
ret = 0;
@@ -1932,7 +1933,8 @@ int _ieee80211_link_use_channel(struct ieee80211_link_data *link,
19321933
if (ret < 0)
19331934
goto out;
19341935

1935-
__ieee80211_link_release_channel(link, false);
1936+
if (!local->in_reconfig)
1937+
__ieee80211_link_release_channel(link, false);
19361938

19371939
ctx = ieee80211_find_chanctx(local, link, chanreq, mode);
19381940
/* Note: context is now reserved */

0 commit comments

Comments
 (0)