Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753851Ab3FMEYE (ORCPT ); Thu, 13 Jun 2013 00:24:04 -0400 Received: from mail-ob0-f179.google.com ([209.85.214.179]:60340 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782Ab3FMEYC (ORCPT ); Thu, 13 Jun 2013 00:24:02 -0400 MIME-Version: 1.0 In-Reply-To: <51B898B6.8070103@wwwdotorg.org> References: <881257c10f24b5ca8721b561726bac8887dc922e.1371022830.git.viresh.kumar@linaro.org> <51B898B6.8070103@wwwdotorg.org> Date: Thu, 13 Jun 2013 09:54:01 +0530 Message-ID: Subject: Re: [PATCH 10/11] cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA From: Viresh Kumar To: Stephen Warren Cc: rjw@sisk.pl, linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, arnd@arndb.de, Stephen Warren Content-Type: multipart/mixed; boundary=089e013a032af0e29504df017fc8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9361 Lines: 196 --089e013a032af0e29504df017fc8 Content-Type: text/plain; charset=ISO-8859-1 On 12 June 2013 21:20, Stephen Warren wrote: > On 06/12/2013 02:15 AM, Viresh Kumar wrote: >> ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants >> of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver >> uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA. >> >> This also removes select CPU_FREQ_TABLE from individual tegra variants. > > I guess the real issue here is that drivers/cpufreq/tegra-cpufreq.c gets > built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ > itself, so: > > select CPU_FREQ_TABLE if CPU_FREQ > > ... isn't guaranteed to fire. > > The correct solution seems to be: > > * Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm. > * Make that Kconfig option selct CPU_FREQ_TABLE. > * Make that Kconfig option be def_bool ARCH_TEGRA. > * Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that. > * Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig. > > That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's > cpufreq works the same way as all the other cpufreq drivers. Hmmm. check this out (attached too for you to test): ----------x---------------x------------ From: Viresh Kumar Date: Wed, 12 Jun 2013 12:05:48 +0530 Subject: [PATCH] cpufreq: tegra: create CONFIG_ARM_TEGRA_CPUFREQ currently Tegra cpufreq driver gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so: select CPU_FREQ_TABLE if CPU_FREQ ... isn't guaranteed to fire. The correct solution seems to be: * Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm. * Make that Kconfig option selct CPU_FREQ_TABLE. * Make that Kconfig option be def_bool ARCH_TEGRA. * Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that. * Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig. That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers. This patch does it. Suggested-by: Stephen Warren Acked-by: Arnd Bergmann Signed-off-by: Viresh Kumar --- arch/arm/mach-tegra/Kconfig | 3 --- drivers/cpufreq/Kconfig.arm | 8 ++++++++ drivers/cpufreq/Makefile | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 84d72fc..5c0db06 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -28,7 +28,6 @@ config ARCH_TEGRA_2x_SOC select ARM_ERRATA_754327 if SMP select ARM_ERRATA_764369 if SMP select ARM_GIC - select CPU_FREQ_TABLE if CPU_FREQ select CPU_V7 select PINCTRL select PINCTRL_TEGRA20 @@ -46,7 +45,6 @@ config ARCH_TEGRA_3x_SOC select ARM_ERRATA_754322 select ARM_ERRATA_764369 if SMP select ARM_GIC - select CPU_FREQ_TABLE if CPU_FREQ select CPU_V7 select PINCTRL select PINCTRL_TEGRA30 @@ -63,7 +61,6 @@ config ARCH_TEGRA_114_SOC select ARM_ARCH_TIMER select ARM_GIC select ARM_L1_CACHE_SHIFT_6 - select CPU_FREQ_TABLE if CPU_FREQ select CPU_V7 select PINCTRL select PINCTRL_TEGRA114 diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index d52261b..5085427 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -154,3 +154,11 @@ config ARM_SPEAR_CPUFREQ default y help This adds the CPUFreq driver support for SPEAr SOCs. + +config ARM_TEGRA_CPUFREQ + bool "TEGRA CPUFreq support" + depends on ARCH_TEGRA + select CPU_FREQ_TABLE + default y + help + This adds the CPUFreq driver support for TEGRA SOCs. diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 13c3f83..9c873e7 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -71,7 +71,7 @@ obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o -obj-$(CONFIG_ARCH_TEGRA) += tegra-cpufreq.o +obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o ################################################################################## # PowerPC platform drivers --089e013a032af0e29504df017fc8 Content-Type: application/octet-stream; name="0001-cpufreq-tegra-create-CONFIG_ARM_TEGRA_CPUFREQ.patch" Content-Disposition: attachment; filename="0001-cpufreq-tegra-create-CONFIG_ARM_TEGRA_CPUFREQ.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hhvg063j0 RnJvbSAzODlkNzY4NzhlYzFkNmViNTM4M2NiNmFjY2Y1OTMzZjM1ZTFiYjFhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8Mzg5ZDc2ODc4ZWMxZDZlYjUzODNjYjZhY2NmNTkz M2YzNWUxYmIxYS4xMzcxMDk3Mzk2LmdpdC52aXJlc2gua3VtYXJAbGluYXJvLm9yZz4KRnJvbTog VmlyZXNoIEt1bWFyIDx2aXJlc2gua3VtYXJAbGluYXJvLm9yZz4KRGF0ZTogV2VkLCAxMiBKdW4g MjAxMyAxMjowNTo0OCArMDUzMApTdWJqZWN0OiBbUEFUQ0hdIGNwdWZyZXE6IHRlZ3JhOiBjcmVh dGUgQ09ORklHX0FSTV9URUdSQV9DUFVGUkVRCgpjdXJyZW50bHkgVGVncmEgY3B1ZnJlcSBkcml2 ZXIgZ2V0cyBidWlsdCBiYXNlZCBvbiBBUkNIX1RFR1JBLCB3aGljaCBkb2Vzbid0CmRlcGVuZCBv biBub3Igc2VsZWN0IENQVV9GUkVRIGl0c2VsZiwgc286CgogICAgICAgIHNlbGVjdCBDUFVfRlJF UV9UQUJMRSBpZiBDUFVfRlJFUQoKLi4uIGlzbid0IGd1YXJhbnRlZWQgdG8gZmlyZS4KClRoZSBj b3JyZWN0IHNvbHV0aW9uIHNlZW1zIHRvIGJlOgoKKiBBZGQgQ09ORklHX0FSTV9URUdSQV9DUFVG UkVRIHRvIGRyaXZlcnMvY3B1ZnJlcS9LY29uZmlnLmFybS4KKiBNYWtlIHRoYXQgS2NvbmZpZyBv cHRpb24gc2VsY3QgQ1BVX0ZSRVFfVEFCTEUuCiogTWFrZSB0aGF0IEtjb25maWcgb3B0aW9uIGJl IGR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YS1jcHVmcmVxLm8KK29iai0kKENPTkZJR19BUk1fVEVHUkFfQ1BVRlJFUSkJ CSs9IHRlZ3JhLWNwdWZyZXEubwogCiAjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiAjIFBvd2Vy UEMgcGxhdGZvcm0gZHJpdmVycwotLSAKMS43LjEyLnJjMi4xOC5nNjFiNDcyZQoK --089e013a032af0e29504df017fc8-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/