From patchwork Wed Feb 28 15:49:22 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: 10248841 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 8675C60365 for ; Wed, 28 Feb 2018 17:13:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76FE72876A for ; Wed, 28 Feb 2018 17:13:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BBB528DFB; Wed, 28 Feb 2018 17:13:57 +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 225C32876A for ; Wed, 28 Feb 2018 17:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933725AbeB1RNi (ORCPT ); Wed, 28 Feb 2018 12:13:38 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37719 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752855AbeB1Ptu (ORCPT ); Wed, 28 Feb 2018 10:49:50 -0500 Received: by mail-wm0-f66.google.com with SMTP id 139so5991293wmn.2 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=URN9Ofyvi2jDmJohJWAgC3BMnSg4wC1W21ZYtIlZskUsvYsDOa5KxFEuJO3fJ7Yy92 Al45Omqd0SdjOl/HAihnPuwRmVAVGp6wnDATG4z2EVt5KJ/++9m8cLqmDxJFm0qf9Gci lOL5PH2x55sU3rmIVHVA+m0KTOdi5leIIIGKGkPrtmyZKQgegoEW+KP+V9/IU0mrqn5y lSr7xyBrGla36v1Y7R8QTiOBSxa1lxm+pNx3+cVldtwKYGzpVFdFlzp1cE9tUXUU7JRY xljzkYfnH9teg8L8ygmmrvA60ThMM4+zRzbBx3buPyaCktcpFkCRsu8MSF621YzkXJTz bmWw== X-Gm-Message-State: APf1xPA61Cwne4Z/Y3kzCjBCMjGR+VlWX6Wlz3KH63Zt8na+GaM+OS1s FtQ6AsetJ6gHtVFYASLZ5lXN7w== X-Google-Smtp-Source: AG47ELsgrZzbAn7DMYLZ9gtDy/VgsNfKE8x/45gj3l5RZHErEpb0jhKh2gfqbzabgB76peVu5zdWBQ== 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 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 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;