Linux wireless drivers development
 help / color / mirror / Atom feed
From: Keisuke Tsukuda <tkdkei@outlook.jp>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "arend.vanspriel@broadcom.com" <arend.vanspriel@broadcom.com>,
	"brcm80211@lists.linux.dev" <brcm80211@lists.linux.dev>,
	"brcm80211-dev-list.pdl@broadcom.com"
	<brcm80211-dev-list.pdl@broadcom.com>,
	Keisuke Tsukuda <tkdkei@outlook.jp>
Subject: [PATCH wireless] wifi: brcmfmac: fix allmulti fallback when mcast_list is rejected
Date: Fri, 27 Nov 2026 15:04:26 +0000	[thread overview]
Message-ID: <20261127150422.64483-1-tkdkei@outlook.jp> (raw)

_brcmf_set_multicast_list() uses cnt as both the multicast address count
and the number of addresses left to copy into mcast_list. After a
complete copy, cnt is zero. If the firmware then rejects the nonempty
list, the error path checks this exhausted counter and fails to enable
allmulti as a fallback. Multicast traffic for some joined groups can
then be lost.

Keep the original count for the fallback decision. A rejected empty
list still leaves allmulti unchanged.

On a Raspberry Pi CM4 (BCM4345/6 SDIO, firmware 7.45.265) running
Ubuntu 7.0.0-1023-raspi, the driver reported -EBADE for a 33-address
mcast_list update. The last joined group received 0/3 packets with the
original module and 3/3 with the patched module, although the list
update still failed. The first group received 3/3 in both runs, with
IFF_ALLMULTI clear.

Fixes: cf2b448852ab ("staging: brcm80211: add fullmac driver")
Signed-off-by: Keisuke Tsukuda <tkdkei@outlook.jp>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index a3d6623487115..d24725b7b6de9 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -142,7 +142,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	struct brcmf_pub *drvr = ifp->drvr;
 	struct net_device *ndev;
 	struct netdev_hw_addr *ha;
-	u32 cmd_value, cnt;
+	u32 cmd_value, cnt, mc_count;
 	__le32 cnt_le;
 	char *buf, *bufp;
 	u32 buflen;
@@ -156,7 +156,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	cmd_value = (ndev->flags & IFF_ALLMULTI) ? true : false;
 
 	/* Send down the multicast list first. */
-	cnt = netdev_mc_count(ndev);
+	mc_count = netdev_mc_count(ndev);
+	cnt = mc_count;
 	buflen = sizeof(cnt) + (cnt * ETH_ALEN);
 	buf = kmalloc(buflen, GFP_KERNEL);
 	if (!buf)
@@ -178,7 +179,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	err = brcmf_fil_iovar_data_set(ifp, "mcast_list", buf, buflen);
 	if (err < 0) {
 		bphy_err(drvr, "Setting mcast_list failed, %d\n", err);
-		cmd_value = cnt ? true : cmd_value;
+		cmd_value = mc_count ? true : cmd_value;
 	}
 
 	kfree(buf);
-- 
2.50.1 (Apple Git-155)


                 reply	other threads:[~2026-11-27 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261127150422.64483-1-tkdkei@outlook.jp \
    --to=tkdkei@outlook.jp \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --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