From: Jens Axboe Date: Tue, 12 Apr 2016 21:43:09 +0000 (-0600) Subject: NVMe: switch to using blk_queue_write_cache() X-Git-Tag: v4.1.12-102.0.20170601_1400~96 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7641d7f577fa69d1a8efa964dafaf85dd6e2b312;p=users%2Fjedix%2Flinux-maple.git NVMe: switch to using blk_queue_write_cache() Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe (cherry picked from commit 7c88cb00f2a26637bade6c62a17d17f31a954e30) Orabug: 25130845 Signed-off-by: Ashok Vairavan Reviewed-by: Martin K. Petersen --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 58befbec02df8..480062e02bde2 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -947,6 +947,8 @@ EXPORT_SYMBOL_GPL(nvme_shutdown_ctrl); static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, struct request_queue *q) { + bool vwc = false; + if (ctrl->max_hw_sectors) { u32 max_segments = (ctrl->max_hw_sectors / (ctrl->page_size >> 9)) + 1; @@ -957,7 +959,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, if (ctrl->stripe_size) blk_queue_chunk_sectors(q, ctrl->stripe_size >> 9); if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) - blk_queue_flush(q, REQ_FLUSH | REQ_FUA); + vwc = true; + blk_queue_write_cache(q, vwc, vwc); } /*