Received: by 10.213.65.68 with SMTP id h4csp191562imn; Wed, 28 Mar 2018 01:29:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49td7tuaDIqXi4YMX//cvq27oCoXCcSCc3WhHXX4gPpr74UABZgHSBPR8R7Daiur5WsJx0q X-Received: by 2002:a17:902:76c5:: with SMTP id j5-v6mr2817985plt.166.1522225795705; Wed, 28 Mar 2018 01:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522225795; cv=none; d=google.com; s=arc-20160816; b=IDJjlvQif2xlLgTGFFHiDQNzhMESErGxu70Jbt1hv5O9DoqzndjR9MNrxEPblncEFE ajCyAYCOeK2J9df7iS+yeVGCn8MYKmB5duQmUTHxbLDb+VahI/JCFLqn5Wz55+xoQsea oJP57OUVavc2Rxa04XLZcneV5TxWOkdhTabZAgnkYUft35UvKG5q8pkNoeKQENDPmLWW SAFqlVShTl2ZRLxY2xuiMgxr9KmHhlcVkS7bwl0wD0sdX3YQh3/WXnZOHDbzhZkdXGqF 5H9YYIW0j6lazlbBK8Cc+7klUM4Bu9sgoVgiRLN8JRqKRf78nzBvJblB/9gFREDQSow5 HneA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=HkOIHs6Oq540IneN2N3jxRVDIXLtpRLTOC9DVDF1DLA=; b=Q52TyDUU+AiFrGPoKwA+1ze33wF5PpSHS3rL+b+PArwaMDjWC5ySbBAbPOr8Qr9QCw klTt+bILHJtl6eVVRITJpl1h7541V3Lla8ALR+Arh3nUiX8FlEjLsvUV5gR+vK87fhV+ T+eFQ33m2T1480gdmmTBlSj7a4zguB7uK0Q1x/XkVg055pXowTFUtwIpjiEMnAFBPZEt 6kVmBe7T/HDtqxLGV+943isBstaZJMRMLSytXRhRtlcgyXTVVykjI+72myjhc7j1CbdI kRNfDNW72EqZf7DDYZOOtIN4NUiHFOdoa+79M/GxskhJuAic+TD/wK7RyNUtZ/cCXYtB zbYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ELE++dVA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a31-v6si3200903pla.322.2018.03.28.01.29.40; Wed, 28 Mar 2018 01:29:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ELE++dVA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752664AbeC1I2c (ORCPT + 99 others); Wed, 28 Mar 2018 04:28:32 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54998 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbeC1I2a (ORCPT ); Wed, 28 Mar 2018 04:28:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HkOIHs6Oq540IneN2N3jxRVDIXLtpRLTOC9DVDF1DLA=; b=ELE++dVAsngBLC2DT/AozHXvJk ylNAKCZ2sN9HEZF3rtZsfy0OLAbyPWMODxyzs/5wFWqd89XN0ZmWfaOIDzHMdkBKu4v7IqFLXMrRe TUhFM2h1FpUQFQXw+IYCRpBRdu6qM0X7F4+ImUww88rHq/Vc+l8v0y0NDc5HMLtV7MQ2OGgAShdpS EcoA8gVMViiVu+FrorwpwFfePUP1C8TbvduDsVbRpnPCuJPOg7cnUCg+h/NDemQJ38HKtYlt+f2z8 kMRwcFTcUhBPvGGrWoKdNLKY0nvo5FGr4QnL7WnLl+G1fKOP4qx9tfo338owkO5FLZTV9QJxo13N7 WMd714jA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f16RV-0002VI-5d; Wed, 28 Mar 2018 08:28:25 +0000 Date: Wed, 28 Mar 2018 01:28:25 -0700 From: Christoph Hellwig To: Matias =?iso-8859-1?Q?Bj=F8rling?= Cc: Keith Busch , linux-block@vger.kernel.org, javier@cnexlabs.com, Jens Axboe , linux-kernel@vger.kernel.org, "linux-nvme@lists.infradead.org" Subject: Re: [PATCH 4/4] nvme: lightnvm: add late setup of block size and metadata Message-ID: <20180328082825.GB31409@infradead.org> References: <20180205121505.27563-1-mb@lightnvm.io> <20180205121505.27563-5-mb@lightnvm.io> <343f19d9-0428-f255-6ed0-519035eef46d@lightnvm.io> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <343f19d9-0428-f255-6ed0-519035eef46d@lightnvm.io> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I really don't want more lightnvm cruft in the core. We'll need a proper abstraction.c On Fri, Mar 23, 2018 at 12:00:08PM +0100, Matias Bj?rling wrote: > On 02/05/2018 01:15 PM, Matias Bj?rling wrote: > > The nvme driver sets up the size of the nvme namespace in two steps. > > First it initializes the device with standard logical block and > > metadata sizes, and then sets the correct logical block and metadata > > size. Due to the OCSSD 2.0 specification relies on the namespace to > > expose these sizes for correct initialization, let it be updated > > appropriately on the LightNVM side as well. > > > > Signed-off-by: Matias Bj?rling > > --- > > drivers/nvme/host/core.c | 2 ++ > > drivers/nvme/host/lightnvm.c | 8 ++++++++ > > drivers/nvme/host/nvme.h | 2 ++ > > 3 files changed, 12 insertions(+) > > > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > > index f837d666cbd4..740ceb28067c 100644 > > --- a/drivers/nvme/host/core.c > > +++ b/drivers/nvme/host/core.c > > @@ -1379,6 +1379,8 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) > > if (ns->noiob) > > nvme_set_chunk_size(ns); > > nvme_update_disk_info(disk, ns, id); > > + if (ns->ndev) > > + nvme_nvm_update_nvm_info(ns); > > #ifdef CONFIG_NVME_MULTIPATH > > if (ns->head->disk) > > nvme_update_disk_info(ns->head->disk, ns, id); > > diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c > > index a9c010655ccc..8d4301854811 100644 > > --- a/drivers/nvme/host/lightnvm.c > > +++ b/drivers/nvme/host/lightnvm.c > > @@ -814,6 +814,14 @@ int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg) > > } > > } > > +void nvme_nvm_update_nvm_info(struct nvme_ns *ns) > > +{ > > + struct nvm_dev *ndev = ns->ndev; > > + > > + ndev->identity.csecs = ndev->geo.sec_size = 1 << ns->lba_shift; > > + ndev->identity.sos = ndev->geo.oob_size = ns->ms; > > +} > > + > > int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node) > > { > > struct request_queue *q = ns->queue; > > diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h > > index ea1aa5283e8e..1ca08f4993ba 100644 > > --- a/drivers/nvme/host/nvme.h > > +++ b/drivers/nvme/host/nvme.h > > @@ -451,12 +451,14 @@ static inline void nvme_mpath_clear_current_path(struct nvme_ns *ns) > > #endif /* CONFIG_NVME_MULTIPATH */ > > #ifdef CONFIG_NVM > > +void nvme_nvm_update_nvm_info(struct nvme_ns *ns); > > int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node); > > void nvme_nvm_unregister(struct nvme_ns *ns); > > int nvme_nvm_register_sysfs(struct nvme_ns *ns); > > void nvme_nvm_unregister_sysfs(struct nvme_ns *ns); > > int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg); > > #else > > +static inline void nvme_nvm_update_nvm_info(struct nvme_ns *ns) {}; > > static inline int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, > > int node) > > { > > > > Hi Keith, > > When going through the patches for 4.17, I forgot to run this patch by you. > It is part of adding OCSSD2.0 support to the kernel, and slides in between a > large refactoring, and the 2.0 part. May I add your reviewed by and let Jens > pick it up after the nvme patches for 4.17 has gone up? > > Thanks! > > -Matias > > _______________________________________________ > Linux-nvme mailing list > Linux-nvme@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-nvme ---end quoted text---