Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759517AbcCVRz4 (ORCPT ); Tue, 22 Mar 2016 13:55:56 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:59666 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758735AbcCVRzj (ORCPT ); Tue, 22 Mar 2016 13:55:39 -0400 From: Jens Axboe To: , , CC: Jens Axboe Subject: [PATCH 5/6] NVMe: inform block layer of write cache state Date: Tue, 22 Mar 2016 11:55:19 -0600 Message-ID: <1458669320-6819-6-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.4.1.168.g1ea28e1 In-Reply-To: <1458669320-6819-1-git-send-email-axboe@fb.com> References: <1458669320-6819-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-22_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 751 Lines: 23 This isn't quite correct, since the VWC merely states if a potential write back cache is volatile or not. But for the purpose of write absortion, it's good enough. Signed-off-by: Jens Axboe --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 643f457131c2..05c8edfb7611 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -906,6 +906,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, 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); } /* -- 2.4.1.168.g1ea28e1