All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER
@ 2015-05-11 11:24 Sudeep Holla
  2015-05-12  7:27 ` Viresh Kumar
  2015-05-13 12:35 ` [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE Sudeep Holla
  0 siblings, 2 replies; 7+ messages in thread
From: Sudeep Holla @ 2015-05-11 11:24 UTC (permalink / raw)
  To: linux-pm, Viresh Kumar
  Cc: Sudeep Holla, linux-kernel, Jon Medhurst, Rafael J. Wysocki

With the addition of switcher code, there's compile-time dependency on
BL_SWITCHER to get arm_big_little driver compiling on ARM64. Since ARM64
will never add support for BL_SWITCHER, it's better to remove the
dependency so that the driver can be reused on ARM64 platforms.

This patch adds stubs to remove BL_SWITCHER dependency in the driver.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpufreq/Kconfig.arm      |  2 +-
 drivers/cpufreq/arm_big_little.c | 27 ++++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index d38f1ce95087..39520a61ea6f 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -5,7 +5,7 @@
 # big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
-	depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
+	depends on (ARM_CPU_TOPOLOGY || ARM64) && HAVE_CLK
 	select PM_OPP
 	help
 	  This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index e4d75ca9f3b0..f1e42f8ce0fc 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -31,7 +31,6 @@
 #include <linux/slab.h>
 #include <linux/topology.h>
 #include <linux/types.h>
-#include <asm/bL_switcher.h>

 #include "arm_big_little.h"

@@ -41,12 +40,16 @@
 #define MAX_CLUSTERS	2

 #ifdef CONFIG_BL_SWITCHER
+#include <asm/bL_switcher.h>
 static bool bL_switching_enabled;
 #define is_bL_switching_enabled()	bL_switching_enabled
 #define set_switching_enabled(x)	(bL_switching_enabled = (x))
 #else
 #define is_bL_switching_enabled()	false
 #define set_switching_enabled(x)	do { } while (0)
+#define bL_switch_request(...)		do { } while (0)
+#define bL_switcher_put_enabled()	do { } while (0)
+#define bL_switcher_get_enabled()	do { } while (0)
 #endif

 #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)
@@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
 	.attr			= cpufreq_generic_attr,
 };

+#ifdef CONFIG_BL_SWITCHER
 static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb,
 					unsigned long action, void *_arg)
 {
@@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = {
 	.notifier_call = bL_cpufreq_switcher_notifier,
 };

+static int __bLs_register_notifier(void)
+{
+	return bL_switcher_register_notifier(&bL_switcher_notifier);
+}
+
+static int __bLs_unregister_notifier(void)
+{
+	return bL_switcher_unregister_notifier(&bL_switcher_notifier);
+}
+#else
+static int __bLs_register_notifier(void) { return 0; }
+static int __bLs_unregister_notifier(void) { return 0; }
+#endif
+
 int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
 {
 	int ret, i;
@@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)

 	arm_bL_ops = ops;

-	ret = bL_switcher_get_enabled();
-	set_switching_enabled(ret);
+	set_switching_enabled(bL_switcher_get_enabled());

 	for (i = 0; i < MAX_CLUSTERS; i++)
 		mutex_init(&cluster_lock[i]);
@@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
 				__func__, ops->name, ret);
 		arm_bL_ops = NULL;
 	} else {
-		ret = bL_switcher_register_notifier(&bL_switcher_notifier);
+		ret = __bLs_register_notifier();
 		if (ret) {
 			cpufreq_unregister_driver(&bL_cpufreq_driver);
 			arm_bL_ops = NULL;
@@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops)
 	}

 	bL_switcher_get_enabled();
