[PATCH V2] nvme-pci: fix sleeping function called from interrupt context
Jens Axboe
axboe at kernel.dk
Tue Dec 19 08:22:47 PST 2023
On 12/19/23 8:42 AM, Maurizio Lombardi wrote:
> 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)
Since this looks like more auth fallout, can we get a fixes tag in here
for this?
> V2: Just move nvme_auth_stop() out of nvme_handle_aen_notice()
> so the latter can be safely called from interrupt context
Changelog stuff goes below the '---' line, not in the commit message.
With those two tweaks, patch looks good to me.
--
Jens Axboe
More information about the Linux-nvme
mailing list