From patchwork Tue Mar 12 04:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 160052 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp12690304jad; Mon, 11 Mar 2019 21:57:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1wjwaitBokRG1efZUI+LwlbL7enGqYu7Y4sSimSW+MQDbD1lCjc0LUkJOsyuyl7FQ5ynu X-Received: by 2002:a63:2c4c:: with SMTP id s73mr33694909pgs.113.1552366649231; Mon, 11 Mar 2019 21:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552366649; cv=none; d=google.com; s=arc-20160816; b=sbHmfPw0OSPIyBQRLIUGLgVLiRfQj1HiMhgZH04fxpz51/P581fTZ2lTc3b/TRIh/d LfyzFoGOaXsyIrq1fZ9FYaMa0pVmMG9r/FZ/myfu6y5Z2w2FP+/Gp81NcKA5kHIqdHwS OGsAU4fPPY68ggTV8ilhYl3Fceqg2UiTDqmZ9Ge+22oWSLR8OtYOHdXTvWUqAt82IDQf f32kBe9mKxJAe6fcLq3ZCrJk5HtEu7opoPP1f0oO9HyZF/7ItABgZG7CGbgVELRQB+Rs lgKE0WYoRqKX5t16VTuPpMaoQRvLIojl5397vD6SyNPpaK3t1jnWnn20Fu6sWt8wUKFO lH4Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=4fS+u+j2vJWkUtKW4y5uHGMbNcpwR75hPCIfVWq0nZE=; b=QwdfgHI978rKheF4/KcR365pK2zDHY80WhQf/Wt2MwtM6WbLaTgfYqc76KCQEVpc4r yQvehD34guq8y5FVB3tFGcToKo0ty2RLHIZf70Uk+bMaVwl7b84p7ip9VJXTMvPqJil9 Wi+BxoQyDavFiAXNBTIEISqfHhdOnv8yrYVHFSSfjQURZqBbgGzhuKlWQKEMnE2jk7pO 8/TwND9A+/S16Kr3q16+WID8A7lAbp5bhKAh+qei7oN94E/viisp+VgB2ZJGG5s5qgTs U2aFVGm5Jkob0HQA+KogLj0k3oypdtuW7rnewy+KpfOQ8YAq02bvbs0s2jNuw1CH4c2J Tj8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b66kJJle; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 x9si6876350pfm.59.2019.03.11.21.57.28; Mon, 11 Mar 2019 21:57:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=b66kJJle; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726911AbfCLE52 (ORCPT + 11 others); Tue, 12 Mar 2019 00:57:28 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37578 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbfCLE52 (ORCPT ); Tue, 12 Mar 2019 00:57:28 -0400 Received: by mail-pg1-f196.google.com with SMTP id q206so887754pgq.4 for ; Mon, 11 Mar 2019 21:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4fS+u+j2vJWkUtKW4y5uHGMbNcpwR75hPCIfVWq0nZE=; b=b66kJJlensvV/bpjn7a2poBrs/8aKSP+OWF8ekClmVoIhdNn2ywzUiN5wQt64UyL7+ /6CQg297Ai46AjgNW4NTvMvGO0bgAf4n0IOkdEJMC+HOKxR4aVhq16yCvjRyDGiHGa/T bcSDiyC7ivD8Mb2SG55iSZGCO6Oe9xQr1IZgyIQMs9fc7SHaet8XZNvTgNST9c+Ay3qk f69qU3Ay4VwZaim071YxVSyOCIDWM3zkSqzWAd+KpCUcM3wTj2CQHLGdWuN6/InWlwvI 07FXlGPtJHNyu4GZteloam2GJISCQFtYJgJ9TEQGWsqgJTjeZW+rIRlvAIJBCKcUvgT7 WZsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4fS+u+j2vJWkUtKW4y5uHGMbNcpwR75hPCIfVWq0nZE=; b=HYVD3DzZI3b9IeP3oXpQlo+sf96EY8KVlLavcibgp9FZ40Gt93KKMFuivyCo8BvKFQ uhDyQyKqjhg7ElCULigq4sT7DZMFJAhEJAziGTZCihXwU2z76/RdF2Rq47bGvBVir105 XvT2W2+1QIJoqVaEndxk3P4nv3QQgmg2pXRv3ozpkL2TskGFYX8c1b3O/0iAmkJuV7lO A2CcB6dMSKpwZszzAi30MPdY20TSTT6MQXV/cV8B6bmWVI75m/RhqM3y309dh+BJ3x2+ ZpmZ0sYYxKmwMLcAVgVvuiqbJCNVVLSC2X6EUnyfU0Jz8KUrFnyHKO2B1InTJyXxdW8f FmpQ== X-Gm-Message-State: APjAAAWd3o8LOvJWhfySN1EFgfsjcTZlliSI09geB9UXedOPWPcLOBM1 uuv8Sul4h65ByKvPAhRnax6pfw== X-Received: by 2002:aa7:8299:: with SMTP id s25mr36844809pfm.56.1552366647056; Mon, 11 Mar 2019 21:57:27 -0700 (PDT) Received: from localhost ([122.166.134.37]) by smtp.gmail.com with ESMTPSA id m64sm16802318pfi.149.2019.03.11.21.57.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 21:57:25 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , jorge.ramirez-ortiz@linaro.org, "v5 . 0" , Niklas Cassel , linux-kernel@vger.kernel.org Subject: [PATCH] PM / OPP: Update performance state when freq == old_freq Date: Tue, 12 Mar 2019 10:27:18 +0530 Message-Id: <5a0c96bebb52c1ae34a2d0df63517b2d2938369c.1552366620.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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(-) -- 2.21.0.rc0.269.g1a574e7a288b 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;