Received: by 10.223.185.116 with SMTP id b49csp8742570wrg; Fri, 2 Mar 2018 07:12:27 -0800 (PST) X-Google-Smtp-Source: AG47ELu9qrVfGtKjCRMDdqm9CmQE54ciKMW/lHBI9bIkW6QBsp7gCT4UEN9Zz3jIj45L3Aovfkgr X-Received: by 10.98.137.90 with SMTP id v87mr5991007pfd.80.1520003546928; Fri, 02 Mar 2018 07:12:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520003546; cv=none; d=google.com; s=arc-20160816; b=nWYAPJC1DWalqLrnu1Xz/Ps6jQfEl2R0catZPa4fFlbTRbYznagTSglu8p4gIS0+En eQvDawFn875jlVmJyDyr1XaWzZtWZug07CaPmU0BNtl5IzrOh6M5dY4Av7ctb3bNuJnX OcgdLAMAsImHXuT0YBaht2pSGUl9V3Wc1mC1VjuAfzU8KWibUfedXEJ7iOhFWGm9ZMYy llCpD4gcCi8TdWqWeMlgF+oEFjyMlHILSp2a99xtXS4r4kRBaHtv/10mP63W+nbIrL6P BPuupcjMxIeA6ARROD2yDctAkDYN9JnSYzsPI6oD4MQnXEM3i+TmbZ64cx61/m6nrXip KxEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature :arc-authentication-results; bh=xpCdTX0+QcZChTDKn3DfX3L/le7H6VfISOmsR2yoRo0=; b=MMXpWJtB1Sh28itC6+e8+d7aQWV79lf6+UlzH9kyydChvRKNStFML8jSnPyRpoUtsE 5/Kx1T7p4aKfl1i4dj79OISkebeHg6CmifS9rDhRFfJZ5LYMOSOe+dYLMwS+ZHyXAfo6 X0Vg5dcGXySdE8EbbuEwzXfWdxiMzKtVb9lO3g4KApjVMR8i+q49vCwaz50f589YR+Ix b3ho1/L4axoLmOr8tRKuhgoLVb90j3yt6C/XIKuV4da1RFrDjC94Nfi59ReoC2kmwyTJ kyIatZgoFNmQLEhe+YJUWIqxLrZfW2Xflma6gk3wTgRzQ2t+qVht71JBcds+b0VBF6pF Iefw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=qS8Ez55K; 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 a63-v6si4965670pla.44.2018.03.02.07.12.12; Fri, 02 Mar 2018 07:12: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=qS8Ez55K; 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 S967630AbeCBMAM (ORCPT + 99 others); Fri, 2 Mar 2018 07:00:12 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51356 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936298AbeCBMAE (ORCPT ); Fri, 2 Mar 2018 07:00:04 -0500 Received: by mail-wm0-f68.google.com with SMTP id h21so2688031wmd.1 for ; Fri, 02 Mar 2018 04:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=xpCdTX0+QcZChTDKn3DfX3L/le7H6VfISOmsR2yoRo0=; b=qS8Ez55KYMuBUr75+D0gtZzrVWggl1s24SD9dFkk/vb1FlUIcRh02jLWXwCd3lZNlE /pqfWQKLpXdPCKWjfHMyo+KKbIhnJlxnefmM0vpVBdEspfcqsfIgpbH6mVfpTxYMgtCV 0cFLCSChZ3cm2Sodp541w20JZx2qpG7WfBmNdcmeW2JDtp8Cvr1LdoZmkJtuKmI1coFf 0HswBLOdTmSmtIu+B3VumAc5eQsn/Trk+o5t3UmqWdYusRAC1WQ2gea5i9vF5BKY/iVn ZbLkj9rJJ7CAFpiuPgxyiqd1uMCK5gE1cv02rPrxXNFd0KIUvnmI7nIkmtlHWoJjwvq3 Glhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=xpCdTX0+QcZChTDKn3DfX3L/le7H6VfISOmsR2yoRo0=; b=OdpL5PrIMhoogKBtl2hj0+bQ+3d39cdb/6klxgIbFZdtjgsfX42iPgs6OMtM84Qkia Vrf9LY9VB3Ilu25I97lHOvK6CGZuff5nKvaaaWJuV5D3nb9wrIyoidpSTrONiT3UEPrp dgfXz9WMeieFxjbO9z6mzKhFgLrVSS/R9XnM2FrBdEcKcTftxzSwCoR4X9tQdkQm6ppu LRSeZheAzAgAjH3DpFyv4VXLrPYtNqhv37XG4NDlarBb1rKRW5BttqAk0npWVjzw7/FM rk51R0LGP0c+mvWMHEqZrE5HHxNW49h3ZsDpDdSiHKoZIl1UnYpBjB7oIUjx7q00s8X3 1fbQ== X-Gm-Message-State: APf1xPAOtD4VWhGYKVOsfXRqhWLwQZm/ZxoH5DaMVm0dM2GWO+RgElQN 0GgZRoAXjNT1z2iR91QyNPlMSGewLmk= X-Received: by 10.80.241.83 with SMTP id z19mr7051602edl.104.1519992003281; Fri, 02 Mar 2018 04:00:03 -0800 (PST) Received: from mac-halley13.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id j18sm3233889eda.5.2018.03.02.04.00.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 04:00:02 -0800 (PST) From: =?utf-8?Q?Javier_Gonz=C3=A1lez?= Message-Id: <7965F260-45CD-47F4-8063-33F392295950@lightnvm.io> Content-Type: multipart/signed; boundary="Apple-Mail=_C0B23A2F-F0E4-4840-B979-AE5C2F8FFA17"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH 02/15] lightnvm: add controller capabilities to 2.0 Date: Fri, 2 Mar 2018 12:59:59 +0100 In-Reply-To: Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org To: =?utf-8?Q?Matias_Bj=C3=B8rling?= References: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> <1519832975-25432-3-git-send-email-javier@cnexlabs.com> X-Mailer: Apple Mail (2.3445.5.20) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_C0B23A2F-F0E4-4840-B979-AE5C2F8FFA17 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 1 Mar 2018, at 11.33, Matias Bj=C3=B8rling wrote: >=20 > On 02/28/2018 04:49 PM, Javier Gonz=C3=A1lez wrote: >> Assign missing mccap value on 2.0 path >> Signed-off-by: Javier Gonz=C3=A1lez >> --- >> 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 =3D sec_per_pg; >> geo->mw_cunits =3D geo->ws_opt << 3; /* default to MLC safe = values */ >> - geo->mccap =3D le32_to_cpu(src->mccap); >> + geo->cap =3D le32_to_cpu(src->mccap); >> geo->trdt =3D le32_to_cpu(src->trdt); >> geo->trdm =3D le32_to_cpu(src->trdm); >> @@ -396,6 +396,8 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 = *id, >> geo->ws_opt =3D le32_to_cpu(id->ws_opt); >> geo->mw_cunits =3D le32_to_cpu(id->mw_cunits); >> + geo->cap =3D le32_to_cpu(id->mccap); >> + >> geo->trdt =3D le32_to_cpu(id->trdt); >> geo->trdm =3D le32_to_cpu(id->trdm); >> geo->tprt =3D 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; >=20 > Here is a list of capabilities: >=20 > 1.2 > Bad block mgmt > Hybrid command support >=20 > 2.0 >=20 > Vector copy > Double reset >=20 > The way I was thinking it would be implemented is to split the upper = cap bits to 2.0, and let the lower bits be reserved for 1.2. >=20 > Such that one would define the following: >=20 > enum { > NVM_CAP_BBM 1 << 0; > NVM_CAP_HCS 1 << 1; >=20 > NVM_CAP_VCPY 1 << 16; > NVM_CAP_DRST 1 << 17; > }; >=20 > That way, the assignment from 2.0 can easily be done with cap =3D = le32_to_cpu(id->mccap) << 16; >=20 > and targets and other don't need to understand the difference between = 1.2 and 2.0 format. I can see that you already have a way to do it in mind. I'll remove this patch and you can implement it later on. Javier --Apple-Mail=_C0B23A2F-F0E4-4840-B979-AE5C2F8FFA17 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEm1mT7zen+vs9+T8kYx8FO3WZGMoFAlqZPL8ACgkQYx8FO3WZ GMoSQw/5AYXtlBMYpgem4lSVvJqWIn3oRfLMnCK82eonCw52bmvuktvRLsxO1A4t 0sA/ku1k7isnnI4NbyF47Hl1+f4sdZZ6i8+okvytQjJcFz63Jg3Mn62g/gne42yO RSCXwpta1G0VEJoJog4YCdW+bFrFfd6pr4ZrqSokwY/NMNc9vARKKR8ysferXXPq fCym8rWZWuTxMjMmR1PwfGfcIIAOMgzqBcWOtvYqK8uhawiIae7XADQh5yj4fRiq 0AqpOAhMStpeXfFEtfjEjI+A/ds78qM1bBx27p11e0pnkZxaSfdc7A/mMADOzf8Q w9HFLPJ6h8qqBHjAF/y0wF8oEgImw5XtDKPBczv1rEnmmxBxauebiUB5xQHU33MF c2ifNvu2HdV/4SQbC9d9nOANV5uP/cYtgpxpv21GCpMvHC5Vdb9GbqHumiJSRpOZ ogJSL6RcA6Gft+e7LSqACsA6/WSKC3ay7Qo9Y3Ud31YUq25AL9MMf23NOA1sGCdz eShM4FlY+WUQFOfFulUBj9OoLK+RSqDNA5PIN0IqacUbKdqzzg1/SyGM9ri/zViQ s3vDH+9b+7wuBac3zwIDKQkxApgWd+eOmH7eEWeJJRH42ZRbiliOy5/sm/bkszNl i/e/YPKu+SBMe1qB/Ow2rtJmWUUPtYzY4xlKdm9Wsj+hrvO5CQA= =bWAG -----END PGP SIGNATURE----- --Apple-Mail=_C0B23A2F-F0E4-4840-B979-AE5C2F8FFA17--