Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1044703imm; Fri, 14 Sep 2018 10:14:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbQ3VPikSgG6hbOz2Ni9O9JFLhg5mqQICi6dL34ZBqbGBlTZGZERtAtwokmvtjH09iDtss0 X-Received: by 2002:a62:f610:: with SMTP id x16-v6mr13384126pfh.169.1536945282081; Fri, 14 Sep 2018 10:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536945282; cv=none; d=google.com; s=arc-20160816; b=za/M8xmUvti8p41KfSJgYmvwD2cn3j1QNI42rfbWbaIWL7+hWsUsfe41dHhMR3pHx0 nMTTNEEkd8fOCwRr3uS54vUrA3o7RWv81Vnf7ap0tKAt8lpOzzLtMFM/yPdt1zbQ+kxe aLWwIq2i1zZF7WH/z0Hqc2R1mIL4Y/gZlEhNu2L51L2E6AVxG/WHX2puESaFdmgkQaOT ljoa+UVDtnP6MfGt13swVHaBKInD0UUkns4sVI876cGFZ/OBW3DnzROBtsKjNEU14BZs DTBdSChr0RdLhUs5YWTRIZOKgKsO7ZYPX78dPe+UMizyspqmqPYL1bReThobMfPS9n/k rIOA== 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; bh=GBjwzoZ+qNy5kz5oH8n2Nrvqx3UrL6mFixSBL8bVCPY=; b=MMPlKKNtMUEqZwAzl8fWssAyAVlJ741uHuPgnB7Z9gRNu7WYOSHh0CwTbA2z3IYCiO EF9nQmxOqASzsZZjkNECB7BMef1DYhwO0kesc8sllW4EYvJ6Og6uvxOJ00t0cJ76ptap VUi0iSxZ/gOCRh1Vv1BiW8cuJGuApW19/m6iI7HfZRcjFyJEWbnIOwtw3tazRMRyCTvR 1YOg/FgGBevoX7cbeok6+mfFDkWOQT70BOJDvcWbosKEUvZS0PWKKZuIxalXGj9cLUjC DdJWxgPd716fRmhjXCENS7ORsEWuilGM+HMVWpPCI5UpaNA+cgOYqje/wIfRYFmzc2z9 EXtw== ARC-Authentication-Results: i=1; mx.google.com; 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 i5-v6si6821534pgc.607.2018.09.14.10.14.26; Fri, 14 Sep 2018 10:14:42 -0700 (PDT) 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; 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 S1727672AbeINW3g (ORCPT + 99 others); Fri, 14 Sep 2018 18:29:36 -0400 Received: from foss.arm.com ([217.140.101.70]:36922 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbeINW3g (ORCPT ); Fri, 14 Sep 2018 18:29:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B93A80D; Fri, 14 Sep 2018 10:14:12 -0700 (PDT) Received: from [192.168.100.242] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1BFE83F575; Fri, 14 Sep 2018 10:14:12 -0700 (PDT) Subject: Re: [PATCH v2 1/2] drivers: base: cacheinfo: Do not populate sysfs for unknown cache types To: Jeffrey Hugo , sudeep.holla@arm.com, gregkh@linuxfoundation.org, rjw@rjwysocki.net, linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vkilari@codeaurora.org References: <1536942489-4018-1-git-send-email-jhugo@codeaurora.org> <1536942489-4018-2-git-send-email-jhugo@codeaurora.org> From: Jeremy Linton Message-ID: <3e842dd3-9b92-c56b-c45a-72d99b37f946@arm.com> Date: Fri, 14 Sep 2018 12:14:11 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1536942489-4018-2-git-send-email-jhugo@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 09/14/2018 11:28 AM, Jeffrey Hugo wrote: > If a cache has an unknown type because neither the hardware nor the > firmware told us, an entry in the sysfs tree will be made, but the type > file will not be present. lscpu depends on the type file being present > for every entry, and will error out without printing system information > if lscpu cannot open the type file. > > Presenting information about a cache without indicating its type is not > useful, therefore if we hit a cache with an unknown type, stop populating > sysfs so that userspace has the maximum amount of useful information. > > This addresses the following lscpu error, which prevents any output. > lscpu: cannot open /sys/devices/system/cpu/cpu0/cache/index3/type: No such > file or directory > > Suggested-by: Sudeep Holla > Signed-off-by: Jeffrey Hugo > --- > drivers/base/cacheinfo.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c > index 5d5b598..cf78fa6 100644 > --- a/drivers/base/cacheinfo.c > +++ b/drivers/base/cacheinfo.c > @@ -615,6 +615,8 @@ static int cache_add_dev(unsigned int cpu) > this_leaf = this_cpu_ci->info_list + i; > if (this_leaf->disable_sysfs) > continue; > + if (this_leaf->type == CACHE_TYPE_NOCACHE) > + break; > cache_groups = cache_get_attribute_groups(this_leaf); > ci_dev = cpu_device_create(parent, this_leaf, cache_groups, > "index%1u", i); > Looks fine to me: Reviewed-by: Jeremy Linton Thanks,