wifi: rtw89: mcc: drop queued chanctx changes when stopping

When MCC is about to stop, there may be some chanctx changes which are
queued for work but have not yet been run. To avoid these changes from
being processed in a wrong state (e.g. next new MCC instance), cancel
the queued work and drop queued changes.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250511035217.10410-3-pkshih@realtek.com
This commit is contained in:
Zong-Zhe Yang
2025-05-11 11:52:13 +08:00
committed by Ping-Ke Shih
parent 46b6079748
commit 8ee99b998f

View File

@@ -2150,6 +2150,7 @@ static int rtw89_mcc_stop_sel_iterator(struct rtw89_dev *rtwdev,
static void rtw89_mcc_stop(struct rtw89_dev *rtwdev,
const struct rtw89_chanctx_pause_parm *pause)
{
struct rtw89_hal *hal = &rtwdev->hal;
struct rtw89_mcc_info *mcc = &rtwdev->mcc;
struct rtw89_mcc_role *ref = &mcc->role_ref;
struct rtw89_mcc_stop_sel sel = {
@@ -2157,6 +2158,11 @@ static void rtw89_mcc_stop(struct rtw89_dev *rtwdev,
};
int ret;
if (!pause) {
wiphy_delayed_work_cancel(rtwdev->hw->wiphy, &rtwdev->chanctx_work);
bitmap_zero(hal->changes, NUM_OF_RTW89_CHANCTX_CHANGES);
}
/* by default, stop at ref */
rtw89_iterate_mcc_roles(rtwdev, rtw89_mcc_stop_sel_iterator, &sel);
if (!sel.filled)