Patch "bnxt_en: Fix race when modifying pause settings." has been added to the 5.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bnxt_en: Fix race when modifying pause settings.

to the 5.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bnxt_en-fix-race-when-modifying-pause-settings.patch
and it can be found in the queue-5.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ae468910e388bec6e376277f001c1ee5ebedf31a
Author: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx>
Date:   Sat Jul 11 20:48:23 2020 -0400

    bnxt_en: Fix race when modifying pause settings.
    
    [ Upstream commit 163e9ef63641a02de4c95cd921577265c52e1ce2 ]
    
    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: e2dc9b6e38fa ("bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.")
    Signed-off-by: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx>
    Reviewed-by: Edwin Peer <edwin.peer@xxxxxxxxxxxx>
    Signed-off-by: Michael Chan <michael.chan@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 360f9a95c1d50..21cc2bd127603 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1687,8 +1687,11 @@ static int bnxt_set_pauseparam(struct net_device *dev,
 	if (epause->tx_pause)
 		link_info->req_flow_ctrl |= BNXT_LINK_PAUSE_TX;
 
-	if (netif_running(dev))
+	if (netif_running(dev)) {
+		mutex_lock(&bp->link_lock);
 		rc = bnxt_hwrm_set_pause(bp);
+		mutex_unlock(&bp->link_lock);
+	}
 	return rc;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux