linux_dsm_epyc7002/drivers/nvme/host
James Smart cd48282cc7 nvme: stop aer posting if controller state not live
If an nvme async_event command completes, in most cases, a new
async event is posted. However, if the controller enters a
resetting or reconnecting state, there is nothing to block the
scheduled work element from posting the async event again. Nor are
there calls from the transport to stop async events when an
association dies.

In the case of FC, where the association is torn down, the aer must
be aborted on the FC link and completes through the normal job
completion path. Thus the terminated async event ends up being
rescheduled even though the controller isn't in a valid state for
the aer, and the reposting gets the transport into a partially torn
down data structure.

It's possible to hit the scenario on rdma, although much less likely
due to an aer completing right as the association is terminated and
as the association teardown reclaims the blk requests via
nvme_cancel_request() so its immediate, not a link-related action
like on FC.

Fix by putting controller state checks in both the async event
completion routine where it schedules the async event and in the
async event work routine before it calls into the transport. It's
effectively a "stop_async_events()" behavior.  The transport, when
it creates a new association with the subsystem will transition
the state back to live and is already restarting the async event
posting.

Signed-off-by: James Smart <james.smart@broadcom.com>
[hch: remove taking a lock over reading the controller state]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-09-25 08:56:05 -06:00
..
core.c nvme: stop aer posting if controller state not live 2017-09-25 08:56:05 -06:00
fabrics.c nvme-fabrics: generate spec-compliant UUID NQNs 2017-09-01 09:48:01 +02:00
fabrics.h nvme: read the subsystem NQN from Identify Controller 2017-06-28 08:14:13 -06:00
fc.c nvme-fc: use transport-specific sgl format 2017-09-25 08:56:05 -06:00
Kconfig nvme: Remove SCSI translations 2017-06-28 08:14:13 -06:00
lightnvm.c nvme: fix lightnvm check 2017-09-11 12:29:36 -04:00
Makefile nvme: Makefile: remove dead build rule 2017-06-29 09:43:23 -06:00
nvme.h nvme-pci: implement the HMB entry number and size limitations 2017-09-11 12:29:40 -04:00
pci.c nvme-pci: Print invalid SGL only once 2017-09-25 08:56:05 -06:00
rdma.c Merge branch 'for-4.14/block-postmerge' of git://git.kernel.dk/linux-block 2017-09-09 12:49:01 -07:00