1 From d69cdb1cc4e3f717f63910cb2c40ca26f912ea34 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Wed, 14 Dec 2022 15:00:51 +0000
4 Subject: [PATCH] net: bcmgenet: Add 'eee' module parameter
6 On some switches, having EEE enabled causes the link to become
7 unstable. With this patch, adding 'genet.eee=N' to the kernel command
8 line will cause EEE to be disabled on the link.
10 See: https://github.com/raspberrypi/linux/issues/4289
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 14 ++++++++++++++
15 1 file changed, 14 insertions(+)
17 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
18 +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
19 @@ -70,6 +70,9 @@ static void bcmgenet_set_rx_mode(struct
20 static bool skip_umac_reset = false;
21 module_param(skip_umac_reset, bool, 0444);
22 MODULE_PARM_DESC(skip_umac_reset, "Skip UMAC reset step");
23 +static bool eee = true;
24 +module_param(eee, bool, 0444);
25 +MODULE_PARM_DESC(eee, "Enable EEE (default Y)");
27 static inline void bcmgenet_writel(u32 value, void __iomem *offset)
29 @@ -3441,6 +3444,17 @@ static int bcmgenet_open(struct net_devi
31 bcmgenet_phy_pause_set(dev, priv->rx_pause, priv->tx_pause);
34 + struct ethtool_eee eee_data;
36 + ret = bcmgenet_get_eee(dev, &eee_data);
38 + eee_data.eee_enabled = 0;
39 + bcmgenet_set_eee(dev, &eee_data);
40 + netdev_warn(dev, "EEE disabled\n");
44 bcmgenet_netif_start(dev);
46 netif_tx_start_all_queues(dev);