diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-08-19 17:40:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-20 14:34:49 +0100 |
commit | d52ef12f7d6c016f3b249db95af33f725e3dd065 (patch) | |
tree | 77a6078fb549ef72ab44f8e9120451d863788801 /drivers | |
parent | 6985157ce8ee8a02e3899226ac4df351387c3f52 (diff) | |
download | linux-d52ef12f7d6c016f3b249db95af33f725e3dd065.tar.bz2 |
net: dpaa2-switch: phylink_disconnect_phy needs rtnl_lock
There is an ASSERT_RTNL in phylink_disconnect_phy which triggers
whenever dpaa2_switch_port_disconnect_mac is called.
To follow the pattern established by dpaa2_eth_disconnect_mac, take the
rtnl_mutex every time we call dpaa2_switch_port_disconnect_mac.
Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 1419c8dccea2..71c8501ab471 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1508,10 +1508,12 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) } if (status & DPSW_IRQ_EVENT_ENDPOINT_CHANGED) { + rtnl_lock(); if (dpaa2_switch_port_has_mac(port_priv)) dpaa2_switch_port_disconnect_mac(port_priv); else dpaa2_switch_port_connect_mac(port_priv); + rtnl_unlock(); } out: @@ -3201,7 +3203,9 @@ static int dpaa2_switch_remove(struct fsl_mc_device *sw_dev) for (i = 0; i < ethsw->sw_attr.num_ifs; i++) { port_priv = ethsw->ports[i]; unregister_netdev(port_priv->netdev); + rtnl_lock(); dpaa2_switch_port_disconnect_mac(port_priv); + rtnl_unlock(); free_netdev(port_priv->netdev); } |