Re: [PATCH 16/35] cpuidle: Use explicit broadcast control function

2015-02-23 Thread Daniel Lezcano

On 02/16/2015 01:14 PM, Peter Zijlstra wrote:

[ patch not inline ]

Acked-by: Daniel Lezcano 

--
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 16/35] cpuidle: Use explicit broadcast control function

2015-02-23 Thread Daniel Lezcano

On 02/16/2015 01:14 PM, Peter Zijlstra wrote:

[ patch not inline ]

Acked-by: Daniel Lezcano daniel.lezc...@linaro.org

--
 http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  http://www.facebook.com/pages/Linaro Facebook |
http://twitter.com/#!/linaroorg Twitter |
http://www.linaro.org/linaro-blog/ Blog

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/35] cpuidle: Use explicit broadcast control function

2015-02-16 Thread Peter Zijlstra
From: Thomas Gleixner 

Replace the clockevents_notify() call with an explicit function call.

Signed-off-by: Thomas Gleixner 
Cc: "Rafael J. Wysocki" 
Cc: Daniel Lezcano 
---
 drivers/cpuidle/driver.c |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

Index: linux/drivers/cpuidle/driver.c
===
--- linux.orig/drivers/cpuidle/driver.c
+++ linux/drivers/cpuidle/driver.c
@@ -13,7 +13,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "cpuidle.h"
 
@@ -130,21 +130,20 @@ static inline void __cpuidle_unset_drive
 #endif
 
 /**
- * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer
+ * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer on a cpu
  * @arg: a void pointer used to match the SMP cross call API
  *
- * @arg is used as a value of type 'long' with one of the two values:
- * - CLOCK_EVT_NOTIFY_BROADCAST_ON
- * - CLOCK_EVT_NOTIFY_BROADCAST_OFF
- *
- * Set the broadcast timer notification for the current CPU.  This function
- * is executed per CPU by an SMP cross call.  It not supposed to be called
- * directly.
+ * If @arg is NULL broadcast is disabled otherwise enabled
+ *
+ * This function is executed per CPU by an SMP cross call.  It's not
+ * supposed to be called directly.
  */
 static void cpuidle_setup_broadcast_timer(void *arg)
 {
-   int cpu = smp_processor_id();
-   clockevents_notify((long)(arg), );
+   if (arg)
+   tick_broadcast_enable();
+   else
+   tick_broadcast_disable();
 }
 
 /**
@@ -239,7 +238,7 @@ static int __cpuidle_register_driver(str
 
if (drv->bctimer)
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
-(void *)CLOCK_EVT_NOTIFY_BROADCAST_ON, 1);
+(void *)1, 1);
 
poll_idle_init(drv);
 
@@ -263,7 +262,7 @@ static void __cpuidle_unregister_driver(
if (drv->bctimer) {
drv->bctimer = 0;
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
-(void *)CLOCK_EVT_NOTIFY_BROADCAST_OFF, 1);
+NULL, 1);
}
 
__cpuidle_unset_driver(drv);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/35] cpuidle: Use explicit broadcast control function

2015-02-16 Thread Peter Zijlstra
From: Thomas Gleixner t...@linutronix.de

Replace the clockevents_notify() call with an explicit function call.

Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Rafael J. Wysocki r...@rjwysocki.net
Cc: Daniel Lezcano daniel.lezc...@linaro.org
---
 drivers/cpuidle/driver.c |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

Index: linux/drivers/cpuidle/driver.c
===
--- linux.orig/drivers/cpuidle/driver.c
+++ linux/drivers/cpuidle/driver.c
@@ -13,7 +13,7 @@
 #include linux/sched.h
 #include linux/cpuidle.h
 #include linux/cpumask.h
-#include linux/clockchips.h
+#include linux/tick.h
 
 #include cpuidle.h
 
@@ -130,21 +130,20 @@ static inline void __cpuidle_unset_drive
 #endif
 
 /**
- * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer
+ * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer on a cpu
  * @arg: a void pointer used to match the SMP cross call API
  *
- * @arg is used as a value of type 'long' with one of the two values:
- * - CLOCK_EVT_NOTIFY_BROADCAST_ON
- * - CLOCK_EVT_NOTIFY_BROADCAST_OFF
- *
- * Set the broadcast timer notification for the current CPU.  This function
- * is executed per CPU by an SMP cross call.  It not supposed to be called
- * directly.
+ * If @arg is NULL broadcast is disabled otherwise enabled
+ *
+ * This function is executed per CPU by an SMP cross call.  It's not
+ * supposed to be called directly.
  */
 static void cpuidle_setup_broadcast_timer(void *arg)
 {
-   int cpu = smp_processor_id();
-   clockevents_notify((long)(arg), cpu);
+   if (arg)
+   tick_broadcast_enable();
+   else
+   tick_broadcast_disable();
 }
 
 /**
@@ -239,7 +238,7 @@ static int __cpuidle_register_driver(str
 
if (drv-bctimer)
on_each_cpu_mask(drv-cpumask, cpuidle_setup_broadcast_timer,
-(void *)CLOCK_EVT_NOTIFY_BROADCAST_ON, 1);
+(void *)1, 1);
 
poll_idle_init(drv);
 
@@ -263,7 +262,7 @@ static void __cpuidle_unregister_driver(
if (drv-bctimer) {
drv-bctimer = 0;
on_each_cpu_mask(drv-cpumask, cpuidle_setup_broadcast_timer,
-(void *)CLOCK_EVT_NOTIFY_BROADCAST_OFF, 1);
+NULL, 1);
}
 
__cpuidle_unset_driver(drv);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/