From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH] cpufreq: conservative: fix requested_freq reduction issue Date: Thu, 07 Nov 2013 19:57:41 +0100 Message-ID: <4433736.xh14GOaN7a@vostro.rjw.lan> References: <1383791330-8289-1-git-send-email-chenxg@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7Bit Return-path: Received: from v094114.home.net.pl ([79.96.170.134]:52762 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750793Ab3KGSpV (ORCPT ); Thu, 7 Nov 2013 13:45:21 -0500 In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Viresh Kumar Cc: Xiaoguang Chen , "cpufreq@vger.kernel.org" , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Xiaoguang Chen On Thursday, November 07, 2013 10:39:38 AM Viresh Kumar wrote: > On 7 November 2013 07:58, Xiaoguang Chen wrote: > > When decreasing frequency, requested_freq may be less than > > freq_target, So requested_freq minus freq_target may be negative, > > But reqested_freq's unit is unsigned int, then the negative result > > will be one larger interger which may be even higher than > > requested_freq. > > > > This patch is to fix such issue. when result becomes negative, > > set requested_freq as the min value of policy. > > > > Signed-off-by: Xiaoguang Chen > > --- > > drivers/cpufreq/cpufreq_conservative.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > Good Catch. > > Acked-by: Viresh Kumar Applied, thanks! > We need another patch for fixing the other part of code where we > increase freq.. > We need to replace: > > if (dbs_info->requested_freq == policy->max) > return; > > with > > if (dbs_info->requested_freq >= policy->max) > return; > > So, that we don't run unnecessary code :) Care to prepare a patch? -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.