Commit 5b0ab2f4 authored by Yan Markman's avatar Yan Markman Committed by David S. Miller

net: mvpp2: set mac address does not require the stop/start sequence

Remove special stop/start handling from the set_mac_address callback.
All this special care is not needed, and can be removed. It also
simplifies the up/down status in the driver and helps avoiding possible
link status mismatch issues.
Signed-off-by: default avatarYan Markman <ymarkman@marvell.com>
[Antoine: commit message]
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 914365f1
...@@ -7357,42 +7357,18 @@ static void mvpp2_set_rx_mode(struct net_device *dev) ...@@ -7357,42 +7357,18 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
static int mvpp2_set_mac_address(struct net_device *dev, void *p) static int mvpp2_set_mac_address(struct net_device *dev, void *p)
{ {
struct mvpp2_port *port = netdev_priv(dev);
const struct sockaddr *addr = p; const struct sockaddr *addr = p;
int err; int err;
if (!is_valid_ether_addr(addr->sa_data)) { if (!is_valid_ether_addr(addr->sa_data))
err = -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
goto log_error;
}
if (!netif_running(dev)) {
err = mvpp2_prs_update_mac_da(dev, addr->sa_data);
if (!err)
return 0;
/* Reconfigure parser to accept the original MAC address */
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr);
if (err)
goto log_error;
}
mvpp2_stop_dev(port);
err = mvpp2_prs_update_mac_da(dev, addr->sa_data); err = mvpp2_prs_update_mac_da(dev, addr->sa_data);
if (!err) if (err) {
goto out_start; /* Reconfigure parser accept the original MAC address */
mvpp2_prs_update_mac_da(dev, dev->dev_addr);
/* Reconfigure parser accept the original MAC address */ netdev_err(dev, "failed to change MAC address\n");
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr); }
if (err)
goto log_error;
out_start:
mvpp2_start_dev(port);
mvpp2_egress_enable(port);
mvpp2_ingress_enable(port);
return 0;
log_error:
netdev_err(dev, "failed to change MAC address\n");
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment