diff options
author | David S. Miller <davem@davemloft.net> | 2016-03-14 15:48:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-14 15:48:53 -0400 |
commit | d98654a7f314026323df8a50cd9354071f98ac8d (patch) | |
tree | 0b7e23aebc703fe881aefafb3c4b32c1e7e3813a | |
parent | 8626c56c8279b88b91b8df55345cdf89542d5e90 (diff) | |
parent | a3703fb31a4779e5c515f51f602dda1ffcfbfec9 (diff) |
Merge branch 'mvneta-fixes'
Gregory CLEMENT says:
====================
Few mvneta fixes
In this second version I split the last patch in two parts as
requested.
For the record the initial cover letter was:
"here is a patch set of few fixes. Without the first one, a kernel
configured with debug features ended to hang when the driver is built
as a module and is removed. This is quite is annoying for debugging!
The second patch fix a forgotten flag at the initial submission of the
driver.
The third patch is only really a cosmetic one so I have no problem to
not apply it for 4.5 and wait for 4.6.
I really would like to see the first one applied for 4.5 and for the
second I let you judge if it something needed for now or that should
wait the next release."
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index be92668faf3e..577f7ca7deba 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -1107,14 +1107,14 @@ static void mvneta_port_down(struct mvneta_port *pp) | |||
1107 | do { | 1107 | do { |
1108 | if (count++ >= MVNETA_RX_DISABLE_TIMEOUT_MSEC) { | 1108 | if (count++ >= MVNETA_RX_DISABLE_TIMEOUT_MSEC) { |
1109 | netdev_warn(pp->dev, | 1109 | netdev_warn(pp->dev, |
1110 | "TIMEOUT for RX stopped ! rx_queue_cmd: 0x08%x\n", | 1110 | "TIMEOUT for RX stopped ! rx_queue_cmd: 0x%08x\n", |
1111 | val); | 1111 | val); |
1112 | break; | 1112 | break; |
1113 | } | 1113 | } |
1114 | mdelay(1); | 1114 | mdelay(1); |
1115 | 1115 | ||
1116 | val = mvreg_read(pp, MVNETA_RXQ_CMD); | 1116 | val = mvreg_read(pp, MVNETA_RXQ_CMD); |
1117 | } while (val & 0xff); | 1117 | } while (val & MVNETA_RXQ_ENABLE_MASK); |
1118 | 1118 | ||
1119 | /* Stop Tx port activity. Check port Tx activity. Issue stop | 1119 | /* Stop Tx port activity. Check port Tx activity. Issue stop |
1120 | * command for active channels only | 1120 | * command for active channels only |
@@ -1139,14 +1139,14 @@ static void mvneta_port_down(struct mvneta_port *pp) | |||
1139 | /* Check TX Command reg that all Txqs are stopped */ | 1139 | /* Check TX Command reg that all Txqs are stopped */ |
1140 | val = mvreg_read(pp, MVNETA_TXQ_CMD); | 1140 | val = mvreg_read(pp, MVNETA_TXQ_CMD); |
1141 | 1141 | ||
1142 | } while (val & 0xff); | 1142 | } while (val & MVNETA_TXQ_ENABLE_MASK); |
1143 | 1143 | ||
1144 | /* Double check to verify that TX FIFO is empty */ | 1144 | /* Double check to verify that TX FIFO is empty */ |
1145 | count = 0; | 1145 | count = 0; |
1146 | do { | 1146 | do { |
1147 | if (count++ >= MVNETA_TX_FIFO_EMPTY_TIMEOUT) { | 1147 | if (count++ >= MVNETA_TX_FIFO_EMPTY_TIMEOUT) { |
1148 | netdev_warn(pp->dev, | 1148 | netdev_warn(pp->dev, |
1149 | "TX FIFO empty timeout status=0x08%x\n", | 1149 | "TX FIFO empty timeout status=0x%08x\n", |
1150 | val); | 1150 | val); |
1151 | break; | 1151 | break; |
1152 | } | 1152 | } |
@@ -3480,17 +3480,17 @@ static int mvneta_stop(struct net_device *dev) | |||
3480 | struct mvneta_port *pp = netdev_priv(dev); | 3480 | struct mvneta_port *pp = netdev_priv(dev); |
3481 | 3481 | ||
3482 | /* Inform that we are stopping so we don't want to setup the | 3482 | /* Inform that we are stopping so we don't want to setup the |
3483 | * driver for new CPUs in the notifiers | 3483 | * driver for new CPUs in the notifiers. The code of the |
3484 | * notifier for CPU online is protected by the same spinlock, | ||
3485 | * so when we get the lock, the notifer work is done. | ||
3484 | */ | 3486 | */ |
3485 | spin_lock(&pp->lock); | 3487 | spin_lock(&pp->lock); |
3486 | pp->is_stopped = true; | 3488 | pp->is_stopped = true; |
3489 | spin_unlock(&pp->lock); | ||
3490 | |||
3487 | mvneta_stop_dev(pp); | 3491 | mvneta_stop_dev(pp); |
3488 | mvneta_mdio_remove(pp); | 3492 | mvneta_mdio_remove(pp); |
3489 | unregister_cpu_notifier(&pp->cpu_notifier); | 3493 | unregister_cpu_notifier(&pp->cpu_notifier); |
3490 | /* Now that the notifier are unregistered, we can release le | ||
3491 | * lock | ||
3492 | */ | ||
3493 | spin_unlock(&pp->lock); | ||
3494 | on_each_cpu(mvneta_percpu_disable, pp, true); | 3494 | on_each_cpu(mvneta_percpu_disable, pp, true); |
3495 | free_percpu_irq(dev->irq, pp->ports); | 3495 | free_percpu_irq(dev->irq, pp->ports); |
3496 | mvneta_cleanup_rxqs(pp); | 3496 | mvneta_cleanup_rxqs(pp); |
@@ -4023,6 +4023,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
4023 | dev->ethtool_ops = &mvneta_eth_tool_ops; | 4023 | dev->ethtool_ops = &mvneta_eth_tool_ops; |
4024 | 4024 | ||
4025 | pp = netdev_priv(dev); | 4025 | pp = netdev_priv(dev); |
4026 | spin_lock_init(&pp->lock); | ||
4026 | pp->phy_node = phy_node; | 4027 | pp->phy_node = phy_node; |
4027 | pp->phy_interface = phy_mode; | 4028 | pp->phy_interface = phy_mode; |
4028 | 4029 | ||
@@ -4144,7 +4145,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
4144 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 4145 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; |
4145 | dev->hw_features |= dev->features; | 4146 | dev->hw_features |= dev->features; |
4146 | dev->vlan_features |= dev->features; | 4147 | dev->vlan_features |= dev->features; |
4147 | dev->priv_flags |= IFF_UNICAST_FLT; | 4148 | dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; |
4148 | dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; | 4149 | dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; |
4149 | 4150 | ||
4150 | err = register_netdev(dev); | 4151 | err = register_netdev(dev); |