From nobody Mon Feb 9 08:56:14 2026 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (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 38A3F38A704 for ; Tue, 20 Jan 2026 06:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768890552; cv=none; b=nKhGsiTcewCT2T6o5cgSidHRiAEhFTd0Zb/0Vm0PRLs20FDQ0D1hDiQr1uSiB8e2SZShIP0ANbxRx3+pytl7DnPBS5gEwIuLcU1tfOroJLItZj+e0WAJbB3dtuBw/4Ip1xaA2ygOiqqksJC8o5+dVOIc1f7zrIL7vhuLN5Ac3sI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768890552; c=relaxed/simple; bh=dRjFX1OxFoMErBW1Lic/dK0shEoukUCq8IytKXd5DYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nn5EGPV9+tRqA5fRs9598w2caBHgQI2L8sPithdS37mq/JPSviY2FUodsVwPEijylILvfRVaq7REOnLP0hy65gLbRtKvYr585YspGZd0mdhJ01jtYt3DYDBca5YRyX7/OVM9D01Lh9xQM41SGzWENjKuByxdDuk8BNL0qejgCGQ= 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=kHdzzFO9; arc=none smtp.client-ip=74.125.82.42 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="kHdzzFO9" Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-12460a7caa2so2243970c88.1 for ; Mon, 19 Jan 2026 22:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768890549; x=1769495349; 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=PemvynWJoEEr+vQfljTmIKiSnjimqG0bkRw68R0p5Rk=; b=kHdzzFO9h53qM9g7OK1vcSJPsRgw62MNHNEvolRc2mzPawGJmjeGwtVZX87r3ZrTW9 QW+qOh1MdJr7iRjJ9FjgYR+XOm+LBMG+yhjT97QjGBzCz+py7md/iIkyXdk1HMJOrX+4 cPKulZeWScSOEitdViakDIJ5nEI0iVJUMBvqHCeL8SXCKSazNlk6suT7SNUo4oJwNZwh NtAoUd40FZX3fLXXfJ40t4YquCxEP5RkBRwSAEuP++bAnsJ9o2BzCEtNYQPZkAQXDhY0 jg64vH8WdF3yeXNi2XmcuUsZxQ0Zxq1qVWW999Ro9RktAaTIPuhIfrZ+FqevFmhxrhUn uBug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768890549; x=1769495349; 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=PemvynWJoEEr+vQfljTmIKiSnjimqG0bkRw68R0p5Rk=; b=XphysEeOr0aE997gVrasck/1tMpyLGnP1dSwFXumYS/qYU1dwds+7uNq9iUo13UG3Z 9S8TzkhNqxfaG+YY3RsXt4AWfzFf6ayAOSjEIdSfsjHhk89V6ksrUPtRSCpsTy0Q1xIl gK1d1Q5Se/btHkezZa5lOUl5S2T7UUbhN9TlGDNzg4D+dFi3bgS0+azE6hLyMHVeTsjY o7IkiOLUUjm1o3H9RCzH3sz8itGOIoFRBSTdG5QSgXLO0doPeubobzVUOsxsCrCqeE8j AWd5yZkLKx7Gz/xsrb3IdytqgBERBex5SvkGjNsT/7xmmhlCUh9TLN8OPpHi4YQATL6n FAmA== X-Forwarded-Encrypted: i=1; AJvYcCWU64K+XwGnQci2t6iJwbmgjWvRhsqdPVUXupxS/cqXba/l85UN1fhA5SquNf/6foQYf++UR3BKIHKJra8=@vger.kernel.org X-Gm-Message-State: AOJu0YxL4L323IqxiVB/M9z/2Uj65PI+/pXFjVd17QhOaYQuJRDj8Tq2 5aum4pjhVhKgUK0NaVY2a0B634C7PRhhy+tbShpl6yG5JHpS3QRyJS89 X-Gm-Gg: AZuq6aKBfylcbS6bJweJRONGZcLs4eF7I0q5MQ4DswgVKKUUMvqaEZsMYYkaQmYpR6j oTnOJfd4nSJA1dedGbH9dyi7GNHSKSCnscOlz5vgiuIMRKvtD76FkRj2FIb4LJ+5kasT1jcHiIb L8bY7fNA9giu/B1Q8/KtNAK10Puku71yXij3OoS7KoGKz3OSWbmJ0kbeO2jmMQfR0Ewufs/lk3c VdlqnMIAFqwCVEYxZFWey6D352PH9nQcVItjicCeseW+ABOBDFPuiDVQcKYOWUlx8r1f3JTZfQZ DzpkFV9ceO6ymvgLaxwrVjSYRbQmLedoU0gs8QP7hssaTFVPrhqXdARie4NQA0wJR2Lbah6Rso6 sbzS+3LyCM1p6Nywpet50HgX4cXnjg3eW14xRqG1hNW93MBskq+Kbl6Mwh0e6uNFnktz/8t5+OU +rDwGdGXbrZRXxvUcJFEXMmRBVLL+GXZ1r6TkSghsLyW0rfQj6QIYjiS0r3I0b X-Received: by 2002:a05:693c:4096:b0:2b7:108:40a4 with SMTP id 5a478bee46e88-2b701084a6bmr223705eec.14.1768890549004; Mon, 19 Jan 2026 22:29:09 -0800 (PST) Received: from zcache.home.zacbowling.com ([2001:5a8:60d:bc9:f31e:1cb:296a:cc2a]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b6b3502c91sm15706784eec.9.2026.01.19.22.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jan 2026 22:29:08 -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, lorenzo@kernel.org, nbd@nbd.name, ryder.lee@mediatek.com, sean.wang@mediatek.com, stable@vger.kernel.org, linux@frame.work, zbowling@gmail.com, Zac Bowling Subject: [PATCH 09/11] wifi: mt76: mt7925: fix MLO roaming and ROC setup issues Date: Mon, 19 Jan 2026 22:28:52 -0800 Message-ID: <20260120062854.126501-10-zac@zacbowling.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260120062854.126501-1-zac@zacbowling.com> References: <20260120062854.126501-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 5f8a28d5ff72..81373e479abd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -605,8 +605,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