Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933103AbbGUPkN (ORCPT ); Tue, 21 Jul 2015 11:40:13 -0400 Received: from mga14.intel.com ([192.55.52.115]:30473 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754768AbbGUPkH (ORCPT ); Tue, 21 Jul 2015 11:40:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,517,1432623600"; d="scan'208";a="768406851" Message-ID: <1437493051.2377.170.camel@spandruv-DESK3.jf.intel.com> Subject: Re: [PATCH RFC] intel_pstate: play well with frequency limits set by acpi From: Srinivas Pandruvada To: Konstantin Khlebnikov Cc: Konstantin Khlebnikov , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Linux Kernel Mailing List , linux-acpi@vger.kernel.org, Kristen Carlson Accardi , Len Brown , Ethan Zhao Date: Tue, 21 Jul 2015 08:37:31 -0700 In-Reply-To: <55AE1DFC.3090209@yandex-team.ru> References: <20150716181706.6500.64386.stgit@buzz> <1437084536.2377.117.camel@spandruv-DESK3.jf.intel.com> <1437426504.2377.162.camel@spandruv-DESK3.jf.intel.com> <55AE1DFC.3090209@yandex-team.ru> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2909 Lines: 60 On Tue, 2015-07-21 at 13:25 +0300, Konstantin Khlebnikov wrote: > On 21.07.2015 00:08, Srinivas Pandruvada wrote: > > On Fri, 2015-07-17 at 07:36 +0300, Konstantin Khlebnikov wrote: > >> On Fri, Jul 17, 2015 at 1:08 AM, Srinivas Pandruvada > >> wrote: > >>> On Thu, 2015-07-16 at 21:17 +0300, Konstantin Khlebnikov wrote: > >>>> IPMI can control CPU P-states remotely: configuration is reported via > >>>> common ACPI interface (_PPC/_PSS/etc). This patch adds required minimal > >>>> support in intel_pstate to receive and use these P-state limits. > >>>> > >>>> * ignore limit of top state in _PPC: it lower than turbo boost frequency > >>>> * register intel_pstate in acpi-processor to get states from _PSS > >>>> * link acpi_processor_get_bios_limit: this adds attribute "bios_limit" > >>>> > >>>> Signed-off-by: Konstantin Khlebnikov > >>>> --- > >>>> drivers/acpi/processor_perflib.c | 3 +- > >>>> drivers/cpufreq/intel_pstate.c | 57 ++++++++++++++++++++++++++++++++++++++ > >>>> 2 files changed, 59 insertions(+), 1 deletion(-) > >>>> > >>>> diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c > >>>> index cfc8aba72f86..781e328c9d5f 100644 > >>>> --- a/drivers/acpi/processor_perflib.c > >>>> +++ b/drivers/acpi/processor_perflib.c > >>>> @@ -98,7 +98,8 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, > >>>> > >>>> ppc = (unsigned int)pr->performance_platform_limit; > >>>> > >>>> - if (ppc >= pr->performance->state_count) > >>>> + /* Ignore limit of top state: it lower than turbo boost frequency */ > >>>> + if (!ppc || ppc >= pr->performance->state_count) > >>> Why? Isn't the previous check enough? > >> > >> Zero _PPC state must be top performance state but as I see frequency in > >> _PSS is lower than maximum possible turbo frequency. So, in this case > >> intel_pstate cannnot get "100%" for max bound even it there is no limit set. > >> > >> For example: I saw _PSS[0] = 2601 Mhz, PSS[1] = 2600 Mhz while turbo > >> state is 3400 Mhz. > >> > > Have you tested dynamic _PPC modification with acpi cpufreq with this > > change (after boot)? Suppose _PPC is changed from 3 to 0, then > > cpufreq_verify_within_limits will not be called to change to new max > > turbo performance state. > > > > I haven't checked that but as I see acpi_processor_ppc_notifier() > can only reduce maximum frequency. So, there should be no problem > in this case. No, it can also be used in both ways. Once reduced, it can increase as well. _PPC can be dynamically modified by BIOS to reduce and also to increase. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/