Received: by 10.213.65.68 with SMTP id h4csp385100imn; Wed, 28 Mar 2018 05:38:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/5dbk4jO26M0o3XNYsAM4B7eIfgNTAaw08zjf0Zmf7Wd7eRpdotw6EiR64VWzrfwCAauiM X-Received: by 10.98.153.204 with SMTP id t73mr2868046pfk.121.1522240683565; Wed, 28 Mar 2018 05:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522240683; cv=none; d=google.com; s=arc-20160816; b=UhpV7a9EmKwILV5arXr9ETclG8o/aLEO4egmFj3X5Q5gmCoku8djiBUIJ8uAv7VzxO oHV0WLlpPunb+xRKiARhCw2yZa1NwjmLQueV4u1GrGkmq2pN98RMBMFXZO9Rb7hmSE7U xl5xpfNRc/9bJrjs9ckg4rCzmEpx2L0Gxt5w43FhoVs1MNj3GO+soxNH+aO+U+CaKkkS n9y00X8PjKfl2TWuTNMFKQsZEwwMvxn/Pwisc4UQ3L19xh6DWie4Zf8hhv7b6DE11X1G 2GweJnxMGNYYgeRuy0U5kU3bSfLOFzQ2TfEAxjqvM6+jOTc6OMkas4GpFniaQIOJkMeS 8Ajw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=F2aqpdorHttzhfGbvGU+vbveGfT6wrq1eNX5dLYx4s8=; b=tzDtxsUroJaS5qMVAPIef8lRM40FrFb47TiGsIA/nX5zdX5d4Z7t2pvszsZnTWqo5K cy4Uz+6N4O6E99MFWtc7u7Y1UA2UU/H17MqTAbcD9BqKz1DTmU/y5PKqMTTRs1dt4Sn6 ayw4qHWMwKAxsCAa3PsJ5XVNd9g49rD4Unylsj0AH3p+16gKnFxXWS+RkpKBbg3Jzz/F fEKkXlVMgiNnusMiJOzeRee/TDHPAx++uDARNrvRZFxxWCPqrGa5so1BTgOFoGbf/Bn7 BCY8HL6pA9yyjgxU8bKLdkFiRjajIO+fcphNw/Lm5B/lE3/ca6M3rCNk8Y7qVoK/7tvZ oX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=b/ILMI6/; 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 s5-v6si3530391plp.28.2018.03.28.05.37.48; Wed, 28 Mar 2018 05:38:03 -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=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=b/ILMI6/; 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 S1752584AbeC1Mg5 (ORCPT + 99 others); Wed, 28 Mar 2018 08:36:57 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:36001 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbeC1Mgz (ORCPT ); Wed, 28 Mar 2018 08:36:55 -0400 Received: by mail-pl0-f68.google.com with SMTP id 91-v6so1480132pld.3 for ; Wed, 28 Mar 2018 05:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F2aqpdorHttzhfGbvGU+vbveGfT6wrq1eNX5dLYx4s8=; b=b/ILMI6//IgNcMSD+CJN+2HGLJdasuNiF9GMV4pmCB7leIB6PyBjcEx5oPGWR3kiRq YVnZCFjezz5hOqw6LPeXoDiU6l8GRFcBphUJA4xttNi97RZ/BNFm+sgw+VMziIFRL2YE bfI9okuj9DBgakDEq32Re/W4oVDvfw42ySLVIaGZkgn6q6+jm6fk9e683sWDySnLFaFR wOjEl2ipAedwCLBqIgbLFQT7oyNlfrMDgt/fx2kRIIlVBKZOdIQWr5u/49HMucIDwv7a f8mD1NDR4EvyXjWK/emSCQHIPH8niAXMdYFjUS5adfa/gjqOcNY7uKNaVL1IsPgAAcb1 Bk1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F2aqpdorHttzhfGbvGU+vbveGfT6wrq1eNX5dLYx4s8=; b=kmseO1Edjs0JaPfqdSQuiwYuaCjPVx9aOT8g16/KwwexXW+AG1MoeIPiiZBgZx/RBJ 4CRUbq5eNymWNrkHaInUUjmPf8ByqRrSwonyR31ON0Ta1o24pjNLdz+dyhWIQX7dejdC URQRkLsnK6fpV7SK9DCicJ1Uo0gnsVvmg6Jj/U8XMjg7AQ7XdIMD+Umi6nm03B/x1Zad 87SaQ8D3khXNPE9n2yU2cp4ZFd5RiF2zRpOw4KerOLNNUDVIr6hrISw5WEp8Na/raYLB G+1EPO7i114mFBc1PmK/p8iXvbLNmNH2aV1zXTXUGdUqhnTmirmjKuikQva77R8P4rtz y2DQ== X-Gm-Message-State: AElRT7GdaYF5hCsQyRug6UyhtjL3r1E7EJugoWO3vyqCC2PKB8QIjbiP d6cZlzh9QwQUMRgtxzodbTZ8iA== X-Received: by 2002:a17:902:8287:: with SMTP id y7-v6mr3659541pln.85.1522240615079; Wed, 28 Mar 2018 05:36:55 -0700 (PDT) Received: from [192.168.1.12] (66-7-227-83.static-ip.telepacific.net. [66.7.227.83]) by smtp.gmail.com with ESMTPSA id e73sm9649698pfj.186.2018.03.28.05.36.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 05:36:54 -0700 (PDT) Subject: Re: [PATCH 4/4] nvme: lightnvm: add late setup of block size and metadata To: Christoph Hellwig Cc: Keith Busch , linux-block@vger.kernel.org, javier@cnexlabs.com, Jens Axboe , linux-kernel@vger.kernel.org, "linux-nvme@lists.infradead.org" References: <20180205121505.27563-1-mb@lightnvm.io> <20180205121505.27563-5-mb@lightnvm.io> <343f19d9-0428-f255-6ed0-519035eef46d@lightnvm.io> <20180328082825.GB31409@infradead.org> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <742b1250-3c1d-2436-7aa8-85c3f0347419@lightnvm.io> Date: Wed, 28 Mar 2018 14:36:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180328082825.GB31409@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2018 10.28, Christoph Hellwig wrote: > I really don't want more lightnvm cruft in the core. We'll need > a proper abstraction.c > I agree, we should get that moving, and make a proper abstraction for it. Also with respect to how an SMR interface in general is integrated into NVMe. The patch is necessary due to the revalidate event for retrieving the lba format from the nvme drive. It might not be available the first time around, and we have to hook in when the drive is revalidated the second time. > 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--- >