Commit ce830500 authored by Doug Berger's avatar Doug Berger Committed by sanglipeng1
Browse files

net: bcmgenet: synchronize use of bcmgenet_set_rx_mode()

stable inclusion
from stable-v5.10.217
commit f6c807e8538cc106cceaea393d4d0fa905f666ce
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAWLXC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f6c807e8538cc106cceaea393d4d0fa905f666ce



--------------------------------

commit 2dbe5f19368caae63b1f59f5bc2af78c7d522b3a upstream.

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: 72f96347 ("net: bcmgenet: set Rx mode before starting netif")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
Acked-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng1 <sanglipeng1@jd.com>
parent 2076b510
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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
@@ -3310,7 +3310,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);