nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context
authorJames Smart <james.smart@broadcom.com>
Wed, 2 Dec 2020 01:52:43 +0000 (17:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:28 +0000 (18:27 +0100)
commitf1cd8c40936ff2b560e1f35159dd6a4602b558e5
tree0a736534c2668dd30901c5f4a5a4a3bff8bd64e6
parent4ac5d20182c7d55c17f78b1e3afc0dfd1bc873cd
nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context

[ Upstream commit 19fce0470f05031e6af36e49ce222d0f0050d432 ]

Recent patches changed calling sequences. nvme_fc_abort_outstanding_ios
used to be called from a timeout or work context. Now it is being called
in an io completion context, which can be an interrupt handler.
Unfortunately, the abort outstanding ios routine attempts to stop nvme
queues and nested routines that may try to sleep, which is in conflict
with the interrupt handler.

Correct replacing the direct call with a work element scheduling, and the
abort outstanding ios routine will be called in the work element.

Fixes: 95ced8a2c72d ("nvme-fc: eliminate terminate_io use by nvme_fc_error_recovery")
Signed-off-by: James Smart <james.smart@broadcom.com>
Reported-by: Daniel Wagner <dwagner@suse.de>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/fc.c