]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: implement Enhanced Command Retry
authorKeith Busch <keith.busch@intel.com>
Tue, 27 Nov 2018 16:40:57 +0000 (09:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 8 Dec 2018 05:26:58 +0000 (22:26 -0700)
commitfd1d25793dda27bc7246f8e318d34e82fcbfa18b
tree8a8e2121253c6a15a66c9c130c165cd1f7f9cce6
parent9f1a257e81dc5eb522ed06e6ccc8806a4e3a3126
nvme: implement Enhanced Command Retry

A controller may have an internal state that is not able to successfully
process commands for a short duration. In such states, an immediate
command requeue is expected to fail. The driver may exceed its max
retry count, which permanently ends the command in failure when the same
command would succeed after waiting for the controller to be ready.

NVMe ratified TP 4033 provides a delay hint in the completion status
code for failed commands. Implement the retry delay based on the command
completion status and the controller's requested delay.

Note that requeued commands are handled per request_queue, not per
individual request. If multiple commands fail, the controller should
consistently report the desired delay time for retryable commands in
all CQEs, otherwise the requeue list may be kicked too soon.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
include/linux/nvme.h