From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932901AbbBPNR0 (ORCPT ); Mon, 16 Feb 2015 08:17:26 -0500 Received: from casper.infradead.org ([85.118.1.10]:55461 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932600AbbBPNJa (ORCPT ); Mon, 16 Feb 2015 08:09:30 -0500 Message-Id: <20150216122412.920861318@infradead.org> User-Agent: quilt/0.61-1 Date: Mon, 16 Feb 2015 13:14:51 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, mingo@kernel.org, rjw@rjwysocki.net Cc: tglx@linutronix.de, peterz@infradead.org, Daniel Lezcano Subject: [PATCH 16/35] cpuidle: Use explicit broadcast control function References: <20150216121435.203983131@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=cpuilde-use-explicit-broadcast-control-function.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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), &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);