Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1946023ybh; Tue, 14 Jul 2020 11:18:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoYdBoReS4nZIVkBPImbScGCFNiii8wMcbxQsO86EQlu2WyKZEEw03FW0lEajc7qWfjOIV X-Received: by 2002:a50:d0cc:: with SMTP id g12mr5922308edf.57.1594750723654; Tue, 14 Jul 2020 11:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594750723; cv=none; d=google.com; s=arc-20160816; b=RY8GwdQ9zPPHyncfG9aU99nsmwJgi9m8TzhG10fGUxCsTD6HR+W90YITWrKZ9AVeEb HeGbVG02Vgg1SdDrzvLjs69bv03ell86cCdF4r+OdlbSsslP7MtcQOhRG6LB+BKDQvzz Pm3tS6MPIQcV4XTVIvshM0dVV3CFo886gpWp9xOJ2LAJIi04fFryzWo7nN992NqC/5eX SkedHSBFprYpGi4dSiRKL4+PGvCfYWuSXUTMmSsw3g6nNvNvFMZ8k87HAv9/EkrEp/cY NA+H/wMrl8yUGeeq+8ufbV1y1zvspPmjWmtmIdcdrmmnC+HMBaJ6SBsSBxVDoF9zoLys V8+A== 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 :message-id:date:subject:cc:to:from; bh=/cqeJHrRkWjv/YjWVqe0h4tGqiaw8+fHx1DB/za/Vvs=; b=RouzlkBkkVM/gx7V5q8jWfcfhyOXnc26hjqaqgrVRS5PBuLu1s1kzr8mH3IJmtkqKs 4Gn+lA8GkFsS3QS9RUCmGuMPk0oy3B1SZHNEv8+xOhsx6OgpRNR5BElt8lQm7v5sn6GS Oyuthicf8yUVFluG7cpcHZtDXHjVFgjW8ghlM4mzl913Z7aEXQhXjA8EM+M1tpJCIB4H V1QulfEITFuBvdG9yulbqIzDVG/3VPpLfINxgvbHMs2EgDXfjdM6voKl13r6c8ypGaHC mBJ5BSZ/NiREz/eVm4v20HYKDdDs65E3MpSpGNmQfG+qqgL08dmpv/49sLB3ld+wZSbU 1ImQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c89si12275246edf.35.2020.07.14.11.18.19; Tue, 14 Jul 2020 11:18:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729269AbgGNSR2 (ORCPT + 99 others); Tue, 14 Jul 2020 14:17:28 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:62378 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729260AbgGNSR1 (ORCPT ); Tue, 14 Jul 2020 14:17:27 -0400 Received: from 89-64-83-139.dynamic.chello.pl (89.64.83.139) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 5dfe8d161d0ab4fd; Tue, 14 Jul 2020 20:17:24 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada Subject: [PATCH] cpufreq: intel_pstate: Avoid enabling HWP if EPP is not supported Date: Tue, 14 Jul 2020 20:17:24 +0200 Message-ID: <1776084.Fkt4dJnx8e@kreacher> 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 Although there are processors supporting hardware-managed P-states (HWP) without the energy-performance preference (EPP) feature, they are not expected to be run with HWP enabled (the BIOS should disable HWP on those systems). Missing EPP support generally indicates an incomplete HWP implementation and so it is better to avoid using HWP on those systems in production. However, intel_pstate currently enables HWP on such systems, which is questionable, so prevent it from doing that by making it check EPP support before enabling HWP and avoid enabling it if EPP is not supported by the processor at hand. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 7 ++++++- 1 file changed, 6 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 @@ -2899,7 +2899,12 @@ static int __init intel_pstate_init(void id = x86_match_cpu(hwp_support_ids); if (id) { copy_cpu_funcs(&core_funcs); - if (!no_hwp) { + /* + * Avoid enabling HWP for processors without EPP support, + * because that means incomplete HWP implementation which is a + * corner case and supporting it is generally problematic. + */ + if (!no_hwp && boot_cpu_has(X86_FEATURE_HWP_EPP)) { hwp_active++; hwp_mode_bdw = id->driver_data; intel_pstate.attr = hwp_cpufreq_attrs;