Received: by 10.192.165.148 with SMTP id m20csp532141imm; Wed, 25 Apr 2018 03:48:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZps/rBcEKA54Hcy3tkKnsX/HmJcj/iPodMdPatRbkTaEIN8qNd9JG5T4LPJeeSpi+aur0lU X-Received: by 10.98.75.22 with SMTP id y22mr753776pfa.29.1524653291430; Wed, 25 Apr 2018 03:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653291; cv=none; d=google.com; s=arc-20160816; b=EPxWyF9X0TnEhPA+EYxwBF27o4snbn4fCbcvbNqMHDUj6WbMUrsAnPx+AE00iuk3ms BBSer5yBer8zKCzZbKOcVxcrPJ8lKmCZXbo8b03sW9dfHekBcMI61A59c8M8O1lucrGD GHCEMWO60wiJM/zF1sCN91JIRrGqxs5NPDpv9gNMVuAPM+e9V5lEcngD+pQ9SwlZF44b Z8StFQVzlkypokeihcsDa067DzQRrsg6HY8pSO7VmrVX4xkbKpiqC0GEXodHsgXVhFOk lmgRuRI2PIljZmD8AwlNk1WceI9q05SvD1bPuf36Yj+J3GZxJmdxw5cOLQzhDfGttZeW XqxQ== 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 :arc-authentication-results; bh=bU8908BmJEbgcTu0SIKlxrn1BECAkWqUu9kmXSOdFBQ=; b=w08sSu8Zoyv01Wq4cOFaKZf46ZyfoYnrR5vvDDTM+hwlS+WfGhPNYs61Rr0boBq+47 KYABSRb3QOtWt7T8xoForSRqTjg75twhZUu2syPYGZG3zMh2HnmlcdU8M+MwBa6/85+u axSI/G3QodYsgJSCmoDL0a2UQPRsOaq6Nur47/Ond3zcjVwOGF2eotlnvlENDYm88VmE R0WFXzDdj7xi/q/l/SsQ1kJSNGxhPyCKD8Vv432w+ZXWPuGBHMnnKvWB1pGf7LCZLmak Sl42AAe+uGa5My4Yb3EBMEZ9jOLYxq7irriLHIexHjiCaSdf5ccx1IeW2gquzNudH/TV 8//g== 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 e1-v6si15910252pld.69.2018.04.25.03.47.56; Wed, 25 Apr 2018 03:48:11 -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 S1754165AbeDYKq0 (ORCPT + 99 others); Wed, 25 Apr 2018 06:46:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53518 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754499AbeDYKpK (ORCPT ); Wed, 25 Apr 2018 06:45:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 35F1736; Wed, 25 Apr 2018 10:45:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Smythies , Srinivas Pandruvada , Yu Chen , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 151/183] cpufreq: intel_pstate: Enable HWP during system resume on CPU0 Date: Wed, 25 Apr 2018 12:36:11 +0200 Message-Id: <20180425103248.606860969@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen Yu [ Upstream commit 70f6bf2a3b7e40c3f802b0ea837762a8bc6c1430 ] When maxcpus=1 is in the kernel command line, the BP is responsible for re-enabling the HWP - because currently only the APs invoke intel_pstate_hwp_enable() during their online process - which might put the system into unstable state after resume. Fix this by enabling the HWP explicitly on BP during resume. Reported-by: Doug Smythies Suggested-by: Srinivas Pandruvada Signed-off-by: Yu Chen [ rjw: Subject/changelog, minor modifications ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -779,6 +779,8 @@ static int intel_pstate_hwp_save_state(s return 0; } +static void intel_pstate_hwp_enable(struct cpudata *cpudata); + static int intel_pstate_resume(struct cpufreq_policy *policy) { if (!hwp_active) @@ -786,6 +788,9 @@ static int intel_pstate_resume(struct cp mutex_lock(&intel_pstate_limits_lock); + if (policy->cpu == 0) + intel_pstate_hwp_enable(all_cpu_data[policy->cpu]); + all_cpu_data[policy->cpu]->epp_policy = 0; intel_pstate_hwp_set(policy->cpu);