Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5e32cc7 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f47dfb4
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -959,6 +959,7 @@ static void bcm_sysport_adj_link(struct net_device *dev)
	if (!phydev->pause)
		cmd_bits |= CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE;

	if (changed) {
		reg = umac_readl(priv, UMAC_CMD);
		reg &= ~((CMD_SPEED_MASK << CMD_SPEED_SHIFT) |
			CMD_HD_EN | CMD_RX_PAUSE_IGNORE |
@@ -966,9 +967,9 @@ static void bcm_sysport_adj_link(struct net_device *dev)
		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,
				    unsigned int index)