linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brendan Jackman <brendan.jackman@arm.com>
To: Lina Iyer <lina.iyer@linaro.org>
Cc: ulf.hansson@linaro.org, khilman@kernel.org, rjw@rjwysocki.net,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	andy.gross@linaro.org, sboyd@codeaurora.org,
	linux-arm-msm@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: [PATCH v2 06/14] PM / cpu_domains: Setup PM domains for CPUs/clusters
Date: Thu, 4 Aug 2016 11:15:15 +0100	[thread overview]
Message-ID: <20160804101515.GA29537@brendan-thinkstation> (raw)
In-Reply-To: <1469829385-11511-7-git-send-email-lina.iyer@linaro.org>

Hi Lina,

On Fri, Jul 29, 2016 at 03:56:17PM -0600, Lina Iyer wrote:
> +static struct generic_pm_domain *of_get_cpu_domain(struct device_node *dn,
> +		const struct cpu_pd_ops *ops, int cpu)
> +{
> +	struct of_phandle_args args;
> +	struct generic_pm_domain *genpd, *parent;
> +	struct cpu_pm_domain *cpu_pd, *parent_cpu_pd;
> +	int ret;
> +
> +	/* Do we have this domain? If not, create the domain */
> +	args.np = dn;
> +	args.args_count = 0;
> +
> +	genpd = of_genpd_get_from_provider(&args);
> +	if (!IS_ERR(genpd))
> +		return genpd;
> +
> +	genpd = of_init_cpu_pm_domain(dn, ops);
> +	if (IS_ERR(genpd))
> +		return genpd;
> +
> +	/* Is there a domain provider for this domain? */
> +	ret = of_parse_phandle_with_args(dn, "power-domains",
> +			"#power-domain-cells", 0, &args);
> +	if (ret < 0)
> +		goto skip_parent;
> +
> +	/* Find its parent and attach this domain to it, recursively */
> +	parent = of_get_cpu_domain(args.np, ops, cpu);
> +	if (IS_ERR(parent))
> +		goto skip_parent;
> +
> +	ret = pm_genpd_add_subdomain(genpd, parent);

Looks like the arguments are the wrong way around here, it should be:

	ret = pm_genpd_add_subdomain(parent, genpd);

> +	if (ret) {
> +		pr_err("%s: Unable to add sub-domain (%s)\n err: %d",
> +				__func__, genpd->name, ret);
> +		return ERR_PTR(ret);
> +	}
> +
> +	/*
> +	 * Reference parent domain for easy access.
> +	 * Note: We could be attached to a domain that is not a
> +	 * CPU PM domain in that case don't reference the parent.
> +	 */
> +	cpu_pd = to_cpu_pd(genpd);
> +	parent_cpu_pd = to_cpu_pd(parent);
> +
> +	if (cpu_pd && parent_cpu_pd)
> +		cpu_pd->parent = parent_cpu_pd;
> +
> +skip_parent:
> +	of_node_put(dn);
> +	return genpd;
> +}

Cheers,
Brendan

  reply	other threads:[~2016-08-04 10:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29 21:56 [PATCH v2 00/14] PM: SoC idle support using PM domains Lina Iyer
2016-07-29 21:56 ` [PATCH v2 01/14] PM / Domains: Allow domain power states to be read from DT Lina Iyer
2016-08-04 13:24   ` Brendan Jackman
2016-08-04 15:08     ` Lina Iyer
2016-07-29 21:56 ` [PATCH v2 02/14] dt/bindings: update binding for PM domain idle states Lina Iyer
2016-08-01 16:30   ` Rob Herring
2016-08-01 21:00     ` Lina Iyer
2016-08-04 15:24   ` Brendan Jackman
2016-08-04 16:28     ` Lina Iyer
2016-08-04 18:15       ` Brendan Jackman
2016-08-04 19:02         ` Lina Iyer
2016-08-04 21:23       ` Lina Iyer
2016-08-04 15:29   ` Brendan Jackman
2016-07-29 21:56 ` [PATCH v2 03/14] PM / Domains: Abstract genpd locking Lina Iyer
2016-07-29 21:56 ` [PATCH v2 04/14] PM / Domains: Support IRQ safe PM domains Lina Iyer
2016-07-29 21:56 ` [PATCH v2 05/14] PM / doc: update device documentation for devices in " Lina Iyer
2016-07-29 21:56 ` [PATCH v2 06/14] PM / cpu_domains: Setup PM domains for CPUs/clusters Lina Iyer
2016-08-04 10:15   ` Brendan Jackman [this message]
2016-08-04 15:06     ` Lina Iyer
2016-08-04 15:59   ` Brendan Jackman
2016-08-04 16:32     ` Lina Iyer
2016-07-29 21:56 ` [PATCH v2 07/14] ARM: cpuidle: Add runtime PM support for CPUs Lina Iyer
2016-07-29 21:56 ` [PATCH v2 08/14] timer: Export next wake up of a CPU Lina Iyer
2016-07-29 21:56 ` [PATCH v2 09/14] PM / cpu_domains: Add PM Domain governor for CPUs Lina Iyer
2016-07-29 21:56 ` [PATCH v2 10/14] doc / cpu_domains: Describe CPU PM domains setup and governor Lina Iyer
2016-07-29 21:56 ` [PATCH v2 11/14] drivers: firmware: psci: Allow OS Initiated suspend mode Lina Iyer
2016-07-29 21:56 ` [PATCH v2 12/14] drivers: firmware: psci: Support cluster idle states for OS-Initiated Lina Iyer
2016-07-29 21:56 ` [PATCH v2 13/14] ARM64: dts: Add PSCI cpuidle support for MSM8916 Lina Iyer
2016-07-29 21:56 ` [PATCH v2 14/14] ARM64: dts: Define CPU power domain " Lina Iyer
2016-08-01 14:53   ` Lina Iyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160804101515.GA29537@brendan-thinkstation \
    --to=brendan.jackman@arm.com \
    --cc=andy.gross@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=khilman@kernel.org \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).