Patch "qlcnic: fix sleep-in-atomic-context bugs caused by msleep" has been added to the 4.19-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

    qlcnic: fix sleep-in-atomic-context bugs caused by msleep

to the 4.19-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:
     qlcnic-fix-sleep-in-atomic-context-bugs-caused-by-ms.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 736c04851068f04b8e75132766744441124c6bfb
Author: Duoming Zhou <duoming@xxxxxxxxxx>
Date:   Wed Nov 23 18:06:42 2022 +0800

    qlcnic: fix sleep-in-atomic-context bugs caused by msleep
    
    [ Upstream commit 8dbd6e4ce1b9c527921643d9e34f188a10d4e893 ]
    
    The watchdog timer is used to monitor whether the process
    of transmitting data is timeout. If we use qlcnic driver,
    the dev_watchdog() that is the timer handler of watchdog
    timer will call qlcnic_tx_timeout() to process the timeout.
    But the qlcnic_tx_timeout() calls msleep(), as a result,
    the sleep-in-atomic-context bugs will happen. The processes
    are shown below:
    
       (atomic context)
    dev_watchdog
      qlcnic_tx_timeout
        qlcnic_83xx_idc_request_reset
          qlcnic_83xx_lock_driver
            msleep
    
    ---------------------------
    
       (atomic context)
    dev_watchdog
      qlcnic_tx_timeout
        qlcnic_83xx_idc_request_reset
          qlcnic_83xx_lock_driver
            qlcnic_83xx_recover_driver_lock
              msleep
    
    Fix by changing msleep() to mdelay(), the mdelay() is
    busy-waiting and the bugs could be mitigated.
    
    Fixes: 629263acaea3 ("qlcnic: 83xx CNA inter driver communication mechanism")
    Signed-off-by: Duoming Zhou <duoming@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index d857d44547a5..b3f1f1bd52a8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -2993,7 +2993,7 @@ static void qlcnic_83xx_recover_driver_lock(struct qlcnic_adapter *adapter)
 		QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val);
 		dev_info(&adapter->pdev->dev,
 			 "%s: lock recovery initiated\n", __func__);
-		msleep(QLC_83XX_DRV_LOCK_RECOVERY_DELAY);
+		mdelay(QLC_83XX_DRV_LOCK_RECOVERY_DELAY);
 		val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK);
 		id = ((val >> 2) & 0xF);
 		if (id == adapter->portnum) {
@@ -3029,7 +3029,7 @@ int qlcnic_83xx_lock_driver(struct qlcnic_adapter *adapter)
 		if (status)
 			break;
 
-		msleep(QLC_83XX_DRV_LOCK_WAIT_DELAY);
+		mdelay(QLC_83XX_DRV_LOCK_WAIT_DELAY);
 		i++;
 
 		if (i == 1)



[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