From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH mt76-next 07/17] wifi: mt76: mt7925: abort a ROC on the BSS that requested it
Date: Sat, 21 Nov 2026 13:09:16 +0100 [thread overview]
Message-ID: <20261121120926.3603979-7-nbd@nbd.name> (raw)
In-Reply-To: <20261121120926.3603979-1-nbd@nbd.name>
mt7925_start_ap() requests the channel on the BSS of the link that it
starts. mt7925_roc_work() aborts an expired request only on the default
BSS of each running interface. If the request of a non-default link of
an AP MLD expires before mt7925_start_ap() aborts it, the firmware gets
no abort for that BSS. The comment in mt7925_start_ap() notes that the
firmware then asserts.
Record the BSS of each request, and abort on it as well.
This is currently not reachable, because mt7925_change_vif_links()
fails the second ADD_LINK of an AP MLD. Found by inspection.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 16 +++++++++-------
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index b78823e161ee..ec4f3db23c07 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -547,10 +547,9 @@ static void mt7925_roc_iter(void *priv, u8 *mac,
*bss_mask |= BIT_ULL(mvif->bss_conf.mt76.idx);
}
-static void mt7925_roc_abort_all(struct mt792x_phy *phy, u8 token)
+static void mt7925_roc_abort_all(struct mt792x_phy *phy, u8 token, u8 bss_idx)
{
- u64 bss_mask = 0;
- u8 bss_idx;
+ u64 bss_mask = BIT_ULL(bss_idx);
ieee80211_iterate_active_interfaces_atomic(phy->mt76->hw,
IEEE80211_IFACE_ITER_RESUME_ALL,
@@ -574,19 +573,20 @@ void mt7925_roc_abort_sync(struct mt792x_dev *dev)
cancel_work(&phy->roc_work);
- mt7925_roc_abort_all(phy, phy->roc_token_id);
+ mt7925_roc_abort_all(phy, phy->roc_token_id, phy->roc_bss_idx);
}
EXPORT_SYMBOL_GPL(mt7925_roc_abort_sync);
void mt7925_roc_work(struct work_struct *work)
{
struct mt792x_phy *phy;
- u8 token;
+ u8 token, bss_idx;
phy = (struct mt792x_phy *)container_of(work, struct mt792x_phy,
roc_work);
token = phy->roc_token_id;
+ bss_idx = phy->roc_bss_idx;
if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
return;
@@ -595,7 +595,7 @@ void mt7925_roc_work(struct work_struct *work)
ieee80211_remain_on_channel_expired(phy->mt76->hw);
mt792x_mutex_acquire(phy->dev);
- mt7925_roc_abort_all(phy, token);
+ mt7925_roc_abort_all(phy, token, bss_idx);
mt792x_mutex_release(phy->dev);
}
@@ -631,7 +631,7 @@ static void mt7925_roc_stale_reclaim(struct mt792x_phy *phy)
if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
return;
- mt7925_roc_abort_all(phy, token);
+ mt7925_roc_abort_all(phy, token, phy->roc_bss_idx);
if (phy->roc_notify)
ieee80211_remain_on_channel_expired(phy->mt76->hw);
@@ -652,6 +652,7 @@ static int mt7925_set_roc(struct mt792x_phy *phy,
return -EBUSY;
token = ++phy->roc_token_id;
+ phy->roc_bss_idx = mconf->mt76.idx;
phy->roc_grant = false;
phy->roc_notify = type == MT7925_ROC_REQ_ROC;
@@ -683,6 +684,7 @@ static int mt7925_set_mlo_roc(struct mt792x_phy *phy,
return -EBUSY;
token = ++phy->roc_token_id;
+ phy->roc_bss_idx = mconf->mt76.idx;
phy->roc_grant = false;
phy->roc_notify = false;
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index 3604f02a5376..07c5e67db8cd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -305,6 +305,7 @@ struct mt792x_phy {
u8 roc_token_id;
bool roc_grant;
bool roc_notify; /* mac80211 expects the expiry of this ROC */
+ u8 roc_bss_idx;
};
struct mt792x_irq_map {
--
2.47.3
next prev parent reply other threads:[~2026-11-21 12:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 12:09 [PATCH mt76-next 01/17] wifi: mt76: mt7996: name a new secondary link to the firmware first Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 02/17] wifi: mt76: add a helper to point the TXQs of a station at a wcid Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 03/17] wifi: mt76: mt7925: move the default link to a remaining link Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 04/17] wifi: mt76: mt7925: keep the deflink wcid index until station removal Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 05/17] wifi: mt76: mt792x: look up the TX links under RCU Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 06/17] wifi: mt76: mt7925: read the links under RCU in the IPv6 notifier Felix Fietkau
2026-11-21 12:09 ` Felix Fietkau [this message]
2026-11-21 12:09 ` [PATCH mt76-next 08/17] wifi: mt76: mt7925: take the link conf of a removed link from old[] Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 09/17] wifi: mt76: mt7925: send the MLO ROC only for a station vif Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 10/17] wifi: mt76: mt7996: send the Beacon rate table again after a full reset Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 11/17] wifi: mt76: mt7996: restore the operating channel after an L1 SER Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 12/17] wifi: mt76: reset the DFS state of a phy at a full reset Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 13/17] wifi: mt76: mt7996: abort a background CAC " Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 14/17] wifi: mt76: mt7915: " Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 15/17] wifi: mt76: mt7996: clear the airtime counts with the WTBL counters Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 16/17] wifi: mt76: mt7996: drop the host WTBL write of a fixed GI Felix Fietkau
2026-11-21 12:09 ` [PATCH mt76-next 17/17] wifi: mt76: mt7925: don't reset the USB device on probe Felix Fietkau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261121120926.3603979-7-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox