From nobody Tue Feb 10 05:26:56 2026 Received: from mail-dy1-f169.google.com (mail-dy1-f169.google.com [74.125.82.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 917BF3A9D8A for ; Tue, 20 Jan 2026 20:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768939876; cv=none; b=L6RF318w5RW9VobLeMPY5wmijK5iFQKPJUq0fBJmP1u9Szo+2ywiIOPxvgM+gGlc75vQ1YDtBpTdQjUtHu1F0vVJBuNZVt8+0qn8HoHgpJIUpBHl3w8TBEIdyK9/8bmCWxgM8HQ2PxjvTmmxRSsj2qayhU/Z2Qff67h3q7qmbIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768939876; c=relaxed/simple; bh=RRBH0UHPVlQWfG4Wwrnkl+pIQ4TyQWXm/+2gN2alFno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I6hzbQN35oKjKA+Y/InZT+yuPZS6TOwY80cu9o+/TkjOr3s84beac53ur5YVI5+KGg3nwgG4bda35izOrWotGfndEpdaFflpwMXu7bquBj6pGvg9IRfItouqQb5AZRmk42ELuN0V6mq0eQsIQrsZEMbbkGNYRUpuq312IO0s9Jg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zacbowling.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IpmbZPfM; arc=none smtp.client-ip=74.125.82.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zacbowling.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IpmbZPfM" Received: by mail-dy1-f169.google.com with SMTP id 5a478bee46e88-2b7070acfdcso776652eec.0 for ; Tue, 20 Jan 2026 12:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768939871; x=1769544671; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=gozi34aOF6cyrG5FN8NDIhdFKRbqzfMHt5Dibx6zW+g=; b=IpmbZPfMJbTcE7N4BYmMr+toak0NrblOGnuNQxWmSU8pbjDaJY4l3SLVh/2kG6gUG4 aPGpCXnjESHDaqLpv0A2y/GMET+gAu+O7Pjw71pa7GWtrrh+MrY7iiBiQH28rOtg/4bx GKadHOhLG8FdYYgmuj/u2Vi2Fjx3f81m+kmJosgTjuE7cx95LfzIr/eOUHwMAtNPb2Qq jPcnScs6zUlWeiv996whQa74sHUhOdjkDlfAx9ZRbZpGf39fdBBelOx3SCK/+H6phiAC P3Zmq3W3CjNNMoFAs9zIdBGHv9Onq9S1efzwU9zsRLk/5zpgC5+yvZrNd0w2UljiGtIc TeyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768939871; x=1769544671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gozi34aOF6cyrG5FN8NDIhdFKRbqzfMHt5Dibx6zW+g=; b=EfpU7nHnfLffyH8X+u3jY65JFI6JyvT4+HACceh8xrYH7Li6qDnshkUbXB62jsd1Zb kXAdYIkyKtY40IxeGuhxurOdNB9zmsoIqsXgLfYK59yetkVLOIHgQicfwRQ649HRaRML 31zq1SM5t8TtpZlmRizu7zn1fQoZqglytaoLSSgTkugt/128R6EaVF0CBMyE4ln5xsEl pwiiMK1bxNBzXyfHa6tCSFARBb0tJ7aDpRp9s6vpwYK0PQhzaJWdWCvSZ2hTZlbOG8vj MAdIyn6v9OoAXNRaPuburNPkIymNfXgnm6HRofUL0vOFkArEzkBA+gyIti7Vpon9Lj+d hgdQ== X-Forwarded-Encrypted: i=1; AJvYcCXLs6B+/8GtDqaly+FxDzJ2oxbweWfBSFW4Vg72W7JBg8Sn/tabXFYXX9Lt9A78WSwdvqesa9BoNMaObz8=@vger.kernel.org X-Gm-Message-State: AOJu0Ywh1KYqhTXVDMk0RGC5H+toheULeKrlsupKE0SwVby/Lu5fLTFJ yVdIdanRzlGcJddVqp2ZOA96NMjFVTYCbhQbOLyCp3db4HGa86FY1C9a X-Gm-Gg: AZuq6aKJ6OqG9zQenaqlt/dVoDGdkbWbldAmwMaQ5zVTT2gg6pIrQSG4/bkTjAx0dny mWnhLjKYAV2i5k4OQYDooiaIXiRaKOaXxGXOEF6/FwMEG3tyj0HMLHGamAiiDc6T6/38cxokF6E YCKoLJDL9ukDfvfjCG3hgtOKE5SVs4LrNMatC9+a09syt6UpwBmxsFpoQAd83jzvVKUSqSLhn0+ 2kI1rOOYGeqLvuGhV9Uxi8FVkuqUrm968y0XA7dAkG5KB22yTH4qWrqRqQwGPfPuw1JcdSPi9aQ R3Xv0mOL2qPk+QN3Lq3c0/7TgaVZ2Uxz97Rv94kYeQyRQQZ8jaF2Z9wjlHWroHgA9HWpbUTEJaW eYGfWFwiZIfoZgA/jin950+4udu0tErQ1MNViaAT2LF6VO49K7/Xy+u2b4jpWmAzsOLDeB1Xc+/ 0nzJ8MeMUh08lbs0epNbIJOgt0Nm71lYYCQqmLbdJ6uiA4KgbxwQKu9j7InwdGxw== X-Received: by 2002:a05:693c:2d93:b0:2b0:5028:bafd with SMTP id 5a478bee46e88-2b6b46c68femr9374962eec.8.1768939870242; Tue, 20 Jan 2026 12:11:10 -0800 (PST) Received: from zcache.home.zacbowling.com ([2001:5a8:60d:bc9:4a3c:9f7c:8037:90c1]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244ad7201fsm21982990c88.7.2026.01.20.12.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 12:11:09 -0800 (PST) Sender: Zac Bowling From: Zac To: sean.wang@kernel.org Cc: deren.wu@mediatek.com, kvalo@kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org, linux@frame.work, lorenzo@kernel.org, nbd@nbd.name, ryder.lee@mediatek.com, sean.wang@mediatek.com, zac@zacbowling.com, zbowling@gmail.com Subject: [PATCH 10/13] wifi: mt76: mt7925: fix MLO roaming and ROC setup issues Date: Tue, 20 Jan 2026 12:10:40 -0800 Message-ID: <20260120201043.38225-11-zac@zacbowling.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260120201043.38225-1-zac@zacbowling.com> References: <20260120201043.38225-1-zac@zacbowling.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zac Bowling Fix two issues related to MLO roaming and remain-on-channel operations: 1. Key removal failure during MLO roaming: During MLO roaming, key removal can fail because the WCID (wireless client ID) is already cleaned up before the key removal operation completes. When roaming between APs in an MLO setup: - mac80211 triggers sta_state changes - mt7925_mac_link_sta_remove() is called for the old link - WCID is cleared via mt76_wcid_cleanup() - Later, key removal MCU command uses the now-invalid WCID Fix by checking if the WCID is still valid before sending key removal commands to firmware. If the WCID has already been cleaned up, skip the MCU command since the firmware has already removed the keys. 2. Kernel warning in MLO ROC setup: When starting a remain-on-channel operation in MLO mode, the driver passes incorrect parameters to mt7925_mcu_set_roc(), causing a kernel warning about invalid chanctx usage. Fix by checking for valid chanctx and link configuration before setting up ROC, and use the correct link_id from the vif when available. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt= 7925 device") Signed-off-by: Zac Bowling --- .../net/wireless/mediatek/mt76/mt7925/main.c | 9 ++++++++- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 20 +++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net= /wireless/mediatek/mt76/mt7925/main.c index 59a5b22a6ed6..7d68b08f445a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -609,8 +609,15 @@ static int mt7925_set_link_key(struct ieee80211_hw *hw= , enum set_key_cmd cmd, mconf =3D mt792x_vif_to_link(mvif, link_id); mlink =3D mt792x_sta_to_link(msta, link_id); =20 - if (!link_conf || !mconf || !mlink) + if (!link_conf || !mconf || !mlink) { + /* During MLO roaming, link state may be torn down before + * mac80211 requests key removal. If removing a key and + * the link is already gone, consider it successfully removed. + */ + if (cmd !=3D SET_KEY) + return 0; return -EINVAL; + } =20 wcid =3D &mlink->wcid; wcid_keyidx =3D &wcid->hw_key_idx; diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/= wireless/mediatek/mt76/mt7925/mcu.c index 1c58b0be2be4..6f7fc1b9a440 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1342,15 +1342,23 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *= mconf, u16 sel_links, for (i =3D 0; i < ARRAY_SIZE(links); i++) { links[i].id =3D i ? __ffs(~BIT(mconf->link_id) & sel_links) : mconf->link_id; + link_conf =3D mt792x_vif_to_bss_conf(vif, links[i].id); - if (WARN_ON_ONCE(!link_conf)) - return -EPERM; + if (!link_conf) + return -ENOLINK; =20 links[i].chan =3D link_conf->chanreq.oper.chan; - if (WARN_ON_ONCE(!links[i].chan)) - return -EPERM; + if (!links[i].chan) + /* Channel not configured yet - this can happen during + * MLO AP setup when links are being added sequentially. + * Return -ENOLINK to indicate link not ready. + */ + return -ENOLINK; =20 links[i].mconf =3D mt792x_vif_to_link(mvif, links[i].id); + if (!links[i].mconf) + return -ENOLINK; + links[i].tag =3D links[i].id =3D=3D mconf->link_id ? UNI_ROC_ACQUIRE : UNI_ROC_SUB_LINK; =20 @@ -1364,8 +1372,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mc= onf, u16 sel_links, type =3D MT7925_ROC_REQ_JOIN; =20 for (i =3D 0; i < ARRAY_SIZE(links) && i < hweight16(vif->active_links); = i++) { - if (WARN_ON_ONCE(!links[i].mconf || !links[i].chan)) - continue; + if (!links[i].mconf || !links[i].chan) + return -ENOLINK; =20 chan =3D links[i].chan; center_ch =3D ieee80211_frequency_to_channel(chan->center_freq); --=20 2.52.0