From patchwork Thu Jun 13 04:24:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17865 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCBE825E1A for ; Thu, 13 Jun 2013 04:24:04 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q4sf9449729yen.8 for ; Wed, 12 Jun 2013 21:24:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=ivWhD37YvRHj/W+G/YHOrlG5PvUG0CT7v6YEW8l04FQ=; b=WMkqDQqJgEQ6ALZOirZbrskS9FDumYyjCVFcmn7GRLZLp4/kc7iMiy5/bYbzdc+yj8 JmKy4gx3N1yGdm5oo6RHSlANrqJP13/FUo/WA6cRCZm21Jaujc0wcKFwGugWWQS9OeUo LJYMGdQxn9wHSCZLMoolp0quCBrpfXXDMctEDGdU1kjYxMNOEFstNMIZObdoPWryNctT 9vSFDn3JQSUnd9inHkS7/xPOTAOgeMypUZVsX5n2c7U7U6DkvbdnlTZuRridC9/g8QIa QwATHIsVoWWhaOAMBwrgIPFYKR11qfHk/66P3hRHBhno1Xn4RXhr4k3HHDTDag+L2PoN 2tcg== X-Received: by 10.224.215.68 with SMTP id hd4mr715706qab.5.1371097444002; Wed, 12 Jun 2013 21:24:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.51 with SMTP id r19ls2708093qef.73.gmail; Wed, 12 Jun 2013 21:24:03 -0700 (PDT) X-Received: by 10.58.211.7 with SMTP id my7mr3348386vec.54.1371097443793; Wed, 12 Jun 2013 21:24:03 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id tn5si9815876vdc.117.2013.06.12.21.24.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 21:24:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hf12so6821117vcb.15 for ; Wed, 12 Jun 2013 21:24:03 -0700 (PDT) X-Received: by 10.59.2.199 with SMTP id bq7mr10612653ved.51.1371097443620; Wed, 12 Jun 2013 21:24:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.191.99 with SMTP id gx3csp6823vec; Wed, 12 Jun 2013 21:24:02 -0700 (PDT) X-Received: by 10.182.204.33 with SMTP id kv1mr17649158obc.19.1371097441871; Wed, 12 Jun 2013 21:24:01 -0700 (PDT) Received: from mail-ob0-x229.google.com (mail-ob0-x229.google.com [2607:f8b0:4003:c01::229]) by mx.google.com with ESMTPS id so7si11237748obb.34.2013.06.12.21.24.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 21:24:01 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4003:c01::229 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:4003:c01::229; Received: by mail-ob0-f169.google.com with SMTP id up14so14181299obb.28 for ; Wed, 12 Jun 2013 21:24:01 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.39.104 with SMTP id o8mr4494884oek.14.1371097441292; Wed, 12 Jun 2013 21:24:01 -0700 (PDT) Received: by 10.182.131.231 with HTTP; Wed, 12 Jun 2013 21:24:01 -0700 (PDT) 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 X-Gm-Message-State: ALoCoQlF44J9n3DAU6MAF18G6CZOaE1GsDPbRBtFPP1EmVR48TupSGFnVYKxHGsTz99a9nIhBwIi X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Tested-by: Stephen Warren Acked-by: Stephen Warren --- 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