NVMe: Reduce maximum queue depth by 1
The spec says we're not allowed to completely fill the submission queue.
Solve this by reducing the number of allocatable cmdids by 1.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 562d75a..45bfae1 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -156,7 +156,7 @@
static int alloc_cmdid(struct nvme_queue *nvmeq, void *ctx, int handler,
unsigned timeout)
{
- int depth = nvmeq->q_depth;
+ int depth = nvmeq->q_depth - 1;
struct nvme_cmd_info *info = nvme_cmd_info(nvmeq);
int cmdid;