From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660AbcEBCM1 (ORCPT ); Sun, 1 May 2016 22:12:27 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33609 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752151AbcEBCMS (ORCPT ); Sun, 1 May 2016 22:12:18 -0400 Date: Mon, 2 May 2016 07:42:12 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Srinivas Pandruvada , Linux Kernel Mailing List Subject: Re: [PATCH] cpufreq: intel_pstate: Fix HWP on boot CPU after system resume Message-ID: <20160502021212.GE2855@vireshk-i7> References: <7068194.yg8ROcCISN@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7068194.yg8ROcCISN@vostro.rjw.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-05-16, 02:27, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Commit 41cfd64cf49fc "Update frequencies of policy->cpus only from > ->set_policy()" changed the way the intel_pstate driver's ->set_policy > callback updates the HWP (hardware-managed P-states) settings. > A side effect of it is that if those settings are modified on the > boot CPU during system suspend and wakeup, they will never be > restored during subsequent system resume. > > To address this problem, allow cpufreq drivers that don't provide > ->target or ->target_index callbacks to use ->suspend and ->resume > callbacks and add a ->resume callback to intel_pstate to restore > the HWP settings on the CPUs that belong to the given policy. > > Fixes: 41cfd64cf49fc "Update frequencies of policy->cpus only from ->set_policy()" > Tested-by: Srinivas Pandruvada > Signed-off-by: Rafael J. Wysocki > --- > > Note: We've tried to address that issue by adding syscore_ops to > intel_pstate and restoring the boot CPU's HWP setting from a > syscore resume, but that turns out to be too early (apparently, > the processor is not ready for that at that point). > > --- > drivers/cpufreq/cpufreq.c | 28 ++++++++++++++++------------ > drivers/cpufreq/intel_pstate.c | 12 ++++++++++-- > 2 files changed, 26 insertions(+), 14 deletions(-) Acked-by: Viresh Kumar -- viresh