Received: by 10.223.185.116 with SMTP id b49csp3742687wrg; Mon, 26 Feb 2018 05:25:26 -0800 (PST) X-Google-Smtp-Source: AH8x225s8258cQwsUTn697CbTXaUXr2n413O3L76wvUXwgnlVlKJjKbM9PETNwKNi09LItlsB5M+ X-Received: by 10.99.126.17 with SMTP id z17mr8456344pgc.218.1519651526556; Mon, 26 Feb 2018 05:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519651526; cv=none; d=google.com; s=arc-20160816; b=jZX05CodPjAGSW0mRCYY5c3Ayl83gQxQfB4TWINd99eatbwiUi+eRtNyf2iAv/5Sdf W+LUzi2iypD94I2n4GAm91w2gf3M5quu9h+RgNSMxbmPwuVUeWIiXUrNWCdv7xTNa7AR aaoGOkdZtjHs32hYxyFk0KXqnf5B/yK4QwezPdV6P8T0nnhCS4izwYxySBGF/foVlH7+ rSGlUmBlNvYQbd7oT7cbflgX+qvk4RpCamsrbjB2vFBDbsa0enEqh34z9QWmsBuUOvhQ BlmS5NL2PhId5dryw0SIMhOmxSM/2Ceh57eMGR4MGVN1k2rc3nWvMO6VflZRHhPPiad8 KHqQ== 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=EKxCH7L7NF2WIXe6/S5Nxrff2BdlLUXYBALvnINgH20=; b=p1OVrh3Oyc2eUgbFGiyDe+EjgMbWhB5TWBd9Ry1MEQcz+U+9jZZvNekrTABhZ1lf8V LaVkKQoeL0Xuw+0qeqqJvKtxW4L7Z8fFRGOJps1uNgp7kT9xhpPgbnkCSqt3cYC+l96v OVUXWBe4nxIJ+0tY4RPt7PeW+Wlwv+HgE5SHKQ9QpHGdBe9nEj5fEDAbtI3hc1n7M8Xb /Xm9nKll8SCu0p2DS4CMhUuRfqlCFKU2EADOV0/aH5fjH1w82lKBlFOQSZzSMWL4N+ix xJxSH8RQ/PiMXukMIdpRKdxIngpenwXYw4Bua39xDHt95qFGaXEOV5yxhDfLlbnB5Gwe h2tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=MM1K1CVB; 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 b81si6751123pfj.331.2018.02.26.05.25.11; Mon, 26 Feb 2018 05:25:26 -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=MM1K1CVB; 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 S1753649AbeBZNYF (ORCPT + 99 others); Mon, 26 Feb 2018 08:24:05 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52437 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753038AbeBZNR3 (ORCPT ); Mon, 26 Feb 2018 08:17:29 -0500 Received: by mail-wm0-f68.google.com with SMTP id t3so17392207wmc.2 for ; Mon, 26 Feb 2018 05:17:29 -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=EKxCH7L7NF2WIXe6/S5Nxrff2BdlLUXYBALvnINgH20=; b=MM1K1CVBPWzidGyOsd9IjdNoRxJGUOHJvn3DqiZR4zQfNTj10wyrX63UF9Fsm4D8La 5XRQY4hTjAu8Mkv4L5DNIY4yfkbHy4il6gKGLX/DL+NlTcIu2mzENakFGi0U8xj20DlH 9h4TWb3L878MmuCqy5KnFexRGJPLVb6ta3MZcCGP2JR5IOkTminUZv9tiDfe7XI2um32 TIdOkYbLTSvQgkEvVEhd8b1xZg1i9OZnCrVU/slF8l99dhtsn2C3231HjAxqSkidT86s iscFL27VPa0dyNadRE6i1FhS4VnjPWe3k8QFuzK3UsHGm24X34ypgHroRplbEemF8hfD e7Jg== 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=EKxCH7L7NF2WIXe6/S5Nxrff2BdlLUXYBALvnINgH20=; b=qrF8LGtipSzzSfQSqxenQYEc4cNaxfH5hNkn0z8P09Ng1xu51bSYnYH4RigjKTH33C skiZJSakgu4Y6NXWc+PIpGHIvL993G0AXL9zvTQMl/ZRjFZ3lV3LDjqoVK5ipmWwwui0 6UNL6fY22mrzaa2gmANFWkbZdfjSFB9tcahDtWs4IkqbdhFP5udkgaMc1kOYml+5h7Ps KtxYxleqRW+atnifhuFsWGiYigFapxfN+bTqieXfJe+3Sp027OrtscKBoKYW1SpilhAJ lpDJI31YvbwvVNV1utLBSgutoxurRbt5oD5VbBehCIxVEAxe5KjTTaP4Hx/ttmw8ygXw ZHJw== X-Gm-Message-State: APf1xPA2/ODcyNIecCEsFQUgROFXoTo8Ak86Z6+CJadzOZfS7sMqMKtn AB07E68EoC4SnMHXpseXtzBEVQ== X-Received: by 10.80.136.85 with SMTP id c21mr14392758edc.259.1519651048563; Mon, 26 Feb 2018 05:17:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 05:17:27 -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/19] lightnvm: add controller capabilities to 2.0 Date: Mon, 26 Feb 2018 14:17:01 +0100 Message-Id: <1519651038-16845-3-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 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 8f541331b1a9..10392a664b50 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, dev_geo->c.ws_opt = sec_per_pg; dev_geo->c.mw_cunits = 8; /* default to MLC safe values */ - dev_geo->c.mccap = le32_to_cpu(src->mccap); + dev_geo->c.cap = le32_to_cpu(src->mccap); dev_geo->c.trdt = le32_to_cpu(src->trdt); dev_geo->c.trdm = le32_to_cpu(src->trdm); @@ -399,6 +399,8 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, 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.cap = le32_to_cpu(id->mccap); + dev_geo->c.trdt = le32_to_cpu(id->trdt); dev_geo->c.trdm = le32_to_cpu(id->trdm); dev_geo->c.tprt = le32_to_cpu(id->twrt); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 4537c0140386..42704c4ca9af 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -273,8 +273,10 @@ struct nvm_common_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) */ @@ -289,7 +291,7 @@ struct nvm_common_geo { /* 1.2 compatibility */ u8 vmnt; - u32 cap; + u32 mccap; u32 dom; u8 mtype; -- 2.7.4