From patchwork Fri Dec 14 10:15:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 153803 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1881625ljp; Fri, 14 Dec 2018 02:15:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xat94N2dLQ1n/kTQ+qz73VHayQOci3Py1+lK3IC+DGulBxhgqSCS6CQTNBvQHqgkj7N4jR X-Received: by 2002:a17:902:145:: with SMTP id 63mr2306896plb.256.1544782540562; Fri, 14 Dec 2018 02:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544782540; cv=none; d=google.com; s=arc-20160816; b=cr+eOGn4lMxS8qL/5jshH4mBjLUle9cOj9lt9ZX284aJMEZtYV+cIJO5ld5TjLzrLO Txo8KjvDJP/EMLH52ijL13baemzrpDd9bYkKuoDl+MN+L+I+wJkuTw1it0ZoSPwogJRp 3FWcxD8udS+BHwxczcgODy8x4Jtt+YYlDgMxOaclmgDX7hgsls0CVSgaWKF+XQRqzAYH S12xopZw+UAsUg2TeNpvKKy5dVpJvYsC0E76Py8zFeUyaQuFJXzGNHe+znHnbK0f/Qri Z+lNdoet7c76XldsdnGnjX00XuMlR+RK3QCndRX/3K+YLhEgQk37GdtdiutrDDKsYMqc k5Xg== 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=xriaFx5+t28qBH2mZd8Es0YFEc0cKyBjyhEauROsazY=; b=NwsYNVt0CvVccuuLAQv6SSyBnRFKYjtwJOtyAMfF3NvJGT7NbP78o1oAWt87Ckm3B7 DHXToK0r32wQGwWFzBEYPVCfb1lUKUkopYfmkHdcmeJswkxBtgqcqnAbVGTz0qtzBGjA 3LGhqCHYU11loGJNSoBOMBGb3/0oJuOHfGJEgggqkT366zpEDLhGrNKVa0GPcsAlWimP 4afPi7NKrQCSu77qbCbm016uf6whrdCXwihMmlYOYMFyR7uDJ2kiVkcxgPC54gyZdZ22 sw7OxvpevL8QXK9C0JPMckJ9j5RUi7/Hut9Qw+2R8bRkf8cN5csXm4VXBbwNMlL+50VW QvoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iCYOTgFL; 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 z123si1855778pfb.104.2018.12.14.02.15.40; Fri, 14 Dec 2018 02:15:40 -0800 (PST) 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=iCYOTgFL; 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 S1729053AbeLNKPj (ORCPT + 11 others); Fri, 14 Dec 2018 05:15:39 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37086 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeLNKPj (ORCPT ); Fri, 14 Dec 2018 05:15:39 -0500 Received: by mail-pl1-f195.google.com with SMTP id b5so2538234plr.4 for ; Fri, 14 Dec 2018 02:15:39 -0800 (PST) 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=xriaFx5+t28qBH2mZd8Es0YFEc0cKyBjyhEauROsazY=; b=iCYOTgFL+8VAAyBVht3+GmArRXrVh10/vUaNJvAiTsl/OGN4VHMHOpEsg6Bqam0sVp NYkqNvQg6589yBMufymhW74HHUXnULhQbnJqYY1XRuSFM+I2zmutdvc42oHQNVAZEwGR g0ZNeKAk70YSwpNO6gV1floaFXzJP4wgoxGqs= 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=xriaFx5+t28qBH2mZd8Es0YFEc0cKyBjyhEauROsazY=; b=B+gmP8bEJeRf5fPVAvy00ZiDkgdaTFd3CEnnEjUZFD5axB2tOkTQKYZkfP4eaNyem7 WhUqm3i0tZHesRZkyL9CWWPwSki/gSZWUfxdR6dWkcVXxW/6TlSNrDRGHIZ+4SJmF8NN YmvIZJuEZ4t9OcNK0Uh0EuSTsudq0CN8IpjLFOZ1UUAGzDev+3fwrTf3L5JF8lbJ5Vvx rDPwXrlOVzjIr6wAboMUR5JoFYaSiI66cPW/vByEw3WxDhqyIdSHwOxuazNa4wNcJxBF v0FvWIWcu0qtmksCnIyvaryhokDITyzdLmNVK9eEieoIK58GKK7k0l5PES1NnCFjNhVK UuwQ== X-Gm-Message-State: AA+aEWZ+XmtFDydr77XfzUa0FIKYYtLWThIpFvYm8FXTrcq+7YVVMjCQ h9ygpaG1o2qdxopqs63oZKAztA== X-Received: by 2002:a17:902:1126:: with SMTP id d35mr2154387pla.1.1544782538867; Fri, 14 Dec 2018 02:15:38 -0800 (PST) Received: from localhost ([122.172.23.29]) by smtp.gmail.com with ESMTPSA id g190sm5104829pgc.28.2018.12.14.02.15.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 02:15:37 -0800 (PST) From: Viresh Kumar To: ulf.hansson@linaro.org, Rafael Wysocki , Kevin Hilman , Len Brown , Nishanth Menon , Pavel Machek , Stephen Boyd , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , rnayak@codeaurora.org, niklas.cassel@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 0/7] PM / Domains: Allow performance state propagation Date: Fri, 14 Dec 2018 15:45:26 +0530 Message-Id: X-Mailer: git-send-email 2.19.1.568.g152ad8e3369a MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, This series adds performance state propagation support in genpd core. The propagation happens from the sub-domains to their masters. More details can be found in the individual commit logs. This is tested on hikey960 by faking power domains in such a way that the CPU devices have two power domains and both of them have the same master domain. The CPU device, as well as its power domains have "required-opps" property set and the performance requirement from the CPU eventually configures all the domains (2 sub-domains and 1 master). Based on opp/linux-next branch (which is 4.20-rc1 + multiple-power-domain-support-in-opp-core + some OPP fixes). Rajendra has already tested the previous version of this series and so I have included his Tested-by for all patches. V3->V4: - dev_pm_opp_xlate_performance_state() returns negative values on error now. - of_get_required_opp_performance_state() is also updated to do the same. - _genpd_set_performance_state() is not called anymore from _genpd_reeval_performance_state() and we get rid of the extra declaration. - Improved commit log in the last patch. - dropped an unlikely. V2->V3: - Include Ulf's patch (sent separately earlier) with this series. - The performance state update code doesn't rely anymore on the power on/off state of the genpd, it sets and propagates rate in all cases. - That simplified a lot of code from V2 in _genpd_power_on(). - commit logs improved for few commits. - s/mstate/master_state/ - and few more minor changes. v1->V2: - First patch (1/5) is new and an improvement to earlier stuff. - Move genpd_status_on() check to _genpd_reeval_performance_state() from _genpd_set_performance_state(). - Improve dev_pm_opp_xlate_performance_state() to handle 1:1 pstate mapping between genpd and its master and also to fix a problem while finding the dst_table. - Handle pstate=0 case properly. -- viresh Ulf Hansson (1): PM / Domains: Make genpd performance states orthogonal to the idlestates Viresh Kumar (6): OPP: Improve _find_table_of_opp_np() OPP: Add dev_pm_opp_xlate_performance_state() helper OPP: Don't return 0 on error from of_get_required_opp_performance_state() PM / Domains: Save OPP table pointer in genpd PM / Domains: Factorize dev_pm_genpd_set_performance_state() PM / Domains: Propagate performance state updates drivers/base/power/domain.c | 202 ++++++++++++++++++++++++++---------- drivers/opp/core.c | 63 +++++++++++ drivers/opp/of.c | 24 +++-- include/linux/pm_domain.h | 6 ++ include/linux/pm_opp.h | 13 ++- 5 files changed, 242 insertions(+), 66 deletions(-) -- 2.19.1.568.g152ad8e3369a Reviewed-by: Stephen Boyd