|
@@ -3480,17 +3480,17 @@ static int mvneta_stop(struct net_device *dev)
|
|
struct mvneta_port *pp = netdev_priv(dev);
|
|
struct mvneta_port *pp = netdev_priv(dev);
|
|
|
|
|
|
/* Inform that we are stopping so we don't want to setup the
|
|
/* Inform that we are stopping so we don't want to setup the
|
|
- * driver for new CPUs in the notifiers
|
|
|
|
|
|
+ * driver for new CPUs in the notifiers. The code of the
|
|
|
|
+ * notifier for CPU online is protected by the same spinlock,
|
|
|
|
+ * so when we get the lock, the notifer work is done.
|
|
*/
|
|
*/
|
|
spin_lock(&pp->lock);
|
|
spin_lock(&pp->lock);
|
|
pp->is_stopped = true;
|
|
pp->is_stopped = true;
|
|
|
|
+ spin_unlock(&pp->lock);
|
|
|
|
+
|
|
mvneta_stop_dev(pp);
|
|
mvneta_stop_dev(pp);
|
|
mvneta_mdio_remove(pp);
|
|
mvneta_mdio_remove(pp);
|
|
unregister_cpu_notifier(&pp->cpu_notifier);
|
|
unregister_cpu_notifier(&pp->cpu_notifier);
|
|
- /* Now that the notifier are unregistered, we can release le
|
|
|
|
- * lock
|
|
|
|
- */
|
|
|
|
- spin_unlock(&pp->lock);
|
|
|
|
on_each_cpu(mvneta_percpu_disable, pp, true);
|
|
on_each_cpu(mvneta_percpu_disable, pp, true);
|
|
free_percpu_irq(dev->irq, pp->ports);
|
|
free_percpu_irq(dev->irq, pp->ports);
|
|
mvneta_cleanup_rxqs(pp);
|
|
mvneta_cleanup_rxqs(pp);
|
|
@@ -4023,6 +4023,7 @@ static int mvneta_probe(struct platform_device *pdev)
|
|
dev->ethtool_ops = &mvneta_eth_tool_ops;
|
|
dev->ethtool_ops = &mvneta_eth_tool_ops;
|
|
|
|
|
|
pp = netdev_priv(dev);
|
|
pp = netdev_priv(dev);
|
|
|
|
+ spin_lock_init(&pp->lock);
|
|
pp->phy_node = phy_node;
|
|
pp->phy_node = phy_node;
|
|
pp->phy_interface = phy_mode;
|
|
pp->phy_interface = phy_mode;
|
|
|
|
|