diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-05-14 19:32:13 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-15 16:48:38 -0400 |
commit | d5e32cc7c997d1d4f18031f5ff88512bd65118f7 (patch) | |
tree | c1ef1b747ba159966baa2177b519ce8c0395b9a5 /drivers/net/ethernet/broadcom/bcmsysport.c | |
parent | 5f47dfb400d6a82d5ce9cdf537e33969af8278ff (diff) | |
download | op-kernel-dev-d5e32cc7c997d1d4f18031f5ff88512bd65118f7.zip op-kernel-dev-d5e32cc7c997d1d4f18031f5ff88512bd65118f7.tar.gz |
net: systemport: only update UMAC_CMD if something changed
The link adjustment callback can be called as frequently as desired by
the PHY library, as such, let's avoid doing a Read/Modify/Write sequence
if nothing changed, which is more than likely since we are interfaced
with a switch device.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcmsysport.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bcmsysport.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index f66de13..3950364 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -959,15 +959,16 @@ static void bcm_sysport_adj_link(struct net_device *dev) if (!phydev->pause) cmd_bits |= CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE; - reg = umac_readl(priv, UMAC_CMD); - reg &= ~((CMD_SPEED_MASK << CMD_SPEED_SHIFT) | + if (changed) { + reg = umac_readl(priv, UMAC_CMD); + reg &= ~((CMD_SPEED_MASK << CMD_SPEED_SHIFT) | CMD_HD_EN | CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE); - reg |= cmd_bits; - umac_writel(priv, reg, UMAC_CMD); + reg |= cmd_bits; + umac_writel(priv, reg, UMAC_CMD); - if (changed) phy_print_status(priv->phydev); + } } static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv, |