Received: by 10.223.185.116 with SMTP id b49csp1610938wrg; Wed, 21 Feb 2018 23:31:09 -0800 (PST) X-Google-Smtp-Source: AH8x2246ual/hibPO82xwBInigjNLdaPyBLs0/S3gIdzadLf5Cee9vwnwqHWJnCDVzQLgCQN0b22 X-Received: by 10.101.75.140 with SMTP id t12mr5045486pgq.442.1519284669357; Wed, 21 Feb 2018 23:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519284669; cv=none; d=google.com; s=arc-20160816; b=oi5uKvZijKUwR4GG80b4irEYAeY1UDOcabamERr7JB9MkLRG9gAcmMLGm7zvWeQAPW l+xeJDFdNUwFrIkGUXL9VABIKKom97ndlMz7CHUK7bpmSq1a0e76TCntGJ2hRZ5HgYVo Rsx51FQSUDqPqFdjsKw0O1LtXiGv1OsUelL3s4k0tMadvXSEO1u0GvyAR8OikNHz14lX DRNjDfnfp0B7TtOBLqXaQAApjr6pwU0lKHWUiRQKOFlcJJOF77ips2W0tp8hcFEqmBLp 6Htw1dzdMNacQk+Jg8XiWpj+NWueKE1H2Ks4VBn38H+g8ey5w9hF0QCaH8w9Dh5V24gN VBHw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=txKNIBqkDeuOEuZqlFlAg74q3skT4j1lPp462FNIIt8=; b=RsL5XtrtZhCCzlO9PzL1I8OaOcmH5xhfJvFHRRvUP2gfCtnOeDxMTINSCezBS49wE6 ORXLLDs2/I3/ZMI7y9QPZAOjep+Si67erBSDbWgnvL+CFkzn1Qql9xi3e6vBQU7/O2Aa buoZQ/0ctiyVqaQuSRFJc2FKu2QcJmk+aH7UpaghY8CBWU6WgFm4QUzKjFCG8K7r7TKk v5qdbMM6B8o5R3k5eYCKGNcnufIGfUQmEuV3jD2o+Tvl5PkqIgr+zrfYh8aL2s2gGYYI eAVXDjVx4wvrQ/Hi0cNXyfpDa8XJgfD3bvd0bN/X/dqrvTXwgFepei08y73diR66Nb97 Vufw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=2JzVM5VS; 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 d86si3036777pfb.335.2018.02.21.23.30.55; Wed, 21 Feb 2018 23:31:09 -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=2JzVM5VS; 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 S1752584AbeBVH2i (ORCPT + 99 others); Thu, 22 Feb 2018 02:28:38 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43967 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbeBVH2g (ORCPT ); Thu, 22 Feb 2018 02:28:36 -0500 Received: by mail-lf0-f66.google.com with SMTP id q69so5978366lfi.10 for ; Wed, 21 Feb 2018 23:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=txKNIBqkDeuOEuZqlFlAg74q3skT4j1lPp462FNIIt8=; b=2JzVM5VSs2js5qJW3U3+LDTFt4TmdQXHneMTdjumJLxQ95hsTTziLUIrbI8jKHcX2m kgdrkdakWVzhxY1mdyO39tbi1ZtHwGqaSc/AsZ9SC2lNYAeiVNbsMezxZBUyXaR33Yx0 CzkIdXmnIIV2i8FOErMco6oVlHjXUoyk1sPWZQXkJffjT/JAhTJDe4iV9rUCkacu/4vh Fu+LLrxpDQ3UQASJag/NWi1CJV4499+hb5DcnQnOHDuLJOJ5bjvrf8d2ZwPuMxLWMH61 6HiRBy/I+8N9EN8u8Fh1Ph3sELcyS+6t21hoPhHmUWIzKC4BmkUb4RrvAIITjb3jCwe2 AHjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=txKNIBqkDeuOEuZqlFlAg74q3skT4j1lPp462FNIIt8=; b=FKd2pCs4ke1aQjy1EMCiwHLbqcK5+MulkCzwV0BCRH8mAAiS0MtgB6eRj/W/LSZMd/ 9cV49ES12uOs45YVXRstBqewKVZlxzqZhv68hVp9aXhFVEwy102oEIVyQQmQJdyF+Jzz H5p8tc3F9ZAP9J09Pjs7uPuBt+oEmYO7wn08t6f53FhlSb/90jeOL1Q5Fd9KBCGJOyaO U97xGV8qUlMJmLO5j14JJCN/x0rypBkEaokfJLeIkDwsbOUcf1lj7K0+WB6r9RSHAW3y rtimLxsWlr8TjTacFj3yTZXardy5YthDq6B6EK1k9gJebRS4s2scrCJ71uWyQp7tsg8S KFdg== X-Gm-Message-State: APf1xPAnG1UNmv23qv6Wl+xLqGlPPYCtYiivlwadGZcb3vlTp4DDJz3b 5zN1KSBde/49/b+p7qgwWBE3Yw== X-Received: by 10.46.23.15 with SMTP id l15mr4078136lje.146.1519284514916; Wed, 21 Feb 2018 23:28:34 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id s75sm5584722lje.69.2018.02.21.23.28.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:28:34 -0800 (PST) Subject: Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> <1519205218-26994-4-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <23b494fb-264d-a8ef-6172-5330d5a63bea@lightnvm.io> Date: Thu, 22 Feb 2018 08:28:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1519205218-26994-4-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 10:26 AM, Javier González wrote: > Both 1.2 and 2.0 specs define a field for media and controller > capabilities. Also, 1.2 defines a separate field dedicated to device > capabilities. > > In 2.0 sysfs, this values have been mixed. Revert them to the right > value. > > Signed-off-by: Javier González > --- > drivers/nvme/host/lightnvm.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c > index 969bb874850c..598abba66f52 100644 > --- a/drivers/nvme/host/lightnvm.c > +++ b/drivers/nvme/host/lightnvm.c > @@ -914,8 +914,8 @@ static ssize_t nvm_dev_attr_show(struct device *dev, > > if (strcmp(attr->name, "version") == 0) { > return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->ver_id); > - } else if (strcmp(attr->name, "capabilities") == 0) { > - return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.cap); > + } else if (strcmp(attr->name, "media_capabilities") == 0) { > + return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.mccap); > } else if (strcmp(attr->name, "read_typ") == 0) { > return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.trdt); > } else if (strcmp(attr->name, "read_max") == 0) { > @@ -993,8 +993,8 @@ static ssize_t nvm_dev_attr_show_12(struct device *dev, > return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.tbem); > } else if (strcmp(attr->name, "multiplane_modes") == 0) { > return scnprintf(page, PAGE_SIZE, "0x%08x\n", dev_geo->c.mpos); > - } else if (strcmp(attr->name, "media_capabilities") == 0) { > - return scnprintf(page, PAGE_SIZE, "0x%08x\n", dev_geo->c.mccap); > + } else if (strcmp(attr->name, "capabilities") == 0) { > + return scnprintf(page, PAGE_SIZE, "0x%08x\n", dev_geo->c.cap); > } else if (strcmp(attr->name, "max_phys_secs") == 0) { > return scnprintf(page, PAGE_SIZE, "%u\n", NVM_MAX_VLBA); > } else { > @@ -1055,7 +1055,7 @@ static ssize_t nvm_dev_attr_show_20(struct device *dev, > > /* general attributes */ > static NVM_DEV_ATTR_RO(version); > -static NVM_DEV_ATTR_RO(capabilities); > +static NVM_DEV_ATTR_RO(media_capabilities); > > static NVM_DEV_ATTR_RO(read_typ); > static NVM_DEV_ATTR_RO(read_max); > @@ -1080,12 +1080,12 @@ static NVM_DEV_ATTR_12_RO(prog_max); > static NVM_DEV_ATTR_12_RO(erase_typ); > static NVM_DEV_ATTR_12_RO(erase_max); > static NVM_DEV_ATTR_12_RO(multiplane_modes); > -static NVM_DEV_ATTR_12_RO(media_capabilities); > +static NVM_DEV_ATTR_12_RO(capabilities); > static NVM_DEV_ATTR_12_RO(max_phys_secs); > > static struct attribute *nvm_dev_attrs_12[] = { > &dev_attr_version.attr, > - &dev_attr_capabilities.attr, > + &dev_attr_media_capabilities.attr, > > &dev_attr_vendor_opcode.attr, > &dev_attr_device_mode.attr, > @@ -1108,7 +1108,7 @@ static struct attribute *nvm_dev_attrs_12[] = { > &dev_attr_erase_typ.attr, > &dev_attr_erase_max.attr, > &dev_attr_multiplane_modes.attr, > - &dev_attr_media_capabilities.attr, > + &dev_attr_capabilities.attr, > &dev_attr_max_phys_secs.attr, > > NULL, > @@ -1134,7 +1134,7 @@ static NVM_DEV_ATTR_20_RO(reset_max); > > static struct attribute *nvm_dev_attrs_20[] = { > &dev_attr_version.attr, > - &dev_attr_capabilities.attr, > + &dev_attr_media_capabilities.attr, > > &dev_attr_groups.attr, > &dev_attr_punits.attr, > With the mccap changes, it should make sense to keep the capabilities as is.