From patchwork Mon Mar 27 13:18:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96068 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223113qgd; Mon, 27 Mar 2017 06:20:56 -0700 (PDT) X-Received: by 10.36.80.85 with SMTP id m82mr10492949itb.23.1490620856828; 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 devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbdC0NTA (ORCPT + 7 others); Mon, 27 Mar 2017 09:19:00 -0400 Received: from foss.arm.com ([217.140.101.70]:34542 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbdC0NS5 (ORCPT ); Mon, 27 Mar 2017 09:18:57 -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 2A2F1344; Mon, 27 Mar 2017 06:18:37 -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 78ECE3F23B; Mon, 27 Mar 2017 06:18:34 -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 1/9] Documentation: arm: fix wrong reference number in DT definition Date: Mon, 27 Mar 2017 14:18:17 +0100 Message-Id: <20170327131825.32134-2-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Reference to cpu capacity binding has a wrong number. Fix it. Reported-by: Lorenzo Pieralisi Signed-off-by: Juri Lelli Acked-by: Rob Herring --- Documentation/devicetree/bindings/arm/cpus.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt index 698ad1f097fa..83ec3fa0a05e 100644 --- a/Documentation/devicetree/bindings/arm/cpus.txt +++ b/Documentation/devicetree/bindings/arm/cpus.txt @@ -248,7 +248,7 @@ nodes to be present and contain the properties described below. Usage: Optional Value type: Definition: - # u32 value representing CPU capacity [3] in + # u32 value representing CPU capacity [4] in DMIPS/MHz, relative to highest capacity-dmips-mhz in the system. @@ -475,5 +475,5 @@ cpus { [2] arm/msm/qcom,kpss-acc.txt [3] ARM Linux kernel documentation - idle states bindings Documentation/devicetree/bindings/arm/idle-states.txt -[3] ARM Linux kernel documentation - cpu capacity bindings +[4] ARM Linux kernel documentation - cpu capacity bindings Documentation/devicetree/bindings/arm/cpu-capacity.txt From patchwork Mon Mar 27 13:18:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96071 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223131qgd; Mon, 27 Mar 2017 06:20:58 -0700 (PDT) X-Received: by 10.36.51.212 with SMTP id k203mr9899673itk.6.1490620858281; Mon, 27 Mar 2017 06:20:58 -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.58; Mon, 27 Mar 2017 06:20:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209AbdC0NTO (ORCPT + 7 others); Mon, 27 Mar 2017 09:19:14 -0400 Received: from foss.arm.com ([217.140.101.70]:34596 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753188AbdC0NTL (ORCPT ); Mon, 27 Mar 2017 09:19:11 -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 516C41597; Mon, 27 Mar 2017 06:18:46 -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 5379C3F23B; Mon, 27 Mar 2017 06:18:43 -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 4/9] arm: remove wrong CONFIG_PROC_SYSCTL ifdef Date: Mon, 27 Mar 2017 14:18:20 +0100 Message-Id: <20170327131825.32134-5-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The sysfs cpu_capacity entry for each CPU has nothing to do with PROC_FS, nor it's in /proc/sys path. Remove such ifdef. Cc: Russell King Reported-and-suggested-by: Sudeep Holla Fixes: 7e5930aaef5d ('ARM: 8622/3: add sysfs cpu_capacity attribute') Signed-off-by: Juri Lelli --- arch/arm/kernel/topology.c | 2 -- 1 file changed, 2 deletions(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 4e4af809606a..162c82aeed96 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -57,7 +57,6 @@ static void set_capacity_scale(unsigned int cpu, unsigned long capacity) per_cpu(cpu_scale, cpu) = capacity; } -#ifdef CONFIG_PROC_SYSCTL static ssize_t cpu_capacity_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -114,7 +113,6 @@ static int register_cpu_capacity_sysctl(void) return 0; } subsys_initcall(register_cpu_capacity_sysctl); -#endif #ifdef CONFIG_OF struct cpu_efficiency { From patchwork Mon Mar 27 13:18:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96070 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223125qgd; Mon, 27 Mar 2017 06:20:58 -0700 (PDT) X-Received: by 10.36.34.79 with SMTP id o76mr9017159ito.116.1490620857964; Mon, 27 Mar 2017 06:20:57 -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.57; Mon, 27 Mar 2017 06:20:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192AbdC0NTM (ORCPT + 7 others); Mon, 27 Mar 2017 09:19:12 -0400 Received: from foss.arm.com ([217.140.101.70]:34626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165AbdC0NTC (ORCPT ); Mon, 27 Mar 2017 09:19:02 -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 0288315B2; Mon, 27 Mar 2017 06:18:56 -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 024E43F23B; Mon, 27 Mar 2017 06:18:52 -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 7/9] arm, arm64, drivers: reduce scope of cap_parsing_failed Date: Mon, 27 Mar 2017 14:18:23 +0100 Message-Id: <20170327131825.32134-8-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Reduce the scope of cap_parsing_failed (making it static in drivers/base/arch_topology.c) by slightly changing {arm,arm64} DT parsing code. For arm checking for !cap_parsing_failed before calling normalize_ cpu_capacity() is superfluous, as returning an error from parse_ cpu_capacity() (above) means cap_from _dt is set to false. For arm64 we can simply check if raw_capacity points to something, which is not if capacity parsing has failed. Suggested-by: Morten Rasmussen Signed-off-by: Juri Lelli --- arch/arm/kernel/topology.c | 3 +-- arch/arm64/kernel/topology.c | 5 +---- drivers/base/arch_topology.c | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Catalin Marinas diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 49ef025ffaa0..1e35a3265ddf 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -76,7 +76,6 @@ static unsigned long *__cpu_capacity; static unsigned long middle_capacity = 1; static bool cap_from_dt = true; -extern bool cap_parsing_failed; extern void normalize_cpu_capacity(void); extern int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu); @@ -165,7 +164,7 @@ static void __init parse_dt_topology(void) middle_capacity = ((max_capacity / 3) >> (SCHED_CAPACITY_SHIFT-1)) + 1; - if (cap_from_dt && !cap_parsing_failed) + if (cap_from_dt) normalize_cpu_capacity(); } diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index c5bc31eb97e8..7e1f6f75185b 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -27,7 +27,6 @@ #include #include -extern bool cap_parsing_failed; extern void normalize_cpu_capacity(void); extern int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu); @@ -187,10 +186,8 @@ static int __init parse_dt_topology(void) * cluster with restricted subnodes. */ map = of_get_child_by_name(cn, "cpu-map"); - if (!map) { - cap_parsing_failed = true; + if (!map) goto out; - } ret = parse_cluster(map, 0); if (ret != 0) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index b24d9a2af2c5..6543a032b332 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -93,7 +93,7 @@ subsys_initcall(register_cpu_capacity_sysctl); static u32 capacity_scale; static u32 *raw_capacity; -bool cap_parsing_failed; +static bool cap_parsing_failed; void normalize_cpu_capacity(void) { @@ -208,7 +208,7 @@ static int __init register_cpufreq_notifier(void) * until we have the necessary code to parse the cpu capacity, so * skip registering cpufreq notifier. */ - if (!acpi_disabled || cap_parsing_failed) + if (!acpi_disabled || !raw_capacity) return -EINVAL; if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL)) { From patchwork Mon Mar 27 13:18:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96075 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1162410obz; Mon, 27 Mar 2017 06:47:33 -0700 (PDT) X-Received: by 10.84.130.2 with SMTP id 2mr29323759plc.24.1490622453918; Mon, 27 Mar 2017 06:47:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si717467pgi.166.2017.03.27.06.47.33; Mon, 27 Mar 2017 06:47:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbdC0NrH (ORCPT + 7 others); Mon, 27 Mar 2017 09:47:07 -0400 Received: from foss.arm.com ([217.140.101.70]:35254 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752892AbdC0NrE (ORCPT ); Mon, 27 Mar 2017 09:47:04 -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 E4F7F15BF; Mon, 27 Mar 2017 06:18:58 -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 3FDA23F23B; Mon, 27 Mar 2017 06:18:56 -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 8/9] arm, arm64, drivers: move externs in a new header file Date: Mon, 27 Mar 2017 14:18:24 +0100 Message-Id: <20170327131825.32134-9-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Create a new header file (include/linux/arch_topology.h) and put there declarations of interfaces used by arm, arm64 and drivers code. Signed-off-by: Juri Lelli --- arch/arm/kernel/topology.c | 7 +------ arch/arm64/kernel/topology.c | 4 +--- drivers/base/arch_topology.c | 1 + include/linux/arch_topology.h | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 include/linux/arch_topology.h -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Catalin Marinas diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 1e35a3265ddf..557be4f1d2d7 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -11,6 +11,7 @@ * for more details. */ +#include #include #include #include @@ -45,10 +46,6 @@ * updated during this sequence. */ -extern unsigned long -arch_scale_cpu_capacity(struct sched_domain *sd, int cpu); -extern void set_capacity_scale(unsigned int cpu, unsigned long capacity); - #ifdef CONFIG_OF struct cpu_efficiency { const char *compatible; @@ -76,8 +73,6 @@ static unsigned long *__cpu_capacity; static unsigned long middle_capacity = 1; static bool cap_from_dt = true; -extern void normalize_cpu_capacity(void); -extern int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu); /* * Iterate all CPUs' descriptor in DT and compute the efficiency diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 7e1f6f75185b..255230c3e835 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -11,6 +11,7 @@ * for more details. */ +#include #include #include #include @@ -27,9 +28,6 @@ #include #include -extern void normalize_cpu_capacity(void); -extern int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu); - static int __init get_cpu_for_node(struct device_node *node) { struct device_node *cpu_node; diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 6543a032b332..0fc77fa900a9 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h new file mode 100644 index 000000000000..4edae9fe8cdd --- /dev/null +++ b/include/linux/arch_topology.h @@ -0,0 +1,17 @@ +/* + * include/linux/arch_topology.h - arch specific cpu topology information + */ +#ifndef _LINUX_ARCH_TOPOLOGY_H_ +#define _LINUX_ARCH_TOPOLOGY_H_ + +void normalize_cpu_capacity(void); + +struct device_node; +int parse_cpu_capacity(struct device_node *cpu_node, int cpu); + +struct sched_domain; +unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu); + +void set_capacity_scale(unsigned int cpu, unsigned long capacity); + +#endif /* _LINUX_ARCH_TOPOLOGY_H_ */ From patchwork Mon Mar 27 13:18:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 96072 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1223163qgd; Mon, 27 Mar 2017 06:21:01 -0700 (PDT) X-Received: by 10.107.144.197 with SMTP id s188mr20208888iod.146.1490620861344; Mon, 27 Mar 2017 06:21:01 -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.01; Mon, 27 Mar 2017 06:21:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752867AbdC0NTt (ORCPT + 7 others); Mon, 27 Mar 2017 09:19:49 -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 S1753186AbdC0NTN (ORCPT ); Mon, 27 Mar 2017 09:19:13 -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 D5CC51610; Mon, 27 Mar 2017 06:19:01 -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 2DD9A3F23B; Mon, 27 Mar 2017 06:18:59 -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 9/9] arm, arm64, drivers: add a prefix to drivers arch_topology interfaces Date: Mon, 27 Mar 2017 14:18:25 +0100 Message-Id: <20170327131825.32134-10-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Now that some functions that deal with arch topology information live under drivers, there is a clash of naming that might create confusion. Tidy things up by creating a drivers namespace for interfaces used by arch code; achieve this by prepending a 'atd_' (arch topology driver) prefix to driver interfaces. Signed-off-by: Juri Lelli --- arch/arm/kernel/topology.c | 8 ++++---- arch/arm64/kernel/topology.c | 4 ++-- drivers/base/arch_topology.c | 20 ++++++++++---------- include/linux/arch_topology.h | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Catalin Marinas diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 557be4f1d2d7..e53391026c1b 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -111,7 +111,7 @@ static void __init parse_dt_topology(void) continue; } - if (parse_cpu_capacity(cn, cpu)) { + if (atd_parse_cpu_capacity(cn, cpu)) { of_node_put(cn); continue; } @@ -160,7 +160,7 @@ static void __init parse_dt_topology(void) >> (SCHED_CAPACITY_SHIFT-1)) + 1; if (cap_from_dt) - normalize_cpu_capacity(); + atd_normalize_cpu_capacity(); } /* @@ -173,10 +173,10 @@ static void update_cpu_capacity(unsigned int cpu) if (!cpu_capacity(cpu) || cap_from_dt) return; - set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); + atd_set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); pr_info("CPU%u: update cpu_capacity %lu\n", - cpu, arch_scale_cpu_capacity(NULL, cpu)); + cpu, atd_scale_cpu_capacity(NULL, cpu)); } #else diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 255230c3e835..5f24faa09c05 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -39,7 +39,7 @@ static int __init get_cpu_for_node(struct device_node *node) for_each_possible_cpu(cpu) { if (of_get_cpu_node(cpu, NULL) == cpu_node) { - parse_cpu_capacity(cpu_node, cpu); + atd_parse_cpu_capacity(cpu_node, cpu); of_node_put(cpu_node); return cpu; } @@ -191,7 +191,7 @@ static int __init parse_dt_topology(void) if (ret != 0) goto out_map; - normalize_cpu_capacity(); + atd_normalize_cpu_capacity(); /* * Check that all cores are in the topology; the SMP code will diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 0fc77fa900a9..87dca3320536 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -25,12 +25,12 @@ static DEFINE_MUTEX(cpu_scale_mutex); static DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE; -unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) +unsigned long atd_scale_cpu_capacity(struct sched_domain *sd, int cpu) { return per_cpu(cpu_scale, cpu); } -void set_capacity_scale(unsigned int cpu, unsigned long capacity) +void atd_set_capacity_scale(unsigned int cpu, unsigned long capacity) { per_cpu(cpu_scale, cpu) = capacity; } @@ -42,7 +42,7 @@ static ssize_t cpu_capacity_show(struct device *dev, struct cpu *cpu = container_of(dev, struct cpu, dev); return sprintf(buf, "%lu\n", - arch_scale_cpu_capacity(NULL, cpu->dev.id)); + atd_scale_cpu_capacity(NULL, cpu->dev.id)); } static ssize_t cpu_capacity_store(struct device *dev, @@ -67,7 +67,7 @@ static ssize_t cpu_capacity_store(struct device *dev, mutex_lock(&cpu_scale_mutex); for_each_cpu(i, &cpu_topology[this_cpu].core_sibling) - set_capacity_scale(i, new_capacity); + atd_set_capacity_scale(i, new_capacity); mutex_unlock(&cpu_scale_mutex); return count; @@ -96,7 +96,7 @@ static u32 capacity_scale; static u32 *raw_capacity; static bool cap_parsing_failed; -void normalize_cpu_capacity(void) +void atd_normalize_cpu_capacity(void) { u64 capacity; int cpu; @@ -111,14 +111,14 @@ void normalize_cpu_capacity(void) cpu, raw_capacity[cpu]); capacity = (raw_capacity[cpu] << SCHED_CAPACITY_SHIFT) / capacity_scale; - set_capacity_scale(cpu, capacity); + atd_set_capacity_scale(cpu, capacity); pr_debug("cpu_capacity: CPU%d cpu_capacity=%lu\n", - cpu, arch_scale_cpu_capacity(NULL, cpu)); + cpu, atd_scale_cpu_capacity(NULL, cpu)); } mutex_unlock(&cpu_scale_mutex); } -int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu) +int __init atd_parse_cpu_capacity(struct device_node *cpu_node, int cpu) { int ret = 1; u32 cpu_capacity; @@ -183,12 +183,12 @@ init_cpu_capacity_callback(struct notifier_block *nb, cpus_to_visit, policy->related_cpus); for_each_cpu(cpu, policy->related_cpus) { - raw_capacity[cpu] = arch_scale_cpu_capacity(NULL, cpu) * + raw_capacity[cpu] = atd_scale_cpu_capacity(NULL, cpu) * policy->cpuinfo.max_freq / 1000UL; capacity_scale = max(raw_capacity[cpu], capacity_scale); } if (cpumask_empty(cpus_to_visit)) { - normalize_cpu_capacity(); + atd_normalize_cpu_capacity(); kfree(raw_capacity); pr_debug("cpu_capacity: parsing done\n"); cap_parsing_done = true; diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 4edae9fe8cdd..e25458d7ee9a 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -4,14 +4,14 @@ #ifndef _LINUX_ARCH_TOPOLOGY_H_ #define _LINUX_ARCH_TOPOLOGY_H_ -void normalize_cpu_capacity(void); +void atd_normalize_cpu_capacity(void); struct device_node; -int parse_cpu_capacity(struct device_node *cpu_node, int cpu); +int atd_parse_cpu_capacity(struct device_node *cpu_node, int cpu); struct sched_domain; -unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu); +unsigned long atd_scale_cpu_capacity(struct sched_domain *sd, int cpu); -void set_capacity_scale(unsigned int cpu, unsigned long capacity); +void atd_set_capacity_scale(unsigned int cpu, unsigned long capacity); #endif /* _LINUX_ARCH_TOPOLOGY_H_ */