From patchwork Wed Jun 17 23:55:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6631601 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F22DC0020 for ; Wed, 17 Jun 2015 23:58:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A8052062B for ; Wed, 17 Jun 2015 23:58:23 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77ED62021A for ; Wed, 17 Jun 2015 23:58:22 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 69A8618267D; Wed, 17 Jun 2015 16:58:22 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 91DDE182611 for ; Wed, 17 Jun 2015 16:58:21 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 17 Jun 2015 16:58:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,636,1427785200"; d="scan'208";a="589905956" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.23.232.36]) by orsmga003.jf.intel.com with ESMTP; 17 Jun 2015 16:58:21 -0700 Subject: [PATCH 10/15] libnvdimm: fix up max_hw_sectors From: Dan Williams To: axboe@kernel.dk, linux-nvdimm@lists.01.org Date: Wed, 17 Jun 2015 19:55:41 -0400 Message-ID: <20150617235541.12943.86562.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150617235209.12943.24419.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150617235209.12943.24419.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, linux-acpi@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@lst.de X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no hardware limit to enforce on the size of the i/o that can be passed to nd block device, so set it to UINT_MAX. Do this centrally for all nd block devices in nd_blk_queue_init(); Reviewed-by: Vishal Verma Signed-off-by: Dan Williams --- drivers/nvdimm/blk.c | 3 +-- drivers/nvdimm/btt.c | 3 +-- drivers/nvdimm/core.c | 7 +++++++ drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c | 3 +-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c index feddad325f97..8a6345797a71 100644 --- a/drivers/nvdimm/blk.c +++ b/drivers/nvdimm/blk.c @@ -272,9 +272,8 @@ static int nd_blk_probe(struct device *dev) } blk_queue_make_request(blk_dev->queue, nd_blk_make_request); - blk_queue_max_hw_sectors(blk_dev->queue, 1024); - blk_queue_bounce_limit(blk_dev->queue, BLK_BOUNCE_ANY); blk_queue_logical_block_size(blk_dev->queue, blk_dev->sector_size); + nd_blk_queue_init(blk_dev->queue); disk = blk_dev->disk = alloc_disk(0); if (!disk) { diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index c337b7abfb43..380e01cedd24 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1285,9 +1285,8 @@ static int btt_blk_init(struct btt *btt) btt->btt_disk->flags = GENHD_FL_EXT_DEVT; blk_queue_make_request(btt->btt_queue, btt_make_request); - blk_queue_max_hw_sectors(btt->btt_queue, 1024); - blk_queue_bounce_limit(btt->btt_queue, BLK_BOUNCE_ANY); blk_queue_logical_block_size(btt->btt_queue, btt->sector_size); + nd_blk_queue_init(btt->btt_queue); btt->btt_queue->queuedata = btt; set_capacity(btt->btt_disk, 0); diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c index 8f466c384b30..d27b13357873 100644 --- a/drivers/nvdimm/core.c +++ b/drivers/nvdimm/core.c @@ -214,6 +214,13 @@ ssize_t nd_sector_size_store(struct device *dev, const char *buf, } } +void nd_blk_queue_init(struct request_queue *q) +{ + blk_queue_max_hw_sectors(q, UINT_MAX); + blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); +} +EXPORT_SYMBOL(nd_blk_queue_init); + static ssize_t commands_show(struct device *dev, struct device_attribute *attr, char *buf) { diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 9b5fdb2215b1..2f20d5dca028 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -171,5 +171,6 @@ struct resource *nvdimm_allocate_dpa(struct nvdimm_drvdata *ndd, struct nd_label_id *label_id, resource_size_t start, resource_size_t n); int nd_blk_region_init(struct nd_region *nd_region); +void nd_blk_queue_init(struct request_queue *q); resource_size_t nd_namespace_blk_validate(struct nd_namespace_blk *nsblk); #endif /* __ND_H__ */ diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 1f4767150975..b825a2201aa8 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -172,8 +172,7 @@ static struct pmem_device *pmem_alloc(struct device *dev, goto out_unmap; blk_queue_make_request(pmem->pmem_queue, pmem_make_request); - blk_queue_max_hw_sectors(pmem->pmem_queue, 1024); - blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY); + nd_blk_queue_init(pmem->pmem_queue); disk = alloc_disk(0); if (!disk)