From patchwork Mon Mar 27 13:18:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96067 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223100qgd; Mon, 27 Mar 2017 06:20:56 -0700 (PDT) X-Received: by 10.107.7.210 with SMTP id g79mr20295796ioi.34.1490620856292; Mon, 27 Mar 2017 06:20:56 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t81si615784ita.14.2017.03.27.06.20.56; Mon, 27 Mar 2017 06:20:56 -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 S1753150AbdC0NSy (ORCPT + 19 others); Mon, 27 Mar 2017 09:18:54 -0400 Received: from foss.arm.com ([217.140.101.70]:34564 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbdC0NSv (ORCPT ); Mon, 27 Mar 2017 09:18:51 -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 189191595; Mon, 27 Mar 2017 06:18:40 -0700 (PDT) Received: from e106622-lin.cambridge.arm.com (e106622-lin.cambridge.arm.com [10.1.211.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 677313F23B; Mon, 27 Mar 2017 06:18:37 -0700 (PDT) From: Juri Lelli To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@arm.linux.org.uk, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, juri.lelli@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v3 2/9] Documentation/ABI: add information about cpu_capacity Date: Mon, 27 Mar 2017 14:18:18 +0100 Message-Id: <20170327131825.32134-3-juri.lelli@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170327131825.32134-1-juri.lelli@arm.com> References: <20170327131825.32134-1-juri.lelli@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org /sys/devices/system/cpu/cpu#/cpu_capacity describe information about CPUs heterogeneity (ref. to Documentation/devicetree/bindings/arm/ cpu-capacity.txt). Add such description. Signed-off-by: Juri Lelli --- Documentation/ABI/testing/sysfs-devices-system-cpu | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.10.0 diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index 2a4a423d08e0..f3d5817c4ef0 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu @@ -366,3 +366,10 @@ Contact: Linux ARM Kernel Mailing list Description: AArch64 CPU registers 'identification' directory exposes the CPU ID registers for identifying model and revision of the CPU. + +What: /sys/devices/system/cpu/cpu#/cpu_capacity +Date: December 2016 +Contact: Linux kernel mailing list +Description: information about CPUs heterogeneity. + + cpu_capacity: capacity of cpu#. From patchwork Mon Mar 27 13:18:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96066 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1222279qgd; Mon, 27 Mar 2017 06:18:52 -0700 (PDT) X-Received: by 10.98.214.4 with SMTP id r4mr24583958pfg.185.1490620732576; Mon, 27 Mar 2017 06:18:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si614411pgf.403.2017.03.27.06.18.52; Mon, 27 Mar 2017 06:18:52 -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 S1753123AbdC0NSv (ORCPT + 19 others); Mon, 27 Mar 2017 09:18:51 -0400 Received: from foss.arm.com ([217.140.101.70]:34580 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752786AbdC0NSt (ORCPT ); Mon, 27 Mar 2017 09:18:49 -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 15D2B1596; Mon, 27 Mar 2017 06:18:43 -0700 (PDT) Received: from e106622-lin.cambridge.arm.com (e106622-lin.cambridge.arm.com [10.1.211.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 564BF3F23B; Mon, 27 Mar 2017 06:18:40 -0700 (PDT) From: Juri Lelli To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@arm.linux.org.uk, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, juri.lelli@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v3 3/9] arm: fix return value of parse_cpu_capacity Date: Mon, 27 Mar 2017 14:18:19 +0100 Message-Id: <20170327131825.32134-4-juri.lelli@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170327131825.32134-1-juri.lelli@arm.com> References: <20170327131825.32134-1-juri.lelli@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org parse_cpu_capacity() has to return 0 on failure, but it currently returns 1 instead if raw_capacity kcalloc failed. Fix it by removing the negation of the return value. Cc: Russell King Reported-by: Morten Rasmussen Fixes: 06073ee26775 ('ARM: 8621/3: parse cpu capacity-dmips-mhz from DT') Signed-off-by: Juri Lelli --- arch/arm/kernel/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.10.0 diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index f8a3ab82e77f..4e4af809606a 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -166,7 +166,7 @@ static int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu) if (!raw_capacity) { pr_err("cpu_capacity: failed to allocate memory for raw capacities\n"); cap_parsing_failed = true; - return !ret; + return ret; } } capacity_scale = max(cpu_capacity, capacity_scale); From patchwork Mon Mar 27 13:18:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96073 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223180qgd; Mon, 27 Mar 2017 06:21:02 -0700 (PDT) X-Received: by 10.107.166.207 with SMTP id p198mr20786304ioe.15.1490620862801; Mon, 27 Mar 2017 06:21:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t81si615784ita.14.2017.03.27.06.21.02; Mon, 27 Mar 2017 06:21:02 -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 S1753309AbdC0NUK (ORCPT + 19 others); Mon, 27 Mar 2017 09:20:10 -0400 Received: from foss.arm.com ([217.140.101.70]:34616 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753153AbdC0NS7 (ORCPT ); Mon, 27 Mar 2017 09:18:59 -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 B8F0915AB; Mon, 27 Mar 2017 06:18:52 -0700 (PDT) Received: from e106622-lin.cambridge.arm.com (e106622-lin.cambridge.arm.com [10.1.211.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 11F433F23B; Mon, 27 Mar 2017 06:18:49 -0700 (PDT) From: Juri Lelli To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@arm.linux.org.uk, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, juri.lelli@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v3 6/9] drivers: remove useless comment from base/arch_topology.c Date: Mon, 27 Mar 2017 14:18:22 +0100 Message-Id: <20170327131825.32134-7-juri.lelli@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170327131825.32134-1-juri.lelli@arm.com> References: <20170327131825.32134-1-juri.lelli@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Printing out an error message when we failed to get the cpu device is not helping anyone. Remove it. Signed-off-by: Juri Lelli --- drivers/base/arch_topology.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.10.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index c33482121b7d..b24d9a2af2c5 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -81,11 +81,9 @@ static int register_cpu_capacity_sysctl(void) for_each_possible_cpu(i) { cpu = get_cpu_device(i); - if (!cpu) { - pr_err("%s: too early to get CPU%d device!\n", - __func__, i); + if (!cpu) continue; - } + device_create_file(cpu, &dev_attr_cpu_capacity); }