Received: by 10.223.185.116 with SMTP id b49csp6429178wrg; Wed, 28 Feb 2018 09:15:02 -0800 (PST) X-Google-Smtp-Source: AH8x227X1isLOxEsWXs9M+Dph/8ARTY96d7krcmxOngspboI4FHh834oIpMdjGV/4M967MqtblUt X-Received: by 2002:a17:902:6589:: with SMTP id c9-v6mr18494947plk.51.1519838102089; Wed, 28 Feb 2018 09:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519838102; cv=none; d=google.com; s=arc-20160816; b=r2QCMz3kQasJ/3dX4G3clcbQJJn36DfjxeBewvYe4CN21WRZlR4Sb8hQmFLV7K6GGm WPdG9gT/a1sjK4AKzJiXIwxJWfh7vPNyXDMZTZNJ9Z6OIjnN8cfXwZz/iZvBpPHDiqmA uOIlpKNtq6mlLRQ3pHqwogG4R1cvGIvoro3NEPnzZ7EpenHGkOyqdH0Ll7nzr0YLdVK4 NkIsePYPymTTzwa2wDktVu56jwtu9c0jycZHa+JP9y/qiKTbkLT5wh3YvRtMVeFY+FGs gF620xg9V12VbSNaw2ucWZe0Bi7POZYU/8lE/djW6vb9hktloV8kFZHRHOCf3fLE/Z+i TvdA== 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=GVEvu6+3s7vxej83uZK14UehmP7Tld3HA+gko4QgnQ0=; b=a5QOLmE45kXHpHfbiKs6xRQeqeV3mjV7Wc5vRR/TGF0blCmnXbJYb4MXQhk9BRUrPx GU8hOE9Imx0kWDsy6Zf9/waIy7jQvw8zlzCjJxkzKyin7N+tAVyUCFflau6WDYJOJPrL SUNrJxa8hGMuMCeNx7cSqtRiCFY2NKc34FNfS/pT+pqvVwaXKsi+bveCE1BUeBNfPAyS kAX++SHmVsYZmu1nlXx8BqbFSswoe05SsBaXEh+d3mdVW4wto2b4OKpmY0sE7byJobTh yUoXKdLYl+Ti3mO6Pre2FjglM3PjRJDChyG3+FDxyz3VEIkvlBUzFoQknOSW96GRlY3K XOeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=Phsc7n7A; 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 q7si1241729pgc.69.2018.02.28.09.14.46; Wed, 28 Feb 2018 09:15:02 -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=Phsc7n7A; 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 S933739AbeB1RNi (ORCPT + 99 others); Wed, 28 Feb 2018 12:13:38 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40008 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbeB1Ptu (ORCPT ); Wed, 28 Feb 2018 10:49:50 -0500 Received: by mail-wm0-f68.google.com with SMTP id t6so5956714wmt.5 for ; Wed, 28 Feb 2018 07:49:49 -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=GVEvu6+3s7vxej83uZK14UehmP7Tld3HA+gko4QgnQ0=; b=Phsc7n7An1IjO+BON41bXRPGTLMyFfOZJZfkghhgYMcAWm3YEheVhdMbrPXbT2lpLT mPdWfslMV/Ki8PzIgnx9z/0VhTGe5ConuriWXzvVUm2kJiX9Mo3WzHo7RHx1X9owepN/ e5CY/fE6RjE2/lJT2pPqG2QTDCwKu1414oJSIVluYPxqv4+renWi95o6hoxnzPw09SdP etzwUse89BVBCbf2oexaWU1WFor8CwlaBlMCSN9tmv2z8PGoNKVV8l1ZHIN/+WdiKsSC Oy/RGhZNLCQqQbY+rjMATg9fdvh+m3AfIpxOVDCVu3PLd2dObEHWmUz5JQna8pXLUTPz i7Qg== 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=GVEvu6+3s7vxej83uZK14UehmP7Tld3HA+gko4QgnQ0=; b=YzMmrc8AjH694IuEBi0gm9bUrRcPWZMCssBwxmfSq1kn1UK29wg/GEjyd0kCWypjcr Xa1XMkw8vAerAosNC8YZ8NA1h1ftyP/f/JXYHFLG92BaoJuFtEim53rn6oPYgvTgEGAo XPupl+fr1N/U5iVmFwI59HqDV/2XoohYZtRwXXChHNJYBHqcQs2BO8BT5ICL8kM470wg eYjNbdWQm9rr5JlYvAPFpmpPHRl0qq2p6zTESN9UHVSbMUZZAtKtUWOv3Joq3RAqaQoH 9onKqmd2yJYHHN9zXXqkDzVj4AQeugKEHPR58EGUL4UoeCIGXGmlWYyInE5IaNrRkzpe er2g== X-Gm-Message-State: APf1xPDhsyP+gur5ZSxHIU0MJHNJCzzo3h9qrXpcQeBPT64YiHpMfSDl HAyupy05GTHDYxTC8hP7yOwUtUKR X-Received: by 10.80.215.74 with SMTP id i10mr8274404edj.95.1519832989178; Wed, 28 Feb 2018 07:49:49 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 07:49:48 -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 02/15] lightnvm: add controller capabilities to 2.0 Date: Wed, 28 Feb 2018 16:49:22 +0100 Message-Id: <1519832975-25432-3-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 Assign missing mccap value on 2.0 path Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 4 +++- include/linux/lightnvm.h | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index e276ace28c64..5b2024ebac76 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -318,7 +318,7 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id, geo->ws_opt = sec_per_pg; geo->mw_cunits = geo->ws_opt << 3; /* default to MLC safe values */ - geo->mccap = le32_to_cpu(src->mccap); + geo->cap = le32_to_cpu(src->mccap); geo->trdt = le32_to_cpu(src->trdt); geo->trdm = le32_to_cpu(src->trdm); @@ -396,6 +396,8 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, geo->ws_opt = le32_to_cpu(id->ws_opt); geo->mw_cunits = le32_to_cpu(id->mw_cunits); + geo->cap = le32_to_cpu(id->mccap); + geo->trdt = le32_to_cpu(id->trdt); geo->trdm = le32_to_cpu(id->trdm); geo->tprt = le32_to_cpu(id->twrt); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 16255fcd5250..b9f0d2070de9 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -288,8 +288,10 @@ struct nvm_geo { u32 ws_opt; /* optimal write size */ u32 mw_cunits; /* distance required for successful read */ - /* device capabilities */ - u32 mccap; + /* device capabilities. Note that this represents capabilities in 1.2 + * and media and controller capabilities in 2.0 + */ + u32 cap; /* device timings */ u32 trdt; /* Avg. Tread (ns) */ @@ -304,7 +306,7 @@ struct nvm_geo { /* 1.2 compatibility */ u8 vmnt; - u32 cap; + u32 mccap; u32 dom; u8 mtype; -- 2.7.4