Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1996111imc; Tue, 12 Mar 2019 05:09:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4wzRLcLKJo5UXD5ZNTgPVr2SpJqQzj1VVkQjAbemtgZNddpON5DW+xZWe4OzGHQ+XXSzG X-Received: by 2002:a65:6290:: with SMTP id f16mr34613749pgv.106.1552392557608; Tue, 12 Mar 2019 05:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552392557; cv=none; d=google.com; s=arc-20160816; b=SjUMmQcveVXVXxZ2JOE4IaeMaAstze4b6LGqb0k5pnLcP0yBeZzDQ+Uc6g1N+csKue A6z3p9wVSxyGj0ODv0+nycV93w+9GPr1EcZiyLBx3I3galLllEAbcLdlKgbNfpfW90fR m0XWO35gedeEgtPybWrzki9fYp/pWMBmz9cnuXPN/3AfxfyezOnDVrUwnHyJ51xwVwZG 89OobRLN7kmJ5SIxP2tQWpiEKnTus4dY3zBUuOa59FmFA4xhUJqga6PB4HC32lDbV7iE pCuYrRHvDQoHJATPClgbhWWaH+ZJ+CjHCQLOq5B698TxShLrYkTg/BVDm7J3UU63GB6h n/YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aHKN2rI8EX1oDz7odjEpO6IHPSAZqE6/3iXfu3TqE6M=; b=CgJYUy9TuL9Is8uOzTh1SwTrwLgKHlO0RokmGwsczKRemcM04DNOiFngCDfFOtvxea b8dXsXr5yd75fvy16ow8nHx9vtv8QlrPi540fQa60U4X4lRsynzbKM2f7TD/ISRRxcsW +wa9crsWZzmilKklJLyUbwJG5+LU072bwHN0/j1/H20Pk0pTBeAadLqbKVZ0wti5x2Dn xVh90qAU4vqhYxtn6LUI1URuioQlP59jnm9aujiEwh7cn75SG7DxGH5/tKW3LqeJLh6Y hhTCgpTrcHoXe6GgDy4Gg4Ikl9BTNZHjitfhkVnnee4NEEvxBUKDCQ9ylaBlG/ItWiTt ZWXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c68juVVz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si7261775pga.497.2019.03.12.05.09.00; Tue, 12 Mar 2019 05:09:17 -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; dkim=pass header.i=@linaro.org header.s=google header.b=c68juVVz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbfCLMG3 (ORCPT + 99 others); Tue, 12 Mar 2019 08:06:29 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38467 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfCLMG2 (ORCPT ); Tue, 12 Mar 2019 08:06:28 -0400 Received: by mail-lj1-f196.google.com with SMTP id x13so2054257ljj.5 for ; Tue, 12 Mar 2019 05:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aHKN2rI8EX1oDz7odjEpO6IHPSAZqE6/3iXfu3TqE6M=; b=c68juVVzPwXR+ur/fcDehljDhMgS56sDsnUANOUY1Y54lLdiNmrhvkoVkOvrnTuDnj FR9K3Yb79Zk9Sh0NdjQcXyYeIpH/OeLg7tDFs2LZO7sXSYgbZmNolkI2+WkwETSTRjwg 4KurMfmIi433xXlgL1uN+xQAKc1RDaQUpv8akRNey1Ko8oyjd1VleWZR64tWTmj5JjyF QaOoiU5qKSELjoeShq0dEwTnkSPx6BEo2kCtZ45bQHLZTtILCFscYzCsYsznYYJDcQrT PCZHnd+i2xGw8FBov08qikowt3hJ0sD7Gse5EUhiMrRHbX6BYy0YtguxMlTgrDcgJPIn mhww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aHKN2rI8EX1oDz7odjEpO6IHPSAZqE6/3iXfu3TqE6M=; b=I72yvS13SYiqgfSA1yi97h1GMYaVbIVTPlyFN5jCkF6IvsWcdbrMZbE8SQtD8jU0WA kR5TT6IR82CS1irM8I4tKI7ISj7mCgoiMUA9ZFHut0+IY5GnrJmiySpxuTL8goWPSuwW YnFX7A8YfJaFdG/kIKoZbONihDVA3ChRxq13SZUm/tksardwyZ2Kf43qT/lRh+bQIKCb jJFDyFNqlU0p/xuSCF5HPKESGZjRedwepVwdlnbGWWFSkV6zEnkKiAUwWFH2V9txq7FN yIwd7v4Ro8WKkommlq6msLA2pqD1jP/sV8IszKYlKdbcU04PvlH8/QJV5nL3oCyrHozo YIZA== X-Gm-Message-State: APjAAAUL2PyZ4TVwc2MMaODNYQfnIT/MmZFlNjVKxJH7z2euthJcYrdD MUTK5GXIcedM2IaQc/S03UZHKA== X-Received: by 2002:a2e:719:: with SMTP id 25mr19695101ljh.122.1552392386575; Tue, 12 Mar 2019 05:06:26 -0700 (PDT) Received: from centauri.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id z7sm1340308ljk.34.2019.03.12.05.06.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 12 Mar 2019 05:06:25 -0700 (PDT) Date: Tue, 12 Mar 2019 13:06:23 +0100 From: Niklas Cassel To: Viresh Kumar Cc: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , jorge.ramirez-ortiz@linaro.org, "v5 . 0" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / OPP: Update performance state when freq == old_freq Message-ID: <20190312120623.GA21536@centauri.lan> References: <5a0c96bebb52c1ae34a2d0df63517b2d2938369c.1552366620.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a0c96bebb52c1ae34a2d0df63517b2d2938369c.1552366620.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 12, 2019 at 10:27:18AM +0530, 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; > -- > 2.21.0.rc0.269.g1a574e7a288b > Tested-by: Niklas Cassel