From patchwork Mon May 20 04:36:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2592711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 91DA43FE81 for ; Mon, 20 May 2013 12:55:39 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UePck-00072R-EP; Mon, 20 May 2013 12:55:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeHqV-0003bE-NO; Mon, 20 May 2013 04:37:15 +0000 Received: from mail-oa0-f42.google.com ([209.85.219.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeHqS-0003am-TU for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2013 04:37:13 +0000 Received: by mail-oa0-f42.google.com with SMTP id i10so7297505oag.29 for ; Sun, 19 May 2013 21:36:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=0ng6v2yEWkZNNHpg7/L+WMKLaKOWx/KD27DlCsHcvZo=; b=AZ+/LV+7DhwnhfeOJCvj3rCXWEugMWTEOehNIAPF02/UnSDv+mTfs569tpXq8TvcuY xbx0WVm7vpcj76+mOwMR3qeJ/ZC0U6QsWETPnH4vMbvm2cK5QJiefmiGPyCIoPp0b+f8 YNVILh/fuePiB/i7BDVZUbJXzWxva9Cu4LUG1yCP2kIGPPLwxuTzkObsgw0zeu0l0PaV TQN+mHs6O/Jrq2xTl+rdhOfsRUzaCJHf7XfAz/Wct8xAXSEK8ErpsOwJkq4BD3SmJ01i UwVbZdmgmjCGnqDFXr95MG65FYJG7SEilYhS8FqUpuXkeLNZJ2cKLgGdAS5kOPU/TKYF 7q2g== MIME-Version: 1.0 X-Received: by 10.182.44.165 with SMTP id f5mr25506217obm.26.1369024609334; Sun, 19 May 2013 21:36:49 -0700 (PDT) Received: by 10.182.180.16 with HTTP; Sun, 19 May 2013 21:36:49 -0700 (PDT) In-Reply-To: References: <519686BC.3090101@gmail.com> Date: Mon, 20 May 2013 10:06:49 +0530 Message-ID: Subject: Re: spurious bL cpufreq driver messages From: Viresh Kumar To: "Rafael J. Wysocki" , Rob Herring X-Gm-Message-State: ALoCoQmqZoiWUSAhRHWJnGFbcRYcYcGo4DaytqSuxJNkUa7OUshd63s38E0qjMK3+TI8FFz4hsUk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130520_003713_034574_C86C384D X-CRM114-Status: GOOD ( 20.03 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.219.42 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shawn Guo , "linux-arm-kernel@lists.infradead.org" , linux-pm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On 19 May 2013 01:21, Rob Herring wrote: > No, it still registers the bL driver. The problem is not that DT data > is missing, but it is present on a single cluster system. I misread your mail.. I got the problem now.. Below should fix your issue (It is rebased on the patch I pointed to you earlier): Attached too for testing as gmail copy-paste will break it. @Rafael: Once Rob gives his Tested-by, please queue it for 3.10-rcs ------------x-----------------x----------------- From: Viresh Kumar Date: Mon, 20 May 2013 09:57:17 +0530 Subject: [PATCH] cpufreq: arm_big_little_dt: Instantiate as platform_driver As multiplatform build is being adopted by more and more ARM platforms, initcall function should be used very carefully. For example, when both arm_big_little_dt and cpufreq-cpu0 drivers are compiled in, arm_big_little_dt driver may try to register even if we had platform device for cpufreq-cpu0 registered. To eliminate this undesired the effect, the patch changes arm_big_little_dt driver to have it instantiated as a platform_driver. Then it will only run on platforms that create the platform_device "arm-bL-cpufreq-dt". Reported-by: Rob Herring Signed-off-by: Viresh Kumar Tested-by: Rob Herring --- drivers/cpufreq/arm_big_little_dt.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_little_dt.c index 27e2f45..fd9e3ea 100644 --- a/drivers/cpufreq/arm_big_little_dt.c +++ b/drivers/cpufreq/arm_big_little_dt.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include "arm_big_little.h" @@ -95,7 +96,7 @@ static struct cpufreq_arm_bL_ops dt_bL_ops = { .init_opp_table = dt_init_opp_table, }; -static int generic_bL_init(void) +static int generic_bL_probe(struct platform_device *pdev) { struct device_node *np; @@ -106,13 +107,22 @@ static int generic_bL_init(void) of_node_put(np); return bL_cpufreq_register(&dt_bL_ops); } -module_init(generic_bL_init); -static void generic_bL_exit(void) +static int generic_bL_remove(struct platform_device *pdev) { - return bL_cpufreq_unregister(&dt_bL_ops); + bL_cpufreq_unregister(&dt_bL_ops); + return 0; } -module_exit(generic_bL_exit); + +static struct platform_driver generic_bL_platdrv = { + .driver = { + .name = "arm-bL-cpufreq-dt", + .owner = THIS_MODULE, + }, + .probe = generic_bL_probe, + .remove = generic_bL_remove, +}; +module_platform_driver(generic_bL_platdrv); MODULE_AUTHOR("Viresh Kumar "); MODULE_DESCRIPTION("Generic ARM big LITTLE cpufreq driver via DT");