Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1711748imc; Mon, 11 Mar 2019 21:58:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAo9Wad47hEIQBYRnhmMqlKNzSHEeASygr6rc4dncEgeKl2KHKwtObfPkJcydoBnzH5OSW X-Received: by 2002:a17:902:e60e:: with SMTP id cm14mr37710026plb.192.1552366702827; Mon, 11 Mar 2019 21:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552366702; cv=none; d=google.com; s=arc-20160816; b=BN+TU88Ii+7VoOwAD1FM5N0IBm2HlyoTLaqsqlfm4uAzLUr9j6Xqx7QX7yALuw0U+F Sxu1UgKZnFOtTYA2hW8E2rLm9pr641b8AwG8OvIcadGYk01Ax8g1es9OkhJq1/4A2qfp I9fqB5twEQ7dQ7HnbkDG4e3d3TN+0KDTHIGbaO9kC5D8oXQiJ6ACw9EJMW+86492Fv2f EKCSyteCfJLIA05sHhsKzM6ZMai0vsEG5OqOQzHz4A8zzKRuSZSNh09qOkpFdl+ja6XF FIvPD6/RL8J5oeCTtUp02mZ4mTLG7L0+NzJlFyTV79hZ9FaK+IpnBUg4Mwd61Kqbv2g3 WVaQ== 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=Qd7nTPwEpb5sJQPk2CmWp3nyTt1mekx7FwrX27IdlfwWW+O6LpqW8nOhgv8N0HHjCS BWKLNdj6DMV9Vly1ttxR4VvwUaHaZF7jeePljXIKHDuQoN46j8JRnbIUWJkLt5SFTcI4 MhCzNLEZJaWuFQfKThHQRZD8bETCqzccFrt28Ff//iTGwWrxVCpBmT/WBgE5KioUwQJx fpTW8kzdLjKUKarbdW8mq0Tn6zoxZN6Onkax+2rl8tGxwfV/l7uNdp9YWNi9KsTmaUG/ 0ZUoLw/HAH5JH1XXfndZhzfl9noxKf70CaULXcZDL+CAPAtU4IwUrgDN5pHfwJQe51y0 tW0g== 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-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 f7si6407773pgo.569.2019.03.11.21.58.07; Mon, 11 Mar 2019 21:58:22 -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=b66kJJle; 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 S1726981AbfCLE52 (ORCPT + 99 others); Tue, 12 Mar 2019 00:57:28 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38962 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbfCLE52 (ORCPT ); Tue, 12 Mar 2019 00:57:28 -0400 Received: by mail-pg1-f194.google.com with SMTP id h8so876429pgp.6 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=J8eLLIfsRIGozw5YUNhDp9fUG4vu7wiXaLPClp4ZlaQzM6QpQAfF0q5Ui2cZM7u+9T nSQtxT3koszgNmoJo3EHTqSBtLr1bwXPlS5jYt3TjaaJ0iKCccE7R0f9TYxMmoe71m1/ 3RDVfeL3TUPSO8VgrdL+RLCxsrIJRq9v3IbxK0p/OGkOZDO1Hb81ANPGhkNgif/eeI1D o3lRJCM1CA9C+7U0xm20I0XvCrM/dllfTbcyZX21/d36CpGdkqVHAWxkv/IATgxt/+aQ YXoOuD2olegaOEHohdNqLjXe9rD+WWjZ+6IYoIWrpTat+28dAnttWednm6lFJfjgcqWk 3I2w== X-Gm-Message-State: APjAAAU0c2uL0PhlGXBZiv4nM84aiqB0/RYZxVOeCwFskNmYwRFXFU+b Tr59JP+EYm/fiONkKmLhCzCnhA== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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