Received: by 10.223.185.116 with SMTP id b49csp6340125wrg; Wed, 28 Feb 2018 07:51:15 -0800 (PST) X-Google-Smtp-Source: AH8x227WjrQpM9mjwGC0oexPTU1RtvTK2FRysUHLSykFhWyjxxNCNyvKjfYzDg53mWXi5dyCGL01 X-Received: by 2002:a17:902:64d7:: with SMTP id y23-v6mr18335425pli.258.1519833074976; Wed, 28 Feb 2018 07:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519833074; cv=none; d=google.com; s=arc-20160816; b=hEt6z7Hg9DJsISddG3x+mrk8q+CMQuhnH60N9sjMoQFUQA5IKrhKJKuT6GZVBtLgaS Kzx+FpLoCibiQlMfFDhwy2dcrR2RKt3q+lvGrGYJZrJWFAMbmynj3zqYNUCVyBDMFRQL dUi7vSMFYIYEFgDSs3AcK6cQD52z3Sy9d5ZGf6tqrqWDSxhXQ+HJMZ7UMlcHxUMGfr5z hKhDOnsqcihZkpwQITH93HHbeX7qsepi5FsgDLxyOityPdiYKdYyb3Hu6jl+WJYYgW6L eqF1gKVn7XzsrC5QFLG8rCl5uYLUSmmwMEkQ4r+jMWxf7nQkri+vrWAFqpZbf0UZvuIR JXvw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Pt/2h4sismy+ISAM1cty+lqWnEF5uY6BKaeG/peDARs=; b=eA5+z8rwGyavSpJXbCy6NJJD4JR+X/nEbRdd4QesG+dfcVFAOiCWJ0td+lZq1gNp4E /9DP1a9IjXnPqdn6zb+pfFPSomEUWgwDk/wB8s4bwgp0Q2KYCgYFo9RVzxmSRagD/gGu 1MR2TS8QLGVguRb3YwhoUagFEIAWlZQEukrj5NYCpEozUFBS4k1RCn4FHawsMTqP5r7l VG3Svmhl1TjtDV6ywnIRUE3tj6jPfMCpYX59a4xsqk7JKZFvGh5p/UZT49UM8W6OG/9E 1lSEHtKBcusYqp8vP+IFGZJd7RzynC2TFP26fwj4PnvGTGTLUIhGng5jxAtMu23+mESv MAGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=vvob3zi1; 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 f33-v6si1460854plb.482.2018.02.28.07.51.00; Wed, 28 Feb 2018 07:51:14 -0800 (PST) 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=vvob3zi1; 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 S933626AbeB1PuA (ORCPT + 99 others); Wed, 28 Feb 2018 10:50:00 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40015 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbeB1Ptw (ORCPT ); Wed, 28 Feb 2018 10:49:52 -0500 Received: by mail-wm0-f68.google.com with SMTP id t6so5956926wmt.5 for ; Wed, 28 Feb 2018 07:49:52 -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=Pt/2h4sismy+ISAM1cty+lqWnEF5uY6BKaeG/peDARs=; b=vvob3zi12ivO+J45rTy1s/TPkqFlhE51BN4kfyfXSY5Ju4B3pLXMvJkwDNEtc3QCfX I7R5+Xv1vKEU0TGiI2WvziEeh5DzciUDk+ZjG9Tjb/6JH3hNk4lso5V+cz19eLk2xgGh N5+eduUm3moImQv8kz6GDoG7EivF2uCaBtcyXiQeAkyJB4HXvaKn5K6/DXpzyQcM++HM R2sGD4TGvKWrO4UTOyJa6pqUYGSoDrc6u1aPQd2jAbgFS0nswipIuE5D8W8qVUMITiXR ZfHwB4irSkiZcFQR/mPwNwUl2Qd0a4fWDFuVxRm3ptMCgKvuUb4Z2t3fmyftQpH1SOmP LNFA== 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=Pt/2h4sismy+ISAM1cty+lqWnEF5uY6BKaeG/peDARs=; b=sN9m8mi7jGbwusZxRRrv8reHlsteau4fHb3rTMK4dWERXznwnT85oq/3BeflTh3wiK 1m6cOcfmiaw4mKQIojVkKbZEFXxHLkAIpLYV98TznfecxLQ9FRrdmLCIyoooFFef0uJ/ SZm4jU8cC7rTyhoF1sLfyS03zgRD5JVcEPVTiwZ7Bxa0Fga7GLmnjFWHmSYtRMcDzjNO FeFaEI6/IQporTDa/1pQZFnpEZTbw5P7fJeHPU1nry7xpQYY7TcrJh504AULRW1usYki W2VgrJWf5Bn/rIYfR83iifKFEV7egZ2c95qWIvPLZA/VpWk9gOSUj7emQfUHT5dgEkBz J3ZA== X-Gm-Message-State: APf1xPDjmmaE4LgkqOB747g4W4FTWhy6Wcys28WNaYok6jt/17ck/fwh Pe4qdVN8T/7oYMWtdZXPQHi6xA== X-Received: by 10.80.144.119 with SMTP id z52mr21645edz.128.1519832991413; Wed, 28 Feb 2018 07:49:51 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id n2sm1953056edb.62.2018.02.28.07.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 07:49:50 -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 04/15] lightnvm: add shorten OCSSD version in geo Date: Wed, 28 Feb 2018 16:49:24 +0100 Message-Id: <1519832975-25432-5-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> References: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 a600e70b6e6b..85f336a79cda 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, geo->major_ver_id = id->ver_id; geo->minor_ver_id = 2; + /* Set compacted version for upper layers */ + geo->version = NVM_OCSSD_SPEC_12; + geo->nr_chnls = src->num_ch; geo->nr_luns = src->num_lun; geo->all_luns = geo->nr_chnls * geo->nr_luns; @@ -385,6 +388,9 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, geo->major_ver_id = id->mjr; geo->minor_ver_id = id->mnr; + /* Set compacted version for upper layers */ + geo->version = NVM_OCSSD_SPEC_20; + if (!(geo->major_ver_id == 2 && geo->minor_ver_id == 0)) { pr_err("nvm: OCSSD version not supported (v%d.%d)\n", geo->major_ver_id, geo->minor_ver_id); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 4b2ecbf45fd9..b8bc158a2472 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 { @@ -266,6 +271,9 @@ struct nvm_geo { u8 major_ver_id; u8 minor_ver_id; + /* kernel short version */ + u8 version; + /* instance specific geometry */ int nr_chnls; int nr_luns; /* per channel */ -- 2.7.4