Received: by 10.213.65.68 with SMTP id h4csp253432imn; Fri, 23 Mar 2018 04:01:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELtqxJJ9B/Mk4A1YdoiAUBxPbLzfITJYW6mIviANXpKQoXt2K/CANiPnEw6yKtdWQ+bwNJFq X-Received: by 2002:a17:902:9a05:: with SMTP id v5-v6mr28861050plp.69.1521802887787; Fri, 23 Mar 2018 04:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802887; cv=none; d=google.com; s=arc-20160816; b=KFzWx86542yEvCwIFHzryrHqZ/AbqDgFUQD6vDGKGygTxC79LrWFhNBEOJXMeK6Enn 3N/j6vwbH8AIK9WNnTavmB1O5pO4F4xC90dDENrHPuEbZIJu84cxAP+q6GddY1IUEXv5 AI9tHmCVphg14tMBNWyCY4iipKTLuv4wIjz9FNuNhEnAsrQq4wJIj1AaBnF2xoNAO+hY J8LWLXeWMSdIU5ru192McWVB21kj0XOKIB6rzbJ8LkykKndxg5D7U8r+vH+tiJXCZoWs Y6pK5R6mUoNWtQuEkVuwaOVW0YdsWDr2Re1WXjjxvk9luyx5Amxztk6uhsOz2aJuCSCt vKDw== 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=7C2bquwTt4P2ofFswMNW73QFuTmoQHQA5RngjMcnRqo=; b=qKyVu+ND0IAzwzIT9SwORVZKuBKLQs/EcyGI9lmeasMZVdgQEDclq0hV/3uvShbM68 B6Z0ZwZaoCTf4YlMu3IzStK+FxT/P8mdzfjZotmzg3hn/g3gGRgiibY9N+KI8ihLpm72 eI3vWlsahEisbJUxlA2IYxcMUox4JBohGyQz7mO+NMjWoBI19PkaMUEPWS8U7b9iLo3d LCHD/c1EdF5ZXMOXnST19CJssCnh+24in6/oXaWmBQ4k7D+awhierhjUnu/ejP7ao8gh f2EUUsKrm+/Z9JG9AIeHfRffwWD5mEq0irpgdABni7lHnFrZ8RLk300tr+YsoAfBVix6 A0kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=TEXdhfnl; 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 w9-v6si8001068plq.318.2018.03.23.04.01.07; Fri, 23 Mar 2018 04:01:27 -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=TEXdhfnl; 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 S1752413AbeCWLAP (ORCPT + 99 others); Fri, 23 Mar 2018 07:00:15 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44559 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755779AbeCWLAL (ORCPT ); Fri, 23 Mar 2018 07:00:11 -0400 Received: by mail-lf0-f66.google.com with SMTP id g203-v6so17630064lfg.11 for ; Fri, 23 Mar 2018 04:00:10 -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=7C2bquwTt4P2ofFswMNW73QFuTmoQHQA5RngjMcnRqo=; b=TEXdhfnlFWoiXogA1S9t4dgwHtVVu0J4eT+FXlJESqOv9il4amyNGPUaKziz3VLZIQ /w4pkcYeZJPhiUP8rW4fgt5VsUuThg488vzECmY5/5uhjQ/syF5Ic+FV48OAgvqoIaGg LXJOCSmBThiAYv/c2u3ciQizt5e51MTSA4w1SHFvnixKaauc25xtziXfnV7N5IUHvtsq poHku1aOim84eaQFD0svfyA/dpin1jc0dfeNVtNZVC1XhMDqR3Khpp9Ystxy76gfiaIM bnlJ+eJLRhbTsx3dwnCcwzZOVLeYwgd3ZDuLeRKsKuPPKQ0y5ZkdTerxLxMOZYy6xcz+ 93XA== 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=7C2bquwTt4P2ofFswMNW73QFuTmoQHQA5RngjMcnRqo=; b=WRmjPDSfpU9ZVel8ui4cgRMHQvqWR9U6IgL0ClpXkLJ8yHu7CjL4ChMVinRdAHPvC4 BjCR75R3eqSLq9rWFBXDIvTOqgfQmx/sTMGz4/ApP/EJd5r68qr/hsT/0vSIgTZVN3Qg d1CkBqVMXqFt/czCQo7t7/lLqcjexsJzDwrq59Rfjc5Zu5AOnG7+2CcQb1X8s1tmB4Ce N0g6jzYhBRe7cTq+JGjQGeOYnkYffKvr6/8TEEYq+6o6DjG+rv42oiKn/IeXm4LpoJul jyINa2RD15bdnzD6rK0wK5Q0wXsks1qkesOJ9i7IRzljTLcw7v9n7RClc5X97HwBONnM G1ow== X-Gm-Message-State: AElRT7FFLUkDuiJEuYwi7SZStlf/eJh0Nw/e+7NCJs1kNlvA9/TkZLHN cZKK1D8qC6avj7ytIVkDnG9MXg== X-Received: by 10.46.155.135 with SMTP id z7mr18859922lji.125.1521802810184; Fri, 23 Mar 2018 04:00:10 -0700 (PDT) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id u13-v6sm2115207lff.72.2018.03.23.04.00.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 04:00:09 -0700 (PDT) Subject: Re: [PATCH 4/4] nvme: lightnvm: add late setup of block size and metadata To: Keith Busch Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, javier@cnexlabs.com, "linux-nvme@lists.infradead.org" , Jens Axboe References: <20180205121505.27563-1-mb@lightnvm.io> <20180205121505.27563-5-mb@lightnvm.io> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <343f19d9-0428-f255-6ed0-519035eef46d@lightnvm.io> Date: Fri, 23 Mar 2018 12:00:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180205121505.27563-5-mb@lightnvm.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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