diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2020-06-26 21:17:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-29 17:06:19 -0700 |
commit | 3d0fda901c058844bcd72bc6098c6c86884d1877 (patch) | |
tree | 0a57e886bce8d0563696055244d1a537ee07a57e /drivers/net/ethernet/ti/am65-cpsw-ethtool.c | |
parent | 7d58d3ebe445699b610ccc5df432dcef84eb4374 (diff) | |
download | linux-3d0fda901c058844bcd72bc6098c6c86884d1877.tar.gz linux-3d0fda901c058844bcd72bc6098c6c86884d1877.tar.bz2 linux-3d0fda901c058844bcd72bc6098c6c86884d1877.zip |
net: ethernet: ti: am65-cpsw-ethtool: configured critical setting only when no running netdevs
Ensure that critical setting can only be configured when there are no
running netdevs - all ports are down.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/am65-cpsw-ethtool.c')
-rw-r--r-- | drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c index f7b33875a385..496dafb25128 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c +++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c @@ -445,7 +445,7 @@ static int am65_cpsw_set_channels(struct net_device *ndev, /* Check if interface is up. Can change the num queues when * the interface is down. */ - if (netif_running(ndev)) + if (common->usage_count) return -EBUSY; am65_cpsw_nuss_remove_tx_chns(common); @@ -734,6 +734,9 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags) rrobin = !!(flags & AM65_CPSW_PRIV_P0_RX_PTYPE_RROBIN); + if (common->usage_count) + return -EBUSY; + if (common->est_enabled && rrobin) { netdev_err(ndev, "p0-rx-ptype-rrobin flag conflicts with QOS\n"); |