Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2043152imm; Thu, 24 May 2018 05:01:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZosCVO4XVSCIMBhf1ZJoxRpwDi8z16usVZMpzavUYOZKuK1AcDMKaue15CfiH2pXmukxHh7 X-Received: by 2002:a63:b34e:: with SMTP id x14-v6mr5682245pgt.70.1527163288679; Thu, 24 May 2018 05:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163288; cv=none; d=google.com; s=arc-20160816; b=1DlNwSmVhuBfSgpf6Bu5TTZHyL8d8UZt4AjL03siyia7ASkg/kCWRjo2Mc3k+zbxRQ hBVUS9RkHIk1BPfBITdfd52k/AuYajD0NEurI+cgwC1x4dopxuVYQvLwMfHB3dDUjZTc uGxlnRFGm5mpoOHUb6OQbK+nHHXEoqZXZP64i+X7yUHLXCaVUgSWVx1czJ28A+iulUT9 YD0OrJllG7WqNJPkEztfneUFjWNjkO0Hk11D2CT0uW0PdduYTkdxiqW+oOz/hp1s5ACr UrNvql3AqvEp0CS+7TvKEUxuWM7zfloRZ46peqsB3y74RgKCLaemddMUvIIfIpKUmGWo pZtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=QX5PnBgPGd0k20vFNtlp6IO/ei1+W0v1bZYUfDSro40=; b=DUi8O/Kizm6s/oksQAN5sWtBONpCA0EsWiibgzXDILJqALgMU7Erdq038wPOBvR7/M P6NtI68ZPk3C+kNTAXLhEFROtqDoSMl3sV4n/ekf8sYplXcGro8jjjkjBc/pCOrIq3Bt G+3hzDNxxtcRfS2brMvOjaPKPhlYifNjPmciDqAhB9FSBskrEE84X7/0T+k0IVGsthHu X9OOH1CJEOlLaFhslX81P8WwWx5xD8E5EvlblSNAw8s+/wwy40tOD/T/c1b8n52fTJOj ucdaV5ehWOC/MqfkACuwyvDn5MIqpJrPrvwwH/+5UMMze7uhEp2aqP/kf0sL1HDkOG9Y 8qow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8VGGCb+; 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 z2-v6si16763663pgp.234.2018.05.24.05.01.09; Thu, 24 May 2018 05:01:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=B8VGGCb+; 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 S966718AbeEXJpD (ORCPT + 99 others); Thu, 24 May 2018 05:45:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966710AbeEXJov (ORCPT ); Thu, 24 May 2018 05:44:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDDF6208C3; Thu, 24 May 2018 09:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155091; bh=R2qIEBnMmILRRK0NQrKiIOt4NEh5NaoJRNbTpOtqnk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8VGGCb+1Z7j1dzO45P8DflTs9Hd7Scm2iIH8itB9u9qB1M8CzSb44g2uCj85enq1 kzTUuKukbXcxgVRmoWtaWzYse/59XzmIIY570Q2beWIiAZZRPslV4ZCKmW3MfiOI7N 1AvHoMceS40A0u3np3YwrsheKxgxhID5ASVSZTrQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Pandruvada , "Rafael J. Wysocki" , Thomas Renninger Subject: [PATCH 4.4 52/92] cpufreq: intel_pstate: Enable HWP by default Date: Thu, 24 May 2018 11:38:29 +0200 Message-Id: <20180524093204.382965198@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Pandruvada commit 7791e4aa59ad724e0b4c8b4dea547a5735108972 upstream. If the processor supports HWP, enable it by default without checking for the cpu model. This will allow to enable HWP in all supported processors without driver change. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki Signed-off-by: Thomas Renninger Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/intel_pstate.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1361,6 +1361,11 @@ static inline bool intel_pstate_platform static inline bool intel_pstate_has_acpi_ppc(void) { return false; } #endif /* CONFIG_ACPI */ +static const struct x86_cpu_id hwp_support_ids[] __initconst = { + { X86_VENDOR_INTEL, 6, X86_MODEL_ANY, X86_FEATURE_HWP }, + {} +}; + static int __init intel_pstate_init(void) { int cpu, rc = 0; @@ -1370,17 +1375,16 @@ static int __init intel_pstate_init(void if (no_load) return -ENODEV; + if (x86_match_cpu(hwp_support_ids) && !no_hwp) { + copy_cpu_funcs(&core_params.funcs); + hwp_active++; + goto hwp_cpu_matched; + } + id = x86_match_cpu(intel_pstate_cpu_ids); if (!id) return -ENODEV; - /* - * The Intel pstate driver will be ignored if the platform - * firmware has its own power management modes. - */ - if (intel_pstate_platform_pwr_mgmt_exists()) - return -ENODEV; - cpu_def = (struct cpu_defaults *)id->driver_data; copy_pid_params(&cpu_def->pid_policy); @@ -1389,17 +1393,20 @@ static int __init intel_pstate_init(void if (intel_pstate_msrs_not_valid()) return -ENODEV; +hwp_cpu_matched: + /* + * The Intel pstate driver will be ignored if the platform + * firmware has its own power management modes. + */ + if (intel_pstate_platform_pwr_mgmt_exists()) + return -ENODEV; + pr_info("Intel P-state driver initializing.\n"); all_cpu_data = vzalloc(sizeof(void *) * num_possible_cpus()); if (!all_cpu_data) return -ENOMEM; - if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp) { - pr_info("intel_pstate: HWP enabled\n"); - hwp_active++; - } - if (!hwp_active && hwp_only) goto out; @@ -1410,6 +1417,9 @@ static int __init intel_pstate_init(void intel_pstate_debug_expose_params(); intel_pstate_sysfs_expose_params(); + if (hwp_active) + pr_info("intel_pstate: HWP enabled\n"); + return rc; out: get_online_cpus();