From patchwork Tue Dec 16 06:52:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 5499571 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1E219F1CD for ; Tue, 16 Dec 2014 06:52:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D058020A21 for ; Tue, 16 Dec 2014 06:52:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0D5220A14 for ; Tue, 16 Dec 2014 06:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751107AbaLPGwV (ORCPT ); Tue, 16 Dec 2014 01:52:21 -0500 Received: from mail-yh0-f52.google.com ([209.85.213.52]:34623 "EHLO mail-yh0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbaLPGwS (ORCPT ); Tue, 16 Dec 2014 01:52:18 -0500 Received: by mail-yh0-f52.google.com with SMTP id z6so5825321yhz.25 for ; Mon, 15 Dec 2014 22:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=ZfKXG2zsEE9c0NSDDmONhTkjEdaRoJyvI4UMZXSGZWk=; b=t/MlmMyan8zI9saocqOwRCA0EAapIDdyI6iPkBDC8uYicT9MqgBlNtL11r76kZCQZe mQ4aPhIfHXpgxRezVVSJcdRO+UOwwlMuLDTmaRvfWLMMQZKtMZN2KbUsmE7cOG9KjBHf qja7S8a+vKsnmfHEd8CUUB7/eK1djPvihNeK7ddDcSUlphmcCJoGXdBu+RBjuQUEkt3j RU9C9N6e9xd7sB7chtWpFKmwi/XKRBzLgMsyQIJ3enKoyVFOnkYpIlWQXyloXlNX4egH 9jQ0qsSw9WIn3HH59f/oP6zDcwChLWMnswgCZAk/pnf9BIeOLMz7Jyi1964Qzts706ZP OcFQ== X-Received: by 10.236.228.101 with SMTP id e95mr25720632yhq.56.1418712738170; Mon, 15 Dec 2014 22:52:18 -0800 (PST) Received: from localhost.localdomain (pool-108-20-130-222.bstnma.fios.verizon.net. [108.20.130.222]) by mx.google.com with ESMTPSA id v68sm7336009yhp.2.2014.12.15.22.52.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 22:52:17 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Len Brown , Daniel Lezcano Subject: [PATCH 3/3] cpuidle, ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID Date: Tue, 16 Dec 2014 01:52:08 -0500 Message-Id: <2d1595ea66f8eadeb1e337354b311c4f5282e2a1.1418712225.git.len.brown@intel.com> X-Mailer: git-send-email 2.1.2.451.g98349e5 In-Reply-To: <1418712728-2193-1-git-send-email-lenb@kernel.org> References: <1418712728-2193-1-git-send-email-lenb@kernel.org> In-Reply-To: References: Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown CPUIDLE_FLAG_TIME_INVALID is no longer checked by menu or ladder cpuidle governors, so don't bother setting or defining it. It was originally invented to account for the fact that acpi_safe_halt() enables interrupts to invoke HLT. That would allow interrupt service routines to be included in the last_idle duration measurements made in cpuidle_enter_state(), potentially returning a duration much larger than reality. But menu and ladder can gracefully handle erroneously large duration intervals without checking for CPUIDLE_FLAG_TIME_INVALID. Further, if they don't check CPUIDLE_FLAG_TIME_INVALID, they can also benefit from the instances when the duration interval is not erroneously large. Signed-off-by: Len Brown Cc: Daniel Lezcano Acked-by: Daniel Lezcano --- drivers/acpi/processor_idle.c | 2 -- include/linux/cpuidle.h | 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 4995365..87b704e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -985,8 +985,6 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) state->flags = 0; switch (cx->type) { case ACPI_STATE_C1: - if (cx->entry_method != ACPI_CSTATE_FFH) - state->flags |= CPUIDLE_FLAG_TIME_INVALID; state->enter = acpi_idle_enter_c1; state->enter_dead = acpi_idle_play_dead; diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index a07e087..ab70f3b 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -53,7 +53,6 @@ struct cpuidle_state { }; /* Idle State Flags */ -#define CPUIDLE_FLAG_TIME_INVALID (0x01) /* is residency time measurable? */ #define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */ #define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */ @@ -89,8 +88,6 @@ DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev); /** * cpuidle_get_last_residency - retrieves the last state's residency time * @dev: the target CPU - * - * NOTE: this value is invalid if CPUIDLE_FLAG_TIME_INVALID is set */ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) {