-	bL_switcher_unregister_notifier(&bL_switcher_notifier);
+	__bLs_unregister_notifier();
 	cpufreq_unregister_driver(&bL_cpufreq_driver);
 	bL_switcher_put_enabled();
 	pr_info("%s: Un-registered platform driver: %s\n", __func__,
--
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER
  2015-05-11 11:24 [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER Sudeep Holla
@ 2015-05-12  7:27 ` Viresh Kumar
  2015-05-12  8:03   ` Sudeep Holla
  2015-05-13 12:35 ` [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE Sudeep Holla
  1 sibling, 1 reply; 7+ messages in thread
From: Viresh Kumar @ 2015-05-12  7:27 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-pm, linux-kernel, Jon Medhurst, Rafael J. Wysocki

On 11-05-15, 12:24, Sudeep Holla wrote:
> With the addition of switcher code, there's compile-time dependency on
> BL_SWITCHER to get arm_big_little driver compiling on ARM64. Since ARM64

The Kconfig dependency isn't on the switcher but big.LITTLE, which
isn't defined for arm64. So, we need a bit of clarity here.

> @@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
> 
>  	arm_bL_ops = ops;
> 
> -	ret = bL_switcher_get_enabled();
> -	set_switching_enabled(ret);
> +	set_switching_enabled(bL_switcher_get_enabled());

This change wasn't required.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER
  2015-05-12  7:27 ` Viresh Kumar
@ 2015-05-12  8:03   ` Sudeep Holla
  2015-05-12  9:36     ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: Sudeep Holla @ 2015-05-12  8:03 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Sudeep Holla, linux-pm, linux-kernel, Jon Medhurst, Rafael J. Wysocki



On 12/05/15 08:27, Viresh Kumar wrote:
> On 11-05-15, 12:24, Sudeep Holla wrote:
>> With the addition of switcher code, there's compile-time dependency on
>> BL_SWITCHER to get arm_big_little driver compiling on ARM64. Since ARM64
>
> The Kconfig dependency isn't on the switcher but big.LITTLE, which
> isn't defined for arm64. So, we need a bit of clarity here.
>

Right, we update accordingly.

>> @@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
>>
>>   	arm_bL_ops = ops;
>>
>> -	ret = bL_switcher_get_enabled();
>> -	set_switching_enabled(ret);
>> +	set_switching_enabled(bL_switcher_get_enabled());
>
> This change wasn't required.
>
Right, I thought ret is not used anywhere else and might produce 
warnings, which is wrong. I will revert it back.

Regards,
Sudeep

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER
  2015-05-12  8:03   ` Sudeep Holla
@ 2015-05-12  9:36     ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2015-05-12  9:36 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Sudeep Holla, linux-pm, linux-kernel, Jon Medhurst, Rafael J. Wysocki



On 12/05/15 09:03, Sudeep Holla wrote:
>
>
> On 12/05/15 08:27, Viresh Kumar wrote:
>> On 11-05-15, 12:24, Sudeep Holla wrote:
>>> With the addition of switcher code, there's compile-time dependency on
>>> BL_SWITCHER to get arm_big_little driver compiling on ARM64. Since ARM64
>>
>> The Kconfig dependency isn't on the switcher but big.LITTLE, which
>> isn't defined for arm64. So, we need a bit of clarity here.
>>
>
> Right, we update accordingly.
>
>>> @@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
>>>
>>>    	arm_bL_ops = ops;
>>>
>>> -	ret = bL_switcher_get_enabled();
>>> -	set_switching_enabled(ret);
>>> +	set_switching_enabled(bL_switcher_get_enabled());
>>
>> This change wasn't required.
>>
> Right, I thought ret is not used anywhere else and might produce
> warnings, which is wrong. I will revert it back.
>
Sorry replied too early, I have to retain it, or change it in
bL_cpufreq_unregister as the stub produces warning in one of the 2 call
sites since the return value is used in one place while discarded at
another.

Regards,
Sudeep


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE
  2015-05-11 11:24 [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER Sudeep Holla
  2015-05-12  7:27 ` Viresh Kumar
@ 2015-05-13 12:35 ` Sudeep Holla
  2015-05-13 13:00   ` Viresh Kumar
  1 sibling, 1 reply; 7+ messages in thread
From: Sudeep Holla @ 2015-05-13 12:35 UTC (permalink / raw)
  To: linux-pm, Viresh Kumar
  Cc: Sudeep Holla, linux-kernel, Jon Medhurst, Rafael J. Wysocki

With the addition of switcher code, there's compile-time dependency on
BIG_LITTLE to get arm_big_little driver compiling on ARM64. Since ARM64
will never add support for bL switcher, it's better to remove the
dependency so that the driver can be reused on ARM64 platforms.

This patch adds stubs to remove BIG_LITTLE dependency in the driver.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpufreq/Kconfig.arm      |  2 +-
 drivers/cpufreq/arm_big_little.c | 27 ++++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)

Changes v1->v2: replaced BL_SWITCHER with BIG_LITTLE in the title and
		commit log as suggested by Viresh

Hi Viresh,

As replied in the thread, I have retained one change which you suspected
as not necessary, in order to fix the warning we get.

Regards,
Sudeep


diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 4f3dbc8cf729..611cb09239eb 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -5,7 +5,7 @@
 # big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
-	depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
+	depends on (ARM_CPU_TOPOLOGY || ARM64) && HAVE_CLK
 	select PM_OPP
 	help
 	  This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index e4d75ca9f3b0..f1e42f8ce0fc 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -31,7 +31,6 @@
 #include <linux/slab.h>
 #include <linux/topology.h>
 #include <linux/types.h>
-#include <asm/bL_switcher.h>

 #include "arm_big_little.h"

@@ -41,12 +40,16 @@
 #define MAX_CLUSTERS	2

 #ifdef CONFIG_BL_SWITCHER
+#include <asm/bL_switcher.h>
 static bool bL_switching_enabled;
 #define is_bL_switching_enabled()	bL_switching_enabled
 #define set_switching_enabled(x)	(bL_switching_enabled = (x))
 #else
 #define is_bL_switching_enabled()	false
 #define set_switching_enabled(x)	do { } while (0)
+#define bL_switch_request(...)		do { } while (0)
+#define bL_switcher_put_enabled()	do { } while (0)
+#define bL_switcher_get_enabled()	do { } while (0)
 #endif

 #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)
@@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
 	.attr			= cpufreq_generic_attr,
 };

+#ifdef CONFIG_BL_SWITCHER
 static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb,
 					unsigned long action, void *_arg)
 {
@@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = {
 	.notifier_call = bL_cpufreq_switcher_notifier,
 };

+static int __bLs_register_notifier(void)
+{
+	return bL_switcher_register_notifier(&bL_switcher_notifier);
+}
+
+static int __bLs_unregister_notifier(void)
+{
+	return bL_switcher_unregister_notifier(&bL_switcher_notifier);
+}
+#else
+static int __bLs_register_notifier(void) { return 0; }
+static int __bLs_unregister_notifier(void) { return 0; }
+#endif
+
 int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
 {
 	int ret, i;
@@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)

 	arm_bL_ops = ops;

-	ret = bL_switcher_get_enabled();
-	set_switching_enabled(ret);
+	set_switching_enabled(bL_switcher_get_enabled());

 	for (i = 0; i < MAX_CLUSTERS; i++)
 		mutex_init(&cluster_lock[i]);
@@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
 				__func__, ops->name, ret);
 		arm_bL_ops = NULL;
 	} else {
-		ret = bL_switcher_register_notifier(&bL_switcher_notifier);
+		ret = __bLs_register_notifier();
 		if (ret) {
 			cpufreq_unregister_driver(&bL_cpufreq_driver);
 			arm_bL_ops = NULL;
@@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops)
 	}

 	bL_switcher_get_enabled();
-	bL_switcher_unregister_notifier(&bL_switcher_notifier);
+	__bLs_unregister_notifier();
 	cpufreq_unregister_driver(&bL_cpufreq_driver);
 	bL_switcher_put_enabled();
 	pr_info("%s: Un-registered platform driver: %s\n", __func__,
--
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE
  2015-05-13 12:35 ` [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE Sudeep Holla
@ 2015-05-13 13:00   ` Viresh Kumar
  2015-05-15  0:17     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Viresh Kumar @ 2015-05-13 13:00 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-pm, Linux Kernel Mailing List, Jon Medhurst, Rafael J. Wysocki

On 13 May 2015 at 18:05, Sudeep Holla <sudeep.holla@arm.com> wrote:
> With the addition of switcher code, there's compile-time dependency on
> BIG_LITTLE to get arm_big_little driver compiling on ARM64. Since ARM64
> will never add support for bL switcher, it's better to remove the
> dependency so that the driver can be reused on ARM64 platforms.
>
> This patch adds stubs to remove BIG_LITTLE dependency in the driver.
>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/Kconfig.arm      |  2 +-
>  drivers/cpufreq/arm_big_little.c | 27 ++++++++++++++++++++++-----
>  2 files changed, 23 insertions(+), 6 deletions(-)
>
> Changes v1->v2: replaced BL_SWITCHER with BIG_LITTLE in the title and
>                 commit log as suggested by Viresh
>
> Hi Viresh,
>
> As replied in the thread, I have retained one change which you suspected
> as not necessary, in order to fix the warning we get.
>
> Regards,
> Sudeep
>
>
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 4f3dbc8cf729..611cb09239eb 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -5,7 +5,7 @@
>  # big LITTLE core layer and glue drivers
>  config ARM_BIG_LITTLE_CPUFREQ
>         tristate "Generic ARM big LITTLE CPUfreq driver"
> -       depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
> +       depends on (ARM_CPU_TOPOLOGY || ARM64) && HAVE_CLK
>         select PM_OPP
>         help
>           This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
> diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
> index e4d75ca9f3b0..f1e42f8ce0fc 100644
> --- a/drivers/cpufreq/arm_big_little.c
> +++ b/drivers/cpufreq/arm_big_little.c
> @@ -31,7 +31,6 @@
>  #include <linux/slab.h>
>  #include <linux/topology.h>
>  #include <linux/types.h>
> -#include <asm/bL_switcher.h>
>
>  #include "arm_big_little.h"
>
> @@ -41,12 +40,16 @@
>  #define MAX_CLUSTERS   2
>
>  #ifdef CONFIG_BL_SWITCHER
> +#include <asm/bL_switcher.h>
>  static bool bL_switching_enabled;
>  #define is_bL_switching_enabled()      bL_switching_enabled
>  #define set_switching_enabled(x)       (bL_switching_enabled = (x))
>  #else
>  #define is_bL_switching_enabled()      false
>  #define set_switching_enabled(x)       do { } while (0)
> +#define bL_switch_request(...)         do { } while (0)
> +#define bL_switcher_put_enabled()      do { } while (0)
> +#define bL_switcher_get_enabled()      do { } while (0)
>  #endif
>
>  #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)
> @@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
>         .attr                   = cpufreq_generic_attr,
>  };
>
> +#ifdef CONFIG_BL_SWITCHER
>  static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb,
>                                         unsigned long action, void *_arg)
>  {
> @@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = {
>         .notifier_call = bL_cpufreq_switcher_notifier,
>  };
>
> +static int __bLs_register_notifier(void)
> +{
> +       return bL_switcher_register_notifier(&bL_switcher_notifier);
> +}
> +
> +static int __bLs_unregister_notifier(void)
> +{
> +       return bL_switcher_unregister_notifier(&bL_switcher_notifier);
> +}
> +#else
> +static int __bLs_register_notifier(void) { return 0; }
> +static int __bLs_unregister_notifier(void) { return 0; }
> +#endif
> +
>  int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
>  {
>         int ret, i;
> @@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
>
>         arm_bL_ops = ops;
>
> -       ret = bL_switcher_get_enabled();
> -       set_switching_enabled(ret);
> +       set_switching_enabled(bL_switcher_get_enabled());
>
>         for (i = 0; i < MAX_CLUSTERS; i++)
>                 mutex_init(&cluster_lock[i]);
> @@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
>                                 __func__, ops->name, ret);
>                 arm_bL_ops = NULL;
>         } else {
> -               ret = bL_switcher_register_notifier(&bL_switcher_notifier);
> +               ret = __bLs_register_notifier();
>                 if (ret) {
>                         cpufreq_unregister_driver(&bL_cpufreq_driver);
>                         arm_bL_ops = NULL;
> @@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops)
>         }
>
>         bL_switcher_get_enabled();
> -       bL_switcher_unregister_notifier(&bL_switcher_notifier);
> +       __bLs_unregister_notifier();
>         cpufreq_unregister_driver(&bL_cpufreq_driver);
>         bL_switcher_put_enabled();
>         pr_info("%s: Un-registered platform driver: %s\n", __func__,

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE
  2015-05-13 13:00   ` Viresh Kumar
@ 2015-05-15  0:17     ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2015-05-15  0:17 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Sudeep Holla, linux-pm, Linux Kernel Mailing List, Jon Medhurst

On Wednesday, May 13, 2015 06:30:23 PM Viresh Kumar wrote:
> On 13 May 2015 at 18:05, Sudeep Holla <sudeep.holla@arm.com> wrote:
> > With the addition of switcher code, there's compile-time dependency on
> > BIG_LITTLE to get arm_big_little driver compiling on ARM64. Since ARM64
> > will never add support for bL switcher, it's better to remove the
> > dependency so that the driver can be reused on ARM64 platforms.
> >
> > This patch adds stubs to remove BIG_LITTLE dependency in the driver.
> >
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/cpufreq/Kconfig.arm      |  2 +-
> >  drivers/cpufreq/arm_big_little.c | 27 ++++++++++++++++++++++-----
> >  2 files changed, 23 insertions(+), 6 deletions(-)
> >
> > Changes v1->v2: replaced BL_SWITCHER with BIG_LITTLE in the title and
> >                 commit log as suggested by Viresh
> >
> > Hi Viresh,
> >
> > As replied in the thread, I have retained one change which you suspected
> > as not necessary, in order to fix the warning we get.
> >
> > Regards,
> > Sudeep
> >
> >
> > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> > index 4f3dbc8cf729..611cb09239eb 100644
> > --- a/drivers/cpufreq/Kconfig.arm
> > +++ b/drivers/cpufreq/Kconfig.arm
> > @@ -5,7 +5,7 @@
> >  # big LITTLE core layer and glue drivers
> >  config ARM_BIG_LITTLE_CPUFREQ
> >         tristate "Generic ARM big LITTLE CPUfreq driver"
> > -       depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
> > +       depends on (ARM_CPU_TOPOLOGY || ARM64) && HAVE_CLK
> >         select PM_OPP
> >         help
> >           This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
> > diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
> > index e4d75ca9f3b0..f1e42f8ce0fc 100644
> > --- a/drivers/cpufreq/arm_big_little.c
> > +++ b/drivers/cpufreq/arm_big_little.c
> > @@ -31,7 +31,6 @@
> >  #include <linux/slab.h>
> >  #include <linux/topology.h>
> >  #include <linux/types.h>
> > -#include <asm/bL_switcher.h>
> >
> >  #include "arm_big_little.h"
> >
> > @@ -41,12 +40,16 @@
> >  #define MAX_CLUSTERS   2
> >
> >  #ifdef CONFIG_BL_SWITCHER
> > +#include <asm/bL_switcher.h>
> >  static bool bL_switching_enabled;
> >  #define is_bL_switching_enabled()      bL_switching_enabled
> >  #define set_switching_enabled(x)       (bL_switching_enabled = (x))
> >  #else
> >  #define is_bL_switching_enabled()      false
> >  #define set_switching_enabled(x)       do { } while (0)
> > +#define bL_switch_request(...)         do { } while (0)
> > +#define bL_switcher_put_enabled()      do { } while (0)
> > +#define bL_switcher_get_enabled()      do { } while (0)
> >  #endif
> >
> >  #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)
> > @@ -513,6 +516,7 @@ static struct cpufreq_driver bL_cpufreq_driver = {
> >         .attr                   = cpufreq_generic_attr,
> >  };
> >
> > +#ifdef CONFIG_BL_SWITCHER
> >  static int bL_cpufreq_switcher_notifier(struct notifier_block *nfb,
> >                                         unsigned long action, void *_arg)
> >  {
> > @@ -545,6 +549,20 @@ static struct notifier_block bL_switcher_notifier = {
> >         .notifier_call = bL_cpufreq_switcher_notifier,
> >  };
> >
> > +static int __bLs_register_notifier(void)
> > +{
> > +       return bL_switcher_register_notifier(&bL_switcher_notifier);
> > +}
> > +
> > +static int __bLs_unregister_notifier(void)
> > +{
> > +       return bL_switcher_unregister_notifier(&bL_switcher_notifier);
> > +}
> > +#else
> > +static int __bLs_register_notifier(void) { return 0; }
> > +static int __bLs_unregister_notifier(void) { return 0; }
> > +#endif
> > +
> >  int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
> >  {
> >         int ret, i;
> > @@ -562,8 +580,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
> >
> >         arm_bL_ops = ops;
> >
> > -       ret = bL_switcher_get_enabled();
> > -       set_switching_enabled(ret);
> > +       set_switching_enabled(bL_switcher_get_enabled());
> >
> >         for (i = 0; i < MAX_CLUSTERS; i++)
> >                 mutex_init(&cluster_lock[i]);
> > @@ -574,7 +591,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops)
> >                                 __func__, ops->name, ret);
> >                 arm_bL_ops = NULL;
> >         } else {
> > -               ret = bL_switcher_register_notifier(&bL_switcher_notifier);
> > +               ret = __bLs_register_notifier();
> >                 if (ret) {
> >                         cpufreq_unregister_driver(&bL_cpufreq_driver);
> >                         arm_bL_ops = NULL;
> > @@ -598,7 +615,7 @@ void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops)
> >         }
> >
> >         bL_switcher_get_enabled();
> > -       bL_switcher_unregister_notifier(&bL_switcher_notifier);
> > +       __bLs_unregister_notifier();
> >         cpufreq_unregister_driver(&bL_cpufreq_driver);
> >         bL_switcher_put_enabled();
> >         pr_info("%s: Un-registered platform driver: %s\n", __func__,
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Queued up for 4.2, thanks!


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-14 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 11:24 [PATCH] cpufreq: arm_big_little: remove compile-time dependency on BL_SWITCHER Sudeep Holla
2015-05-12  7:27 ` Viresh Kumar
2015-05-12  8:03   ` Sudeep Holla
2015-05-12  9:36     ` Sudeep Holla
2015-05-13 12:35 ` [PATCH v2] cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE Sudeep Holla
2015-05-13 13:00   ` Viresh Kumar
2015-05-15  0:17     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.