From fb8e5e8a20ae03486ba42d52e81c002a03b5e411 Mon Sep 17 00:00:00 2001 From: Ashok Vairavan Date: Sun, 12 Mar 2017 18:44:11 -0700 Subject: [PATCH] Revert "nvme: Limit command retries" This reverts commit 582575bf4329fa5e29c0f1eae79cb0fb13fded04. --- drivers/nvme/host/nvme.h | 1 - drivers/nvme/host/pci.c | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 499d04cd5150..8d503dc6269e 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -19,7 +19,6 @@ #include #include -extern unsigned int nvme_max_retries; extern unsigned char nvme_io_timeout; #define NVME_IO_TIMEOUT (nvme_io_timeout * HZ) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 3ee056b8aa29..9d6a9952116f 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -65,11 +65,6 @@ static unsigned char shutdown_timeout = 5; module_param(shutdown_timeout, byte, 0644); MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown"); -unsigned int nvme_max_retries = 5; -module_param_named(max_retries, nvme_max_retries, uint, 0644); -MODULE_PARM_DESC(max_retries, "max number of retries a command may have"); -EXPORT_SYMBOL_GPL(nvme_max_retries); - static int nvme_major; module_param(nvme_major, int, 0); @@ -630,12 +625,9 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, if (unlikely(status)) { if (!(status & NVME_SC_DNR || blk_noretry_request(req)) - && (jiffies - req->start_time) < req->timeout && - req->retries < nvme_max_retries) { + && (jiffies - req->start_time) < req->timeout) { unsigned long flags; - req->retries++; - requeue = true; blk_mq_requeue_request(req); spin_lock_irqsave(req->q->queue_lock, flags); if (!blk_queue_stopped(req->q)) @@ -861,11 +853,6 @@ static void nvme_setup_rw(struct nvme_ns *ns, struct request *req, if (req->cmd_flags & REQ_RAHEAD) dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH; - if (!(req->cmd_flags & REQ_DONTPREP)) { - req->retries = 0; - req->cmd_flags |= REQ_DONTPREP; - } - memset(cmnd, 0, sizeof(*cmnd)); cmnd->rw.opcode = (rq_data_dir(req) ? nvme_cmd_write : nvme_cmd_read); cmnd->rw.command_id = req->tag; -- 2.50.1