From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934319AbcJMG0W (ORCPT ); Thu, 13 Oct 2016 02:26:22 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:36018 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755656AbcJMG0U (ORCPT ); Thu, 13 Oct 2016 02:26:20 -0400 Date: Thu, 13 Oct 2016 11:56:16 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Aleksey Rybalkin , Linux Kernel Mailing List , Srinivas Pandruvada Subject: Re: [PATCH] cpufreq: conservative: Fix next frequency selection Message-ID: <20161013062616.GC2991@vireshk-i7> References: <5054177.pbJ46HCkrN@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5054177.pbJ46HCkrN@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 12-10-16, 21:47, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Commit d352cf47d93e (cpufreq: conservative: Do not use transition > notifications) overlooked the case when the "frequency step" used > by the conservative governor is small relative to the distances > between the available frequencies and broke the algorithm by > using policy->cur instead of the previously requested frequency > when computing the next one. > > As a result, the governor may not be able to go outside of a narrow > range between two consecutive available frequencies. > > Fix the problem by making the governor save the previously requested > frequency and select the next one relative that value (unless it is > out of range, in which case policy->cur will be used instead). > > Fixes: d352cf47d93e (cpufreq: conservative: Do not use transition notifications) > Link: https://bugzilla.kernel.org/show_bug.cgi?id=177171 > Reported-and-tested-by: Aleksey Rybalkin > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq_conservative.c | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) Acked-by: Viresh Kumar -- viresh