diff mbox

spurious bL cpufreq driver messages

Message ID CAKohpomG5E2FAeZGnX3eBw8fOiX3K8sWEeHgb5NT_FT3y+Cg1w@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Viresh Kumar May 20, 2013, 4:36 a.m. UTC
On 19 May 2013 01:21, Rob Herring <robherring2@gmail.com> 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 <viresh.kumar@linaro.org>
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 <robherring2@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/arm_big_little_dt.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

Comments

Rob Herring May 21, 2013, 4:42 p.m. UTC | #1
On Sun, May 19, 2013 at 11:36 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 19 May 2013 01:21, Rob Herring <robherring2@gmail.com> 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 <viresh.kumar@linaro.org>
> 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 <robherring2@gmail.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

That works. Thanks.

Tested-by: Rob Herring <rob.herring@calxeda.com>
Rafael Wysocki May 21, 2013, 11:45 p.m. UTC | #2
On Monday, May 20, 2013 10:06:49 AM Viresh Kumar wrote:
> On 19 May 2013 01:21, Rob Herring <robherring2@gmail.com> 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 <viresh.kumar@linaro.org>
> 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 <robherring2@gmail.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

The patch (from the attachment) didn't apply for me.  Please check the
bleeding-edge branch.

Thanks,
Rafael


> ---
>  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 <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/opp.h>
> +#include <linux/platform_device.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
>  #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 <viresh.kumar@linaro.org>");
>  MODULE_DESCRIPTION("Generic ARM big LITTLE cpufreq driver via DT");
Viresh Kumar May 22, 2013, 1:14 a.m. UTC | #3
On 22 May 2013 05:15, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Monday, May 20, 2013 10:06:49 AM Viresh Kumar wrote:
>> On 19 May 2013 01:21, Rob Herring <robherring2@gmail.com> 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 <viresh.kumar@linaro.org>
>> 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 <robherring2@gmail.com>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> The patch (from the attachment) didn't apply for me.  Please check the
> bleeding-edge branch.

Have you tried applying this before it (As written in my last mail)?

https://groups.google.com/forum/?fromgroups#!topic/linux.kernel/XJF-82rad4o

Above is also required fix for 3.10-rc3
Viresh Kumar May 22, 2013, 10:52 a.m. UTC | #4
On 22 May 2013 16:24, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> Please check the bleeding-edge branch now and see if anything for-3.10-rc is
> still missing.

You have picked all my pending patches for current rc release.. All pending
are targeted for 3.11 or linux-next. So all good.

thanks.
Rafael Wysocki May 22, 2013, 10:54 a.m. UTC | #5
On Wednesday, May 22, 2013 06:44:20 AM Viresh Kumar wrote:
> On 22 May 2013 05:15, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday, May 20, 2013 10:06:49 AM Viresh Kumar wrote:
> >> On 19 May 2013 01:21, Rob Herring <robherring2@gmail.com> 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 <viresh.kumar@linaro.org>
> >> 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 <robherring2@gmail.com>
> >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> >
> > The patch (from the attachment) didn't apply for me.  Please check the
> > bleeding-edge branch.
> 
> Have you tried applying this before it (As written in my last mail)?

No and I'm not sure which mail you're referring to.  There's been quite
a number of them recently. :-)

> https://groups.google.com/forum/?fromgroups#!topic/linux.kernel/XJF-82rad4o
>
> Above is also required fix for 3.10-rc3

OK, that worked.

Please check the bleeding-edge branch now and see if anything for-3.10-rc is
still missing.

Thanks,
Rafael
diff mbox

Patch

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 <linux/module.h>
 #include <linux/of.h>
 #include <linux/opp.h>
+#include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #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 <viresh.kumar@linaro.org>");
 MODULE_DESCRIPTION("Generic ARM big LITTLE cpufreq driver via DT");