From patchwork Mon Feb 26 13:17:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 10242363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DFF9360386 for ; Mon, 26 Feb 2018 13:24:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D02882A007 for ; Mon, 26 Feb 2018 13:24:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C51002A009; Mon, 26 Feb 2018 13:24:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C1EB2A00E for ; Mon, 26 Feb 2018 13:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586AbeBZNXx (ORCPT ); Mon, 26 Feb 2018 08:23:53 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39320 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbeBZNRd (ORCPT ); Mon, 26 Feb 2018 08:17:33 -0500 Received: by mail-wm0-f68.google.com with SMTP id 191so17183094wmm.4 for ; Mon, 26 Feb 2018 05:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lWAM+YC9xLhN3xRF9MMD3eR1JY6karYrtSU7dXL7iGg=; b=R/stAHRWjTXrGFF0JmB/vTfR4IdOcqvcY2B+ehJwkki4XAucI9SC8YUBoG0I6XLcQN lveb7JBZ7ljrIJ4P1gIwHgJA+9gNczA4vkzqHEVvhr39X+RpCiUPQXZ+hI7smuOqZCHv lD6tZye1rAkjhv9DjnaplO9sEF4Hmb5DbfgWg7M7NzUJsVLlAZpho3a8/ISkyuoEUQTS L+UFnvFbFe56TydYfc2AR+VPVAK5kiB98ykGcclxcGUcUd8IFGESGSBX/jqoSBctBax0 /s8B0pWDfaS5Ujjx6nZmLmnw0H/ptljdlgfNguPfiOKZgaRImaoxMqAziQfR2/ESI2SU LV3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lWAM+YC9xLhN3xRF9MMD3eR1JY6karYrtSU7dXL7iGg=; b=Uqk2Xu/J7PaVZiXu7uGvBqyPtT1afrm9Ecsyo3SRNR57HTCj6VAu+sjpIGW6+T1S9X /1BcFh7J03WOLpI7mJp0zZ13lNmlNaYqaMuL9K5KXW3XFPNAfM9FOBpsKTSTB+iurjLU gsyFpHi5oDLF3SUzYBvrQe7utSnPvXblQ6Kge4gxIBQG1kdoWyJXLBCnWwXcTLohOHqQ wxjBxdztdI4cTPHPr10ccjs9YLgMvMTIIxe67TF852vwQVlO7HT03S8BMDBqsDpwhSJI d5JTtI0JPIca2rGDxqVq4ZpptsWF3nVQDMxGgtuf5UfjJ/aNPSzQjA8/YXQEGc6cij0S kaXw== X-Gm-Message-State: APf1xPDxwuQsijXP0142MQRUGlCD0hlYJFHb5VBnWOih9m6hAT8Z2srA V09emsg6h2gCwsxUk6rFpQGfwA== X-Google-Smtp-Source: AH8x224/idqukyDqNWbUUFs74LTRLaT+VmWiiXXxsayPyS/cXKreGO6v1CsGSFB6UdudwBbbe7bGug== X-Received: by 10.80.135.230 with SMTP id 35mr14866943edz.1.1519651051784; Mon, 26 Feb 2018 05:17:31 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id g59sm7097451ede.19.2018.02.26.05.17.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 05:17:31 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 05/19] lightnvm: complete geo structure with maxoc* Date: Mon, 26 Feb 2018 14:17:04 +0100 Message-Id: <1519651038-16845-6-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> References: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 9 +++++++++ include/linux/lightnvm.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index a48950a37b8d..a8f35e8b7953 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -323,6 +323,13 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id, dev_geo->c.ws_opt = sec_per_pg; dev_geo->c.mw_cunits = 8; /* default to MLC safe values */ + /* Do not impose values for maximum number of open blocks as it is + * unspecified in 1.2. Users of 1.2 must be aware of this and eventually + * specify these values through a quirk if restrictions apply. + */ + dev_geo->c.maxoc = dev_geo->all_luns * dev_geo->c.num_chk; + dev_geo->c.maxocpu = dev_geo->c.num_chk; + dev_geo->c.cap = le32_to_cpu(src->mccap); dev_geo->c.trdt = le32_to_cpu(src->trdt); @@ -413,6 +420,8 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, dev_geo->c.ws_min = le32_to_cpu(id->ws_min); dev_geo->c.ws_opt = le32_to_cpu(id->ws_opt); dev_geo->c.mw_cunits = le32_to_cpu(id->mw_cunits); + dev_geo->c.maxoc = le32_to_cpu(id->maxoc); + dev_geo->c.maxocpu = le32_to_cpu(id->maxocpu); dev_geo->c.cap = le32_to_cpu(id->mccap); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 57d00644a1c6..e8e6bfd4d0d4 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -280,6 +280,8 @@ struct nvm_common_geo { u32 ws_min; /* minimum write size */ u32 ws_opt; /* optimal write size */ u32 mw_cunits; /* distance required for successful read */ + u32 maxoc; /* maximum open chunks */ + u32 maxocpu; /* maximum open chunks per parallel unit */ /* device capabilities. Note that this represents capabilities in 1.2 * and media and controller capabilities in 2.0