From patchwork Thu Mar 29 22:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316519 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 6CE4F605B4 for ; Thu, 29 Mar 2018 22:10:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 580AE2A546 for ; Thu, 29 Mar 2018 22:10:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DB992A547; Thu, 29 Mar 2018 22:10:44 +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 F23922A542 for ; Thu, 29 Mar 2018 22:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbeC2WHd (ORCPT ); Thu, 29 Mar 2018 18:07:33 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:46387 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbeC2WH0 (ORCPT ); Thu, 29 Mar 2018 18:07:26 -0400 Received: by mail-lf0-f66.google.com with SMTP id j68-v6so10302841lfg.13 for ; Thu, 29 Mar 2018 15:07:25 -0700 (PDT) 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=JRpGHc/itXMOesl8k+degU1rkICCG/KNSzkmVROUKQg=; b=fhv74EPxpR2GgJLRBv7auxhmow2ylH/s1nKwZkkc/Z2DKGs9zVdm78F8yAlZDtuR4w GWXPlJH9MnNEcFr+XKGyEkK1hvAk2bc7M1B3hwZvbPZZv8p4bETBKPNnm2rIvBnjcW1t AKoPknNM9XcD8yKgNQHDkJPxTQhYDOLJiC0VUS47j264CqQ1osijTtIjpxcUaqgzQhqc czb0mQN/hyGqybZ6NjF/i6ZTw/weHBaNj2cJV2yb3FSg/VXLvZZWrVfzBHAG0X3b7ORq ZvS9MxnOKTiAJP7WX7Jez6cKDyoNaOq4IPSixwg3IhsLlVB7XFW/FX4qIJHQ3OTIYSl1 NOnQ== 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=JRpGHc/itXMOesl8k+degU1rkICCG/KNSzkmVROUKQg=; b=IT3lNsvFIM4DcKE+GBYgBl+TKufhbqfkmOpDv28EyQMVandmOZt0Io7jgP4sAU7UXg upVn4nbZ5DgK3HkTfHbBPTMrIZjko3r1kad7fVOJ2d3jg6BUEWbw9BitzR8QFxt55iW6 tD8jETPxDSK7jzOOElmKeLg1bdPvN4Mmz4Ys4tkHIJkhFzTrS9XiuweWWHnN596jaVMS IsBgDKksFUGGnImjgE74Rspew6BhHG0WcMk108G8n4c4secbDYsKAV/p79HABySlMqZJ Ckz0UCHi516bjdnqFJnEsJ0qii/xrzV2bCpMdJ8dVuZQDJyWRMeTcLPwdEDww6iqQH2K O6Ow== X-Gm-Message-State: AElRT7HrsSlxtTR2aLOhQq4l1/OpEbjGwR+pQNu8dZ+T7l2BANhTqjNv 02bVfgeN7VARXBFuAVSsqW+52w== X-Google-Smtp-Source: AIpwx4+wGNm1Zenb9g5dkG6wAF838QpCrnIGgt72E30fG78iJ5VNJ4tsRJaSJ5DEQGLL3UG2R6iW0Q== X-Received: by 10.46.23.202 with SMTP id 71mr6444138ljx.49.1522361244910; Thu, 29 Mar 2018 15:07:24 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:24 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 25/37] lightnvm: add shorten OCSSD version in geo Date: Fri, 30 Mar 2018 00:05:12 +0200 Message-Id: <20180329220524.30363-26-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> 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 From: Javier González Create a shorten version to use in the generic geometry. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- 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 de4105544956..f7f7769e7588 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; @@ -384,6 +387,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 7ed8b92d6744..a073c0c76260 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 */