From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 049014FD78A; Wed, 30 Sep 2026 15:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790783499; cv=none; b=p4Xo1gjZAoy0F8+hoot60+le8iVHPNy4TY0CbETV8ik6DaDP/q5LvqwCMKftDTSu+/KrQp2/Z00Bs9Ume/XStShQsH8gkfd719OsSlKgkve+TSLQgwYSzdFJzP8tXJP2hxn7dn2+fa8NPgRrmObqKhE5EbUkPUf2ccB9hvpvJQM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790783499; c=relaxed/simple; bh=p4JLyx3xe5X1Ew4H69lNTcWx5ozVxsNY0zmP8xkobvA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F3hwOuJSvPSCliY+JXVm4ue/SgHRT9wsHEZTFjC+kW9qTBjyk0533NThe5H8EPa3ylh5RadVHFKOjybY5RRhCKFsDui0LSRlyfuBqbiDMeyKbWDNza+iKIpwrIxGIrtWHdSXso36s98X2wAnpRjn1a44DB+1GnzqNwg86bgMzQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sokJnWyw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sokJnWyw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D321A1F000FF; Wed, 30 Sep 2026 15:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790783492; bh=HIYmD2bg+r5TYrnk9XKN3cpIcKQ3If7lRKhckGuTP0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sokJnWywFMCV8cx+pxq6A+Tw8i5i3Ub+/STUi8L5DIQQzIFgS/JfNsaQEw/bOHSGZ nJP9RLNfi5SLSPRQdaldRg4hW++vKm/jHgJTkuO2+H7niyD36ok+d78CKG2xuLKxW/ TJKskr1ZStgjBb+PwCTEjTdlqZwmHUkjaescjlJw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karl Mehltretter , Arend van Spriel , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 401/595] wifi: brcmfmac: fix lost 802.1x TX completion wakeup Date: Wed, 30 Sep 2026 17:24:54 +0200 Message-ID: <20260930152356.298033793@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152347.700140858@linuxfoundation.org> References: <20260930152347.700140858@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karl Mehltretter [ Upstream commit 621d90169cef6c8da5b6134db5c0c4e23cdd09ce ] brcmf_txfinalize() decrements pend_8021x_cnt before a lockless waitqueue_active() check. atomic_dec() does not order the decrement against the check. The waiter can therefore observe a nonzero count while the waker observes an empty queue, losing the final wakeup and delaying key installation until the 950 ms timeout. Add smp_mb__after_atomic() to order the decrement before the queue check. wait_event_timeout() provides the matching barrier. LKMM confirms that this forbids the lost-wakeup outcome. Fixes: 21fff75d2fb6 ("brcmfmac: use wait_event_timeout for 8021x pending count") Assisted-by: Claude:claude-fable-5 Signed-off-by: Karl Mehltretter Acked-by: Arend van Spriel Link: https://patch.msgid.link/20260811082702.44521-1-kmehltretter@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index e33f9edceb5f0..b763495317f6c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -555,6 +555,8 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) if (type == ETH_P_PAE) { atomic_dec(&ifp->pend_8021x_cnt); + /* Order the decrement before waitqueue_active() */ + smp_mb__after_atomic(); if (waitqueue_active(&ifp->pend_8021x_wait)) wake_up(&ifp->pend_8021x_wait); } -- 2.53.0