From: Jens Axboe Date: Tue, 12 Apr 2016 21:43:09 +0000 (-0600) Subject: NVMe: switch to using blk_queue_write_cache() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c88cb00f2a26637bade6c62a17d17f31a954e30;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git NVMe: switch to using blk_queue_write_cache() Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 6631f38aebca..4eb575933587 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -999,6 +999,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; @@ -1008,9 +1010,10 @@ 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); blk_queue_virt_boundary(q, ctrl->page_size - 1); + if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) + vwc = true; + blk_queue_write_cache(q, vwc, vwc); } /*