Skip to content

Commit c6993df

Browse files
Nithin Sujirdavem330
authored andcommitted
tg3: Fix deadlock in tg3_change_mtu()
Quoting David Vrabel - "5780 cards cannot have jumbo frames and TSO enabled together. When jumbo frames are enabled by setting the MTU, the TSO feature must be cleared. This is done indirectly by calling netdev_update_features() which will call tg3_fix_features() to actually clear the flags. netdev_update_features() will also trigger a new netlink message for the feature change event which will result in a call to tg3_get_stats64() which deadlocks on the tg3 lock." tg3_set_mtu() does not need to be under the tg3 lock since converting the flags to use set_bit(). Move it out to after tg3_netif_stop(). Reported-by: David Vrabel <david.vrabel@citrix.com> Tested-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c6e27f2 commit c6993df

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14114,12 +14114,12 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
1411414114

1411514115
tg3_netif_stop(tp);
1411614116

14117+
tg3_set_mtu(dev, tp, new_mtu);
14118+
1411714119
tg3_full_lock(tp, 1);
1411814120

1411914121
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
1412014122

14121-
tg3_set_mtu(dev, tp, new_mtu);
14122-
1412314123
/* Reset PHY, otherwise the read DMA engine will be in a mode that
1412414124
* breaks all requests to 256 bytes.
1412514125
*/

0 commit comments

Comments
 (0)