Patch "nvme-pci: fix sleeping function called from interrupt context" has been added to the 6.1-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

    nvme-pci: fix sleeping function called from interrupt context

to the 6.1-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:
     nvme-pci-fix-sleeping-function-called-from-interrupt.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 0f24a964e3f7e57d3009d8a424fe61ea35de0466
Author: Maurizio Lombardi <mlombard@xxxxxxxxxx>
Date:   Tue Dec 19 17:48:23 2023 +0100

    nvme-pci: fix sleeping function called from interrupt context
    
    [ Upstream commit f6fe0b2d35457c10ec37acc209d19726bdc16dbd ]
    
    the nvme_handle_cqe() interrupt handler calls nvme_complete_async_event()
    but the latter may call nvme_auth_stop() which is a blocking function.
    Sleeping functions can't be called in interrupt context
    
     BUG: sleeping function called from invalid context
     in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/15
      Call Trace:
         <IRQ>
          __cancel_work_timer+0x31e/0x460
          ? nvme_change_ctrl_state+0xcf/0x3c0 [nvme_core]
          ? nvme_change_ctrl_state+0xcf/0x3c0 [nvme_core]
          nvme_complete_async_event+0x365/0x480 [nvme_core]
          nvme_poll_cq+0x262/0xe50 [nvme]
    
    Fix the bug by moving nvme_auth_stop() to fw_act_work
    (executed by the nvme_wq workqueue)
    
    Fixes: f50fff73d620 ("nvme: implement In-Band authentication")
    Signed-off-by: Maurizio Lombardi <mlombard@xxxxxxxxxx>
    Reviewed-by: Jens Axboe <axboe@xxxxxxxxx>
    Reviewed-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
    Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index eb7c87b344b8f..5b906dbb1096c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4835,6 +4835,8 @@ static void nvme_fw_act_work(struct work_struct *work)
 				struct nvme_ctrl, fw_act_work);
 	unsigned long fw_act_timeout;
 
+	nvme_auth_stop(ctrl);
+
 	if (ctrl->mtfa)
 		fw_act_timeout = jiffies +
 				msecs_to_jiffies(ctrl->mtfa * 100);
@@ -4890,7 +4892,6 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
 		 * firmware activation.
 		 */
 		if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) {
-			nvme_auth_stop(ctrl);
 			requeue = false;
 			queue_work(nvme_wq, &ctrl->fw_act_work);
 		}




[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