[PATCH 1/2] NVMe: Configure flush capabilities

Keith Busch keith.busch at intel.com
Tue Feb 18 15:29:11 EST 2014


This patch configures the nvme request_queue as flush capable. All NVMe
devices must support the flush command, whether they have a volatile
write cache or not.

Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme-core.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index cd39390..f8d6a9e 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1844,6 +1844,7 @@ static struct nvme_ns *nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid,
 	lbaf = id->flbas & 0xf;
 	ns->lba_shift = id->lbaf[lbaf].ds;
 	ns->ms = le16_to_cpu(id->lbaf[lbaf].ms);
+	blk_queue_flush(ns->queue, REQ_FLUSH | REQ_FUA);
 	blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift);
 	if (dev->max_hw_sectors)
 		blk_queue_max_hw_sectors(ns->queue, dev->max_hw_sectors);
-- 
1.7.10.4




More information about the Linux-nvme mailing list