]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Sun, 24 Dec 2023 14:10:20 +0000 (09:10 -0500)
committerSasha Levin <sashal@kernel.org>
Sun, 24 Dec 2023 14:10:20 +0000 (09:10 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.6/nvme-pci-fix-sleeping-function-called-from-interrupt.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/nvme-pci-fix-sleeping-function-called-from-interrupt.patch b/queue-6.6/nvme-pci-fix-sleeping-function-called-from-interrupt.patch
new file mode 100644 (file)
index 0000000..373ff23
--- /dev/null
@@ -0,0 +1,60 @@
+From de858bb24c14056bb8971a141778357e97e77a82 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 19 Dec 2023 17:48:23 +0100
+Subject: nvme-pci: fix sleeping function called from interrupt context
+
+From: Maurizio Lombardi <mlombard@redhat.com>
+
+[ 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@redhat.com>
+Reviewed-by: Jens Axboe <axboe@kernel.dk>
+Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/core.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index d5c8b0a08d494..b32e3cff37b14 100644
+--- a/drivers/nvme/host/core.c
++++ b/drivers/nvme/host/core.c
+@@ -4100,6 +4100,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);
+@@ -4155,7 +4157,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);
+               }
+-- 
+2.43.0
+
index 357343cddfac630bcd7c6957895500198e4e4661..619153f053b1f505ea8992786b36ec07ab84e991 100644 (file)
@@ -77,3 +77,4 @@ i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch
 x86-xen-add-cpu-dependencies-for-32-bit-build.patch
 pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch
 gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch
+nvme-pci-fix-sleeping-function-called-from-interrupt.patch