]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: only assign chanctx in reconfig
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 9 Jul 2025 20:37:59 +0000 (23:37 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 15 Jul 2025 09:00:39 +0000 (11:00 +0200)
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 <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250709233537.6245c3ae7031.Ia5f68992c7c112bea8a426c9339f50c88be3a9ca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/chan.c

index 73a590598934cc9cf2976656266292d0e3a34054..c9cea0e7ac169839f883f73186b575eacfe55db5 100644 (file)
@@ -910,7 +910,7 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
        conf = rcu_dereference_protected(link->conf->chanctx_conf,
                                         lockdep_is_held(&local->hw.wiphy->mtx));
 
-       if (conf) {
+       if (conf && !local->in_reconfig) {
                curr_ctx = container_of(conf, struct ieee80211_chanctx, conf);
 
                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,
 
                        /* succeeded, so commit it to the data structures */
                        conf = &new_ctx->conf;
-                       list_add(&link->assigned_chanctx_list,
-                                &new_ctx->assigned_links);
+                       if (!local->in_reconfig)
+                               list_add(&link->assigned_chanctx_list,
+                                        &new_ctx->assigned_links);
                }
        } else {
                ret = 0;
@@ -1932,7 +1933,8 @@ int _ieee80211_link_use_channel(struct ieee80211_link_data *link,
        if (ret < 0)
                goto out;
 
-       __ieee80211_link_release_channel(link, false);
+       if (!local->in_reconfig)
+               __ieee80211_link_release_channel(link, false);
 
        ctx = ieee80211_find_chanctx(local, link, chanreq, mode);
        /* Note: context is now reserved */