Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbbFYK2F (ORCPT ); Thu, 25 Jun 2015 06:28:05 -0400 Received: from foss.arm.com ([217.140.101.70]:56717 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbbFYK15 (ORCPT ); Thu, 25 Jun 2015 06:27:57 -0400 From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Suzuki Poulose , Lorenzo Pieralisi , Catalin Marinas , "Rafael J. Wysocki" , Thomas Gleixner , Preeti U Murthy Subject: [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST Date: Thu, 25 Jun 2015 11:27:45 +0100 Message-Id: <1435228065-2428-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2019 Lines: 47 tick_broadcast_enter returns 0 when CPU can switch to broadcast timer and non-zero otherwise. However when GENERIC_CLOCKEVENTS_BROADCAST and TICK_ONESHOT are disabled, tick_broadcast_oneshot_control returns 0 which indicates to the CPUIdle framework that the CPU can enter deeper idle states even when the CPU local timer will be shutdown. If the target state needs broadcast but not broadcast timer is available, then the CPU can not resume back from that idle state. This patch returns error when there's no broadcast timer support available so that CPUIdle framework prevents the CPU from entering any idle states losing the local timer. Cc: "Rafael J. Wysocki" Cc: Thomas Gleixner Cc: Preeti U Murthy Cc: Lorenzo Pieralisi Acked-by: Catalin Marinas Reported-and-Tested-by: Suzuki Poulose Signed-off-by: Sudeep Holla --- include/linux/tick.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index 3741ba1a652c..0624968a0bcc 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -70,7 +70,10 @@ static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { } #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state); #else -static inline int tick_broadcast_oneshot_control(enum tick_broadcast_state state) { return 0; } +static inline int tick_broadcast_oneshot_control(enum tick_broadcast_state state) +{ + return -ENODEV; +} #endif static inline void tick_broadcast_enable(void) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/