[03/20] NVMe: switch to using blk_queue_write_cache()
diff mbox

Message ID 1460486175-25724-4-git-send-email-axboe@fb.com
State New
Headers show

Commit Message

Jens Axboe April 12, 2016, 6:35 p.m. UTC
Signed-off-by: Jens Axboe <axboe@fb.com>
---
 drivers/nvme/host/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Christoph Hellwig April 12, 2016, 9:21 p.m. UTC | #1
On Tue, Apr 12, 2016 at 12:35:58PM -0600, Jens Axboe wrote:
> -	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
> -		blk_queue_flush(q, REQ_FLUSH | REQ_FUA);
>  	blk_queue_virt_boundary(q, ctrl->page_size - 1);
> +	blk_queue_write_cache(q, ctrl->vwc & NVME_CTRL_VWC_PRESENT, true);

fua without the write cache doesn't make sense, I think this should
better use the NVME_CTRL_VWC_PRESENT check for both.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jens Axboe April 12, 2016, 9:37 p.m. UTC | #2
On 04/12/2016 03:21 PM, Christoph Hellwig wrote:
> On Tue, Apr 12, 2016 at 12:35:58PM -0600, Jens Axboe wrote:
>> -	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
>> -		blk_queue_flush(q, REQ_FLUSH | REQ_FUA);
>>   	blk_queue_virt_boundary(q, ctrl->page_size - 1);
>> +	blk_queue_write_cache(q, ctrl->vwc & NVME_CTRL_VWC_PRESENT, true);
>
> fua without the write cache doesn't make sense, I think this should
> better use the NVME_CTRL_VWC_PRESENT check for both.

It doesn't really matter, but it doesn't really hurt either. But I'll 
just  make them both dependent on VWC, that way it's clearer.

Patch
diff mbox

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 643f457131c2..32d2a3bb0150 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -903,9 +903,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);
 	blk_queue_virt_boundary(q, ctrl->page_size - 1);
+	blk_queue_write_cache(q, ctrl->vwc & NVME_CTRL_VWC_PRESENT, true);
 }
 
 /*