Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583818

Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance notifier

Path csiph.com!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Kevin Hilman <khilman@baylibre.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance notifier
Date Sat, 18 Feb 2017 01:10:02 +0100
Message-ID <tc0L8-2SC-5@gated-at.bofh.it> (permalink)
References <t8NU6-LX-15@gated-at.bofh.it> <t8NU6-LX-15@gated-at.bofh.it> <t8On7-1bs-7@gated-at.bofh.it>
X-Original-To Viresh Kumar <viresh.kumar@linaro.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=K4E+zaOpuZXwi+6/zrxToZ/7MDHUyFK6EKkVneNSyKY=; b=Nfi3WV4DDMU1Fqn2HdmgTP9jXNNBk5MqxmBxy3enuUVSoebuwX3lR1JvM/YLq8RKaT 34Qgbv0VSh4kInTn7ZNotFOAMQ+ERr9zKwnAJ3dnYvaAS8kIaAme0gIQ8R0wgU/QFA/M 2rfXwgVj8tnVJt7jq0ESHKUSN19e2SiJGEGEhXbh2C6vTj27OzKmTlqenlBficmWMvPn kHzpPoM+KcktH1A2HpZez4XzSRpUOiRpLgenYDeG51PT5ly2CdPwLItpLo2/aC939Chx f/cu2VYsL6kjTthBpZPuSQVKK+tUqS89zvMTG6ILExmDqTDk7AiTkUxUd/XHx14Tc7c6 wUJw==
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:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=K4E+zaOpuZXwi+6/zrxToZ/7MDHUyFK6EKkVneNSyKY=; b=OospPJEpoB2y49HCtTJm0JeZw3m1C5iYtwLX/SBFZ2bqu3YxRc1XDV8MiOYX6AVnT7 fq5xRddjrwVGSRmms/57llb1+rbMZ7ANKqDOeHdfdsGW8ezIUz16wUelm6g5gslLf85j S4ucDBSupDZu+RT1y2ELQ7QEA5TWQWwodLSErAnptl6rOIEoOSOifnawdRh8m4uXIcaX WqRf7bZJwse9poH8b+24N+eL0WNw6d8eiZe1hE233WY4HCNzf1FlD2/HagHPXeP8FC6v xmWVV+b7byMvCY78IOCHpEd/eln1hTS+imaswB4xRgdyHIfzQv8UBEjNEOLozm2XmpgK ntzA==
X-Gm-Message-State AMke39k6sBo3X+HiX4/birEKbxW6LEEzwge1kRYjGsG8U6/FbmWj4Oyzdfkerh4Hr2wA+hJo
X-Received by 10.98.32.221 with SMTP id m90mr12409451pfj.127.1487375699418; Fri, 17 Feb 2017 15:54:59 -0800 (PST)
Organization BayLibre
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin)
MIME-Version 1.0
Content-Type text/plain
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 86
X-Original-Cc Rafael Wysocki <rjw@rjwysocki.net>, ulf.hansson@linaro.org, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot <vincent.guittot@linaro.org>, sboyd@codeaurora.org, nm@ti.com, robh+dt@kernel.org, lina.iyer@linaro.org, rnayak@codeaurora.org
X-Original-Date Fri, 17 Feb 2017 15:54:58 -0800
X-Original-Message-ID <m27f4o4bl9.fsf@baylibre.com>
X-Original-References <cover.1486611268.git.viresh.kumar@linaro.org> <cover.1486611268.git.viresh.kumar@linaro.org> <a973289cb908a391533a4b940af671beb2e8ace4.1486611268.git.viresh.kumar@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1583818

Show key headers only | View raw


Viresh Kumar <viresh.kumar@linaro.org> writes:

> Some platforms have the capability to configure the performance state of
> their Power Domains. The performance levels are represented by positive
> integer values, a lower value represents lower performance state.
>
> This patch registers the power domain framework for PM QOS performance
> notifier in order to manage performance state of power domains.

It seems to me it doesm't just register, but actually keeps track of the
performance_state by always tracking the max.

> This also allows the power domain drivers to implement a
> ->set_performance_state() callback, which will be called by the power
> domain core from the notifier routine.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/base/power/domain.c | 98 ++++++++++++++++++++++++++++++++++++++++++++-
>  include/linux/pm_domain.h   |  5 +++
>  2 files changed, 101 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index a73d79670a64..1158a07f92de 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -367,6 +367,88 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
>  
> +static void update_domain_performance_state(struct generic_pm_domain *genpd,
> +					    int depth)
> +{
> +	struct generic_pm_domain_data *pd_data;
> +	struct generic_pm_domain *subdomain;
> +	struct pm_domain_data *pdd;
> +	unsigned int state = 0;
> +	struct gpd_link *link;
> +
> +	/* Traverse all devices within the domain */
> +	list_for_each_entry(pdd, &genpd->dev_list, list_node) {
> +		pd_data = to_gpd_data(pdd);
> +
> +		if (pd_data->performance_state > state)
> +			state = pd_data->performance_state;
> +	}

This seems to only update the state if it's bigger.  Maybe I'm missing
something here, but it seems like won't be able to lower the
performance_state after it's been raised?

> +	/* Traverse all subdomains within the domain */
> +	list_for_each_entry(link, &genpd->master_links, master_node) {
> +		subdomain = link->slave;
> +
> +		if (subdomain->performance_state > state)
> +			state = subdomain->performance_state;
> +	}

So subdomains are always assumed to influence the performance_state of
the parent domains?  Is that always the case?  I suspect this should be
probably be a reasonable default assumption, but maybe controlled with a
flag.

> +	if (genpd->performance_state == state)
> +		return;
> +
> +	genpd->performance_state = state;
> +
> +	if (genpd->set_performance_state) {
> +		genpd->set_performance_state(genpd, state);
> +		return;
> +	}

So is zero not a valid performance_state?  That doesn't seem quite right
to me, but either way, it should be documented.

> +	/* Propagate only if this domain has a single parent */

Why?  This limitation should be explained in the cover letter and
changelog.  I would also expect some sort of WARN here since this could
otherwise be a rather silent failures.

[...]

Kevin

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance notifier Kevin Hilman <khilman@baylibre.com> - 2017-02-18 01:10 +0100
  Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance  notifier Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-20 06:10 +0100
    Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance notifier Ulf Hansson <ulf.hansson@linaro.org> - 2017-02-21 16:30 +0100
      Re: [PATCH V2 4/6] PM / domain: Register for PM QOS performance  notifier Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-22 04:30 +0100

csiph-web