Skip to content

Commit 163e9ef

Browse files
Vasundhara Volamdavem330
authored andcommitted
bnxt_en: Fix race when modifying pause settings.
The driver was modified to not rely on rtnl lock to protect link settings about 2 years ago. The pause setting was missed when making that change. Fix it by acquiring link_lock mutex before calling bnxt_hwrm_set_pause(). Fixes: e2dc9b6 ("bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.") Signed-off-by: Vasundhara Volam <[email protected]> Reviewed-by: Edwin Peer <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1df0d89 commit 163e9ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,11 @@ static int bnxt_set_pauseparam(struct net_device *dev,
17651765
if (epause->tx_pause)
17661766
link_info->req_flow_ctrl |= BNXT_LINK_PAUSE_TX;
17671767

1768-
if (netif_running(dev))
1768+
if (netif_running(dev)) {
1769+
mutex_lock(&bp->link_lock);
17691770
rc = bnxt_hwrm_set_pause(bp);
1771+
mutex_unlock(&bp->link_lock);
1772+
}
17701773
return rc;
17711774
}
17721775

0 commit comments

Comments
 (0)