From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v3 03/11] x86/intel_pstate: add new policy fields and a new driver interface Date: Thu, 18 Jun 2015 15:15:51 +0100 Message-ID: <5582EEB70200007800086ACC@mail.emea.novell.com> References: <1434011209-16925-1-git-send-email-wei.w.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1434011209-16925-1-git-send-email-wei.w.wang@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Wang Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 11.06.15 at 10:26, wrote: > --- a/xen/drivers/cpufreq/utility.c > +++ b/xen/drivers/cpufreq/utility.c > @@ -457,6 +457,12 @@ int __cpufreq_set_policy(struct cpufreq_policy *data, > data->min = policy->min; > data->max = policy->max; > > + if (cpufreq_driver->setpolicy) { > + data->limits.min_perf_pct = policy->limits.min_perf_pct; > + data->limits.max_perf_pct = policy->limits.max_perf_pct; For one you leave all other data->limits fields uninitialized - please use "data->limits = policy->limits". And then I don't see why this should be done inside the if() - there's no obvious connection between ->setpolicy being non-NULL and ->limits having meaning to the driver - this is solely your intended _use_ model. > --- a/xen/include/acpi/cpufreq/cpufreq.h > +++ b/xen/include/acpi/cpufreq/cpufreq.h > @@ -41,6 +41,18 @@ struct cpufreq_cpuinfo { > unsigned int transition_latency; /* in 10^(-9) s = nanoseconds */ > }; > > +struct perf_limits { > + int no_turbo; > + int turbo_disabled; Both bool_t I suppose. > @@ -52,6 +64,8 @@ struct cpufreq_policy { > unsigned int max; /* in kHz */ > unsigned int cur; /* in kHz, only needed if cpufreq > * governors are used */ > + unsigned int policy; This field isn't being used anywhere here. Please add it upon first use. Jan