Skip to content

Commit d52ef12

Browse files
vladimirolteandavem330
authored andcommitted
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: 84cba72 ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Ioana Ciornei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6985157 commit d52ef12

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,12 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
15081508
}
15091509

15101510
if (status & DPSW_IRQ_EVENT_ENDPOINT_CHANGED) {
1511+
rtnl_lock();
15111512
if (dpaa2_switch_port_has_mac(port_priv))
15121513
dpaa2_switch_port_disconnect_mac(port_priv);
15131514
else
15141515
dpaa2_switch_port_connect_mac(port_priv);
1516+
rtnl_unlock();
15151517
}
15161518

15171519
out:
@@ -3201,7 +3203,9 @@ static int dpaa2_switch_remove(struct fsl_mc_device *sw_dev)
32013203
for (i = 0; i < ethsw->sw_attr.num_ifs; i++) {
32023204
port_priv = ethsw->ports[i];
32033205
unregister_netdev(port_priv->netdev);
3206+
rtnl_lock();
32043207
dpaa2_switch_port_disconnect_mac(port_priv);
3208+
rtnl_unlock();
32053209
free_netdev(port_priv->netdev);
32063210
}
32073211

0 commit comments

Comments
 (0)