This patch set adds various fixes to the dpaa2-ethsw driver: checking
the received notifier block before acting on a switchdev notification,
destroying a workqueue after deregistering the notifiers, making sure
that new VLANs added have a place before actually adding them and other
problems like this.
I know this driver should be moved along from staging but we still have
the Rx/Tx functionality on switch ports and some general cleanup that we
are working towards. This is tackling the second part, no new feature
added here.
Ioana Ciornei (6):
staging: dpaa2-ethsw: verify the nofifier block
staging: dpaa2-ethsw: don't allow interfaces from different DPSWs to
be bridged
staging: dpaa2-ethsw: setup the STP state for all installed VLANs
staging: dpaa2-ethsw: destroy workqueue after deregistering the
notifiers
staging: dpaa2-ethsw: read the port state from firmware
staging: dpaa2-ethsw: check if there is space for a new VLAN
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 114 +++++++++++++++++++-----
1 file changed, 90 insertions(+), 24 deletions(-)
--
2.25.1
We should destroy the switch workqueue only after deregistering the
switchdev notifiers. Without this fix, we could end up with switchdev
notifications on a draining workqueue and also with a lock up since the
netdevice reference count is increased (in port_switchdev_event) and not
decreased ever (since the workqueue did not run).
Signed-off-by: Ioana Ciornei <[email protected]>
---
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 83e6bd4a803b..9114437645a8 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -1628,8 +1628,6 @@ static int ethsw_remove(struct fsl_mc_device *sw_dev)
ethsw_teardown_irqs(sw_dev);
- destroy_workqueue(ethsw->workqueue);
-
dpsw_disable(ethsw->mc_io, 0, ethsw->dpsw_handle);
for (i = 0; i < ethsw->sw_attr.num_ifs; i++) {
@@ -1640,6 +1638,9 @@ static int ethsw_remove(struct fsl_mc_device *sw_dev)
kfree(ethsw->ports);
ethsw_takedown(sw_dev);
+
+ destroy_workqueue(ethsw->workqueue);
+
fsl_mc_portal_free(ethsw->mc_io);
kfree(ethsw);
--
2.25.1