Skip to content

Commit

Permalink
net: bcmgenet: Add 'eee' module parameter
Browse files Browse the repository at this point in the history
On some switches, having EEE enabled causes the link to become
unstable. With this patch, adding 'genet.eee=N' to the kernel command
line will cause EEE to be disabled on the link.

See: #4289

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
  • Loading branch information
pelwell authored and popcornmix committed Oct 17, 2024
1 parent d191626 commit 6b50745
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ static void bcmgenet_set_rx_mode(struct net_device *dev);
static bool skip_umac_reset = false;
module_param(skip_umac_reset, bool, 0444);
MODULE_PARM_DESC(skip_umac_reset, "Skip UMAC reset step");
static bool eee = true;
module_param(eee, bool, 0444);
MODULE_PARM_DESC(eee, "Enable EEE (default Y)");

static inline void bcmgenet_writel(u32 value, void __iomem *offset)
{
Expand Down Expand Up @@ -3430,6 +3433,17 @@ static int bcmgenet_open(struct net_device *dev)

bcmgenet_phy_pause_set(dev, priv->rx_pause, priv->tx_pause);

if (!eee) {
struct ethtool_keee eee_data;

ret = bcmgenet_get_eee(dev, &eee_data);
if (ret == 0) {
eee_data.eee_enabled = 0;
bcmgenet_set_eee(dev, &eee_data);
netdev_warn(dev, "EEE disabled\n");
}
}

bcmgenet_netif_start(dev);

netif_tx_start_all_queues(dev);
Expand Down

0 comments on commit 6b50745

Please sign in to comment.