Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2851788imc; Wed, 13 Mar 2019 03:00:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFDhWyTFoJ7x9jCbfU1b2ouGttqEYwwHNGTK2iHE5tCqyZTbosnLEYDQCIEeWvLCUpny+B X-Received: by 2002:a62:388a:: with SMTP id f132mr43000138pfa.150.1552471242693; Wed, 13 Mar 2019 03:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552471242; cv=none; d=google.com; s=arc-20160816; b=oUBUBZ/LOhjdePaaGg/+hl8fuzuY92bCkmE+APHGE05c3IpwwRb120CBTYni+zHM32 rrvYa96ElKIaS7JEIPifO0W4A8MblnWUjwhfzFQoZm0aAq5WNJQpr2EJPD3A5UoF3bTG PmB1x+lCuP48MIeh/pA3yVP0DaiBt1N0bLW3zW5s2Mmhh1huaybENQYkYmwnT0/lMNz3 oJSTKOUnyW8AORlOkRrPStakaMREqu/gme8ZfNYXocX9A72bN/BoeH3EwtlpoVChM0Aa eqZfBBrzN+eQxr3fLE16fcamGbn1fK8KyFyP6QBqX8E4l4zAvzsPR/wZJAF2mRDsqTcq B8GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tmlL0dyo3R9CYOPZRUH4wUkt6zWTDY0vjnnKnGIjsss=; b=lWolhyyEsxW/nH6nTDXCdi2oZ+gfQTOwSjq9hJ3zf5gCiMVqAoQSI5iRuK8g3gSc3y H1yh8QKt2ZD9m2yR67qENRIIznAVxPQujD3GrDSHGdYFFzAByTkexw8kzX+t5nYwuzAJ rrQW5jcynsi2fXaxxW/BuWdYfJ4rfUVs1KX/MGb4DQpoRfmq5mA8iOWMsCB4quzihOqW x1eV9F35XnNR2X1IPHemxrfZWRKvlXQCSltTc8rGkWy/uZ2a4+D+zmOEcv4VPwBTAodw dCPnH5bAqpeW3Nom4z2e5dWXCTQbCv+dddmKc2RM81J6F3yhOvQMa8Cz5+kil49WNiTJ kxww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi12si10357209plb.205.2019.03.13.03.00.26; Wed, 13 Mar 2019 03:00:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726599AbfCMJ6e (ORCPT + 99 others); Wed, 13 Mar 2019 05:58:34 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:47421 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMJ6d (ORCPT ); Wed, 13 Mar 2019 05:58:33 -0400 Received: from 79.184.254.189.ipv4.supernova.orange.pl (79.184.254.189) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.213) id de74e06d03276472; Wed, 13 Mar 2019 10:58:30 +0100 From: "Rafael J. Wysocki" To: Viresh Kumar Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , jorge.ramirez-ortiz@linaro.org, "v5 . 0" , Niklas Cassel , linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / OPP: Update performance state when freq == old_freq Date: Wed, 13 Mar 2019 10:56:44 +0100 Message-ID: <12337613.44RoPr5aty@aspire.rjw.lan> In-Reply-To: <5a0c96bebb52c1ae34a2d0df63517b2d2938369c.1552366620.git.viresh.kumar@linaro.org> References: <5a0c96bebb52c1ae34a2d0df63517b2d2938369c.1552366620.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, March 12, 2019 5:57:18 AM CET Viresh Kumar wrote: > At boot up, CPUfreq core performs a sanity check to see if the system is > running at a frequency defined in the frequency table of the CPU. If so, > we try to find a valid frequency (lowest frequency greater than the > currently programmed frequency) from the table and set it. When the call > reaches dev_pm_opp_set_rate(), it calls _find_freq_ceil(opp_table, > &old_freq) to find the previously configured OPP and this call also > updates the old_freq. This eventually sets the old_freq == freq (new > target requested by cpufreq core) and we skip updating the performance > state in this case. > > Fix this by also updating the performance state when the old_freq == > freq. > > Fixes: ca1b5d77b1c6 ("OPP: Configure all required OPPs") > Cc: v5.0 # v5.0 > Reported-by: Niklas Cassel > Signed-off-by: Viresh Kumar > --- > drivers/opp/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > index d7f97167cac3..0420f7e8ad5b 100644 > --- a/drivers/opp/core.c > +++ b/drivers/opp/core.c > @@ -760,7 +760,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) > old_freq, freq); > > /* Scaling up? Configure required OPPs before frequency */ > - if (freq > old_freq) { > + if (freq >= old_freq) { > ret = _set_required_opps(dev, opp_table, opp); > if (ret) > goto put_opp; > Applied, thanks!