From patchwork Thu Dec 3 22:30:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 336952 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp674375ilb; Thu, 3 Dec 2020 14:32:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIDyi0otDf4W9x7tyVfBDuxN1trPo2apMY1tw+tNpnuUaLZ64gwpS3IG7EmHDSuKKWDInj X-Received: by 2002:a17:907:2070:: with SMTP id qp16mr4457153ejb.503.1607034746432; Thu, 03 Dec 2020 14:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607034746; cv=none; d=google.com; s=arc-20160816; b=fyrI1vPjrNx0CR0kjzaU2Z17IFAjSURyp+dOyFwygXgTP3w4oWCwqaVdWrpcDn+vwv yowxwd4Yc89jnBbtQA/NR6PGJhgEUlMNkssLlHrtodD1Jsqn8qEiLWxy7RPcR94ZP656 +3yFNri61YipTeHuHfjZJIcRX5Sz3A+qfpryoOMhuvgqGsfact1jUtXLQ/3ttKgMK+Um HYQHle+eHTNrLgtOOR2IEKeMNQWCKRTC29HWVqGGknm+36pzKX7ppYn1C2/jUg7fJvYy nsXVN/72GhJ795ixewy982YtSG+BwbzafxhX4ADHRqeyp7+OTYzfKXUdJP4bbX1+9F2V LFrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=O5XDvxj5tDmA26oVK7evQ1kvTzGDUn7xRsqHilQFJmU=; b=LfHeel+ydkNRcwS7Ep1JLpM9n5s+NN9nBJNnaLsshlKCfsR2OwNrPX6H6PtqHVPWFv Dly8KmXvuQxtPVj54Lj4GmCgYDVu2muJ24+1gfyB7EmvS+UG82QCyfiiiSgdFZBpBc3B cckxzRRyZ1YbtTy75FQ69Ko8Mb5Df/A68x1GmlK1q9igpCh5zrHF/sG6PM4l0NM4++k6 Bgo7Nu+AyFzIPxW4O7Jd5HNjNe1hwdgZg3hUKBEXRoo3VZKDMC6uVgIHG6koc4Czcrd6 rtub5zMHUHhaIdtsnYcw6dEoC5+E59DRcf3zuyohgC0FiSy6UH3Ti0oNNoM6dioIz2yk ObiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x60si1782756ede.80.2020.12.03.14.32.26; Thu, 03 Dec 2020 14:32:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731707AbgLCWbH (ORCPT + 8 others); Thu, 3 Dec 2020 17:31:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:55038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729453AbgLCWbF (ORCPT ); Thu, 3 Dec 2020 17:31:05 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Jacob Pan , Len Brown , Peter Zijlstra , "Rafael J. Wysocki" Cc: Arnd Bergmann , Chen Yu , Borislav Petkov , Thomas Gleixner , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] intel_idle: fix intel_idle_state_needs_timer_stop build failure Date: Thu, 3 Dec 2020 23:30:13 +0100 Message-Id: <20201203223020.1173185-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Arnd Bergmann The newly added function is defined inside of an #ifdef section but used outside, leading to a build failure: drivers/idle/intel_idle.c:1510:7: error: implicit declaration of function 'intel_idle_state_needs_timer_stop' [-Werror,-Wimplicit-function-declaration] if (intel_idle_state_needs_timer_stop(&drv->states[drv->state_count])) ^ Move it ahead of the CONFIG_ACPI_PROCESSOR_CSTATE check. Fixes: 6e1d2bc675bd ("intel_idle: Fix intel_idle() vs tracing") Signed-off-by: Arnd Bergmann --- drivers/idle/intel_idle.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) -- 2.27.0 diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 7ee7ffe22ae3..d79335506ecd 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -1140,6 +1140,20 @@ static bool __init intel_idle_max_cstate_reached(int cstate) return false; } +static bool __init intel_idle_state_needs_timer_stop(struct cpuidle_state *state) +{ + unsigned long eax = flg2MWAIT(state->flags); + + if (boot_cpu_has(X86_FEATURE_ARAT)) + return false; + + /* + * Switch over to one-shot tick broadcast if the target C-state + * is deeper than C1. + */ + return !!((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK); +} + #ifdef CONFIG_ACPI_PROCESSOR_CSTATE #include @@ -1210,20 +1224,6 @@ static bool __init intel_idle_acpi_cst_extract(void) return false; } -static bool __init intel_idle_state_needs_timer_stop(struct cpuidle_state *state) -{ - unsigned long eax = flg2MWAIT(state->flags); - - if (boot_cpu_has(X86_FEATURE_ARAT)) - return false; - - /* - * Switch over to one-shot tick broadcast if the target C-state - * is deeper than C1. - */ - return !!((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK); -} - static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);