From patchwork Mon Feb 26 13:17:01 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: 10242355 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 65F77602DC for ; Mon, 26 Feb 2018 13:24:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 551672A007 for ; Mon, 26 Feb 2018 13:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49DBA2A00B; Mon, 26 Feb 2018 13:24:26 +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 E08B32A007 for ; Mon, 26 Feb 2018 13:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753363AbeBZNX7 (ORCPT ); Mon, 26 Feb 2018 08:23:59 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:51089 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbeBZNR3 (ORCPT ); Mon, 26 Feb 2018 08:17:29 -0500 Received: by mail-wm0-f65.google.com with SMTP id w128so11410792wmw.0 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=h+KZr5Y7Yd/35MBOrW9buBvAoZrMz2RKkkKRE6F9QsZgeKGqKkXC8CUJv4X6qMEtUY YuPAN3gtdF3iV1CebEdY8LNZLGEngc92oi72XnXB5xOO41yPdIRnMRxP3wDGnZ2wCWk0 /L232AQjwSPmIGqWih7SQaU1Kn7fOaCKp53gPpbvsfkNVRjh9amYElGuxMMEC3J8lMF3 vt9CwKa+3s6o+EEIT/A9foJyhAEZu+QFgBztHGYMg9S3UJYkBSjEBOD16HVr9umvMXkN beHKZPJ8cBS5mlobua3P9MxUVyQZJxJM//SX1x63z1zg1Fqb2Jz+Q4rDTRp3Jm8pnGkK wnvQ== X-Gm-Message-State: APf1xPA3wwj4j/e6OpEnlB5EjFbZ1s9+jEU5bAUhxpYqAlky748asdJE Z+xiu+uKDLbrn6HbJKB7sM4Uhg== X-Google-Smtp-Source: AH8x226+0OkZkGFrTNxrB82o/cVQpqXQ+UaylFr5kYLDEjQzVsdHm5lxMb8Q7PDaVMnw3aR6DbXHdQ== 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 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 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;