Hi David,
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."
Thanks,
Gregory
Dmitri Epshtein (3):
net: mvneta: enable change MAC address when interface is up
net: mvneta: fix error messages in mvneta_port_down function
net: mvneta: replace magic numbers by existing macros
Gregory CLEMENT (1):
net: mvneta: Fix spinlock usage
drivers/net/ethernet/marvell/mvneta.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
--
2.5.0
In the previous patch, the spinlock was not initialized. While it didn't
cause any trouble yet it could be a problem to use it uninitialized.
The most annoying part was the critical section protected by the spinlock
in mvneta_stop(). Some of the functions could sleep as pointed when
activated CONFIG_DEBUG_ATOMIC_SLEEP. Actually, in mvneta_stop() we only
need to protect the is_stopped flagged, indeed 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.
Reported-by: Patrick Uiterwijk <redacted>
Signed-off-by: Gregory CLEMENT <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
@@ -3070,17 +3070,17 @@ static int mvneta_stop(struct net_device *dev)structmvneta_port*pp=netdev_priv(dev);/* Inform that we are stopping so we don't want to setup the-*driverfornewCPUsinthenotifiers+*driverfornewCPUsinthenotifiers.Thecodeofthe+*notifierforCPUonlineisprotectedbythesamespinlock,+*sowhenwegetthelock,thenotiferworkisdone.*/spin_lock(&pp->lock);pp->is_stopped=true;+spin_unlock(&pp->lock);+mvneta_stop_dev(pp);mvneta_mdio_remove(pp);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);free_percpu_irq(dev->irq,pp->ports);mvneta_cleanup_rxqs(pp);
@@ -3612,6 +3612,7 @@ static int mvneta_probe(struct platform_device *pdev)dev->ethtool_ops=&mvneta_eth_tool_ops;pp=netdev_priv(dev);+spin_lock_init(&pp->lock);pp->phy_node=phy_node;pp->phy_interface=phy_mode;
From: Dmitri Epshtein <redacted>
This commit corrects error printing when shutting down the port.
[gregory.clement at free-electrons.com: split initial commit in two
individual changes]
Signed-off-by: Dmitri Epshtein <redacted>
Signed-off-by: Gregory CLEMENT <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Dmitri Epshtein <redacted>
Function eth_prepare_mac_addr_change() is called as part of MAC
address change. This function check if interface is running.
To enable change MAC address when interface is running:
IFF_LIVE_ADDR_CHANGE flag must be set to dev->priv_flags field
Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP
network unit")
Cc: stable at vger.kernel.org
Signed-off-by: Dmitri Epshtein <redacted>
Signed-off-by: Gregory CLEMENT <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Dmitri Epshtein <redacted>
Some literal values are actually already defined by macros, so let's use
them.
[gregory.clement at free-electrons.com: split intial commit in two
individual changes]
Signed-off-by: Dmitri Epshtein <redacted>
Signed-off-by: Gregory CLEMENT <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -880,7 +880,7 @@ static void mvneta_port_down(struct mvneta_port *pp)mdelay(1);val=mvreg_read(pp,MVNETA_RXQ_CMD);-}while(val&0xff);+}while(val&MVNETA_RXQ_ENABLE_MASK);/* Stop Tx port activity. Check port Tx activity. Issue stop*commandforactivechannelsonly
@@ -905,7 +905,7 @@ static void mvneta_port_down(struct mvneta_port *pp)/* Check TX Command reg that all Txqs are stopped */val=mvreg_read(pp,MVNETA_TXQ_CMD);-}while(val&0xff);+}while(val&MVNETA_TXQ_ENABLE_MASK);/* Double check to verify that TX FIFO is empty */count=0;
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."
Series applied and patches #1 and #2 queued up for -stable, thanks.