From patchwork Wed Feb 21 09:26:44 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: 10231671 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 769BA60209 for ; Wed, 21 Feb 2018 09:31:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E54A28AA6 for ; Wed, 21 Feb 2018 09:31:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7316628AAA; Wed, 21 Feb 2018 09:31:56 +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 0B86E28AA6 for ; Wed, 21 Feb 2018 09:31:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439AbeBUJbK (ORCPT ); Wed, 21 Feb 2018 04:31:10 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35417 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753299AbeBUJ1R (ORCPT ); Wed, 21 Feb 2018 04:27:17 -0500 Received: by mail-wr0-f196.google.com with SMTP id l43so2452161wrc.2 for ; Wed, 21 Feb 2018 01:27:16 -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=BGHgzxQCnBTgF8iuJBIhSCsGxhzW9gFDph8jMUa0vZg=; b=isxzgqYYqCWR9koK5KoZKHE4A8lXHI98R55dFtF8PHXfIyNDgFnENQcyM5NUm6a/n1 l2ytNEnFLMmdS2h1ubi2uY4Caf2uZd318upen4rQceWGjeihXJYXOxak4w0EL3ylQ9OD RiHzaaPmvTvQZjQeCFEL7FuQdJByS3QhTeyDS6WKB+wnJvNIduDiAIE+Br/OGDdMnEHO oXQVnbssFVuArm153ytpmVnUyE8fbmanQbHmecEXACqKGYWwwN7ya6rDIeSyTOdxZv67 Vr8xUu6PZ8T5G4kXSBo+xwtWTw5ut+PTvZcVZbKSJM6QQ+WylANDoXyyLoGXtx6inS92 y5ig== 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=BGHgzxQCnBTgF8iuJBIhSCsGxhzW9gFDph8jMUa0vZg=; b=ifaUZITtqUB4+U6aXKNBvJJZKbKG09G4PX7OAJiXaDPXyyZZs/GtySvQSDhtoPrNxe Df8H912D52oDbciDDRoX1Me3H73tokGamwCNuDYKaan5rPEUjQhM+bnAElQLaetp2LT+ aj0uLFeOg9S1hFXJLeT8cYdmEjkM/B0XYrfIEyy8oy//3l7Fpsxw10g9WjitzrUPquSw Q62RKD4p+uN1QXrIgBCiDa9YjolBOByIuCrAKCaquswFvp88Sk6fA20GwisC2vStRrFF QURWDcPTZg3x1C2EqwGm2PZojKDj6NpQyVjtYEcd8Yx9dj+uepXefMf3ZHbdmXrARPLd ReYg== X-Gm-Message-State: APf1xPB096cwQRDKoT0vwxUqECmoM/w6lgdPJ/KWOdHkF1HTuOYleirA FSVyCXSPpMqbUILxM3025sICVQ== X-Google-Smtp-Source: AH8x2278SGj981086rZQn2ov3hVr/Gs6VB8u/jcrfh8OI/ZzAsA8/DU5CIHIq5lHsK6BakPkD689pQ== X-Received: by 10.80.169.116 with SMTP id m49mr4139146edc.212.1519205235940; Wed, 21 Feb 2018 01:27:15 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id a17sm3389955eda.42.2018.02.21.01.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 01:27:15 -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 06/20] lightnvm: add shorten OCSSD version in geo Date: Wed, 21 Feb 2018 10:26:44 +0100 Message-Id: <1519205218-26994-7-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> References: <1519205218-26994-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 Create a shorten version to use in the generic geometry. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 6 ++++++ include/linux/lightnvm.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index f22331e61cef..bd97672e0b4f 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -299,6 +299,9 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id, dev_geo->major_ver_id = id->ver_id; dev_geo->minor_ver_id = 2; + /* Set compacted version for upper layers */ + dev_geo->c.version = NVM_OCSSD_SPEC_12; + dev_geo->num_ch = src->num_ch; dev_geo->num_lun = src->num_lun; dev_geo->all_luns = dev_geo->num_ch * dev_geo->num_lun; @@ -381,6 +384,9 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, dev_geo->major_ver_id = id->mjr; dev_geo->minor_ver_id = id->mnr; + /* Set compacted version for upper layers */ + dev_geo->c.version = NVM_OCSSD_SPEC_20; + if (!(dev_geo->major_ver_id == 2 && dev_geo->minor_ver_id == 0)) { pr_err("nvm: OCSSD version not supported (v%d.%d)\n", dev_geo->major_ver_id, dev_geo->minor_ver_id); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 28d429e0a1c9..02f1fd617781 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -23,6 +23,11 @@ enum { #define NVM_LUN_BITS (8) #define NVM_CH_BITS (7) +enum { + NVM_OCSSD_SPEC_12 = 12, + NVM_OCSSD_SPEC_20 = 20, +}; + struct ppa_addr { /* Generic structure for all addresses */ union { @@ -197,6 +202,9 @@ struct nvm_addr_format { /* Device common geometry */ struct nvm_common_geo { + /* kernel short version */ + u8 version; + /* chunk geometry */ u32 num_chk; /* chunks per lun */ u32 clba; /* sectors per chunk */