Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3724201imm; Tue, 17 Jul 2018 09:15:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeu1KPwCYSU1YXLwOVdAxjOzhJlNMXWI/yXK1ZwaqfdF+EMqMvkZaqGjCtRB2l8npAUjFYf X-Received: by 2002:a17:902:6105:: with SMTP id t5-v6mr2269083plj.92.1531844152589; Tue, 17 Jul 2018 09:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531844152; cv=none; d=google.com; s=arc-20160816; b=Ppcp7DmQkbC5vuNNpLwDpG37OAS/FcdCEFJrOWzT0/N2WJxSpmfzzl91MgkzNWPRA6 l+WfYgRIAvy/pIwL4SVEWMZMyAl+4mDHExnoy++52UitwCwVR9ptxy9BAHw4OVI1cEnV CN1lFvppM13GlLCTortCv0sTG8f/ya/MsnQttM4MteZylfm2VH8lB671Kg/Mj97kJJIF 5dzKsQMWJ737lvBd/FQfQJsItSZgfiJ++BDObEBD/pYaX42NaqmR2yPnwQs6rXfn+tSZ 6NH9xYvBSY/suDt9oQLUlJT6c0WWHWLR88U6E3EYEkETdMRMhw/fK1KCZp37ouNjIza4 XmPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BWdpyybThXbgqzVOO2LWXbufsF781yqFB0b8+8LpLBg=; b=GKbBWbSvsyrbg7Nreg1ETHBUdg4kAGl9dKam51sqjX48YFX0yce0sCXt2uDonNYE1y LE3XpD7Ddd0RL0U4m4SxZWF0Z3vUc+dpe+hUM96JtozqmIdoy0t/KHAmFGifPcbZRpc3 CnNcUlzevnxto3lZYvL2yRaaux5ZSwEbUChcYH2UXpzXKbGXtDnqtxDaLX8MNrhAz8H2 t9yqprzjGSIFkE17ncczp78DlvMqOK+NA5mTDMCi5uxSlPXKbLQUOFicwdsZ0PJy0x84 j9AfEv6Sah6mgSg9iBzQY8Ot9OmCXbeH/Z+hyXwr1912ysUXuXNiqJhsXsnDXr2l30ud 573Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e93-v6si1217052plb.135.2018.07.17.09.15.37; Tue, 17 Jul 2018 09:15:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729934AbeGQQsY (ORCPT + 99 others); Tue, 17 Jul 2018 12:48:24 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42458 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729671AbeGQQsX (ORCPT ); Tue, 17 Jul 2018 12:48:23 -0400 Received: from 79.184.255.17.ipv4.supernova.orange.pl (79.184.255.17) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id c70ab66d59d54dc9; Tue, 17 Jul 2018 18:14:57 +0200 From: "Rafael J. Wysocki" To: Andreas Herrmann , Srinivas Pandruvada Cc: "Rafael J. Wysocki" , Peter Zijlstra , Frederic Weisbecker , Viresh Kumar , Linux PM , Linux Kernel Mailing List Subject: [PATCH] cpufreq: intel_pstate: Load when ACPI PCCH is present Date: Tue, 17 Jul 2018 18:13:19 +0200 Message-ID: <8115130.Fhkpr82c7G@aspire.rjw.lan> In-Reply-To: <20180717140336.ayovaz4ksdlak6bb@suselix> References: <20180717065048.74mmgk4t5utjaa6a@suselix> <20180717102136.snayvzmv2h3dcwiq@suselix> <20180717140336.ayovaz4ksdlak6bb@suselix> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Currently, intel_pstate doesn't load if _PSS is not present on HP Proliant systems, because it expects the firmware to take over CPU performance scaling in that case. However, if ACPI PCCH is present, the firmware expects the kernel to use it for CPU performance scaling and the pcc-cpufreq driver is loaded for that. Unfortunately, the firmware interface used by that driver is not scalable for fundamental reasons, so pcc-cpufreq is way suboptimal on systems with more than just a few CPUs. In fact, it is better to avoid using it at all. For this reason, modify intel_pstate to look for ACPI PCCH if _PSS is not present and load if it is there. Fixes: fbbcdc0744da (intel_pstate: skip the driver if ACPI has power mgmt option) Reported-by: Andreas Herrmann Tested-by: Andreas Herrmann Reviewed-by: Andreas Herrmann Cc: 4.17+ # 4.17+ Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -2391,6 +2391,18 @@ static bool __init intel_pstate_no_acpi_ return true; } +static bool __init intel_pstate_no_acpi_pcch(void) +{ + acpi_status status; + acpi_handle handle; + + status = acpi_get_handle(NULL, "\\_SB", &handle); + if (ACPI_FAILURE(status)) + return true; + + return !acpi_has_method(handle, "PCCH"); +} + static bool __init intel_pstate_has_acpi_ppc(void) { int i; @@ -2450,7 +2462,10 @@ static bool __init intel_pstate_platform switch (plat_info[idx].data) { case PSS: - return intel_pstate_no_acpi_pss(); + if (!intel_pstate_no_acpi_pss()) + return false; + + return intel_pstate_no_acpi_pcch(); case PPC: return intel_pstate_has_acpi_ppc() && !force_load; }