All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Berger <opendmb@gmail.com>
To: netdev@vger.kernel.org
Cc: Doug Berger <opendmb@gmail.com>, stable@vger.kernel.org
Subject: [PATCH 2/3] net: bcmgenet: synchronize use of bcmgenet_set_rx_mode()
Date: Thu, 25 Apr 2024 15:10:06 -0700	[thread overview]
Message-ID: <20240425221007.2140041-3-opendmb@gmail.com> (raw)
In-Reply-To: <20240425221007.2140041-1-opendmb@gmail.com>

The ndo_set_rx_mode function is synchronized with the
netif_addr_lock spinlock and BHs disabled. Since this
function is also invoked directly from the driver the
same synchronization should be applied.

Fixes: 72f96347628e ("net: bcmgenet: set Rx mode before starting netif")
Cc: stable@vger.kernel.org
Signed-off-by: Doug Berger <opendmb@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index b1f84b37032a..5452b7dc6e6a 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2,7 +2,7 @@
 /*
  * Broadcom GENET (Gigabit Ethernet) controller driver
  *
- * Copyright (c) 2014-2020 Broadcom
+ * Copyright (c) 2014-2024 Broadcom
  */
 
 #define pr_fmt(fmt)				"bcmgenet: " fmt
@@ -3334,7 +3334,9 @@ static void bcmgenet_netif_start(struct net_device *dev)
 	struct bcmgenet_priv *priv = netdev_priv(dev);
 
 	/* Start the network engine */
+	netif_addr_lock_bh(dev);
 	bcmgenet_set_rx_mode(dev);
+	netif_addr_unlock_bh(dev);
 	bcmgenet_enable_rx_napi(priv);
 
 	umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true);
-- 
2.34.1


  parent reply	other threads:[~2024-04-25 22:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 22:10 [PATCH 0/3] net: bcmgenet: protect contended accesses Doug Berger
2024-04-25 22:10 ` [PATCH 1/3] net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL access Doug Berger
2024-04-27 14:16   ` Simon Horman
2024-04-25 22:10 ` Doug Berger [this message]
2024-04-27 14:16   ` [PATCH 2/3] net: bcmgenet: synchronize use of bcmgenet_set_rx_mode() Simon Horman
2024-04-25 22:10 ` [PATCH 3/3] net: bcmgenet: synchronize UMAC_CMD access Doug Berger
2024-04-27 14:16   ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2024-04-25 22:06 [PATCH 0/3] net: bcmgenet: protect contended accesses Doug Berger
2024-04-25 22:06 ` [PATCH 2/3] net: bcmgenet: synchronize use of bcmgenet_set_rx_mode() Doug Berger

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=20240425221007.2140041-3-opendmb@gmail.com \
    --to=opendmb@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.