Linux Power Management development
 help / color / mirror / Atom feed
From: Lina Iyer <ilina@codeaurora.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, khilman@kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] PM / Domains: Fixup domain-idle-states OF parsing
Date: Tue, 23 Jan 2018 16:12:01 +0000	[thread overview]
Message-ID: <20180123161201.GA29171@codeaurora.org> (raw)
In-Reply-To: <1516702990-25564-1-git-send-email-ulf.hansson@linaro.org>

Hi Ulf,

Thanks for the fix. The allocation is more than what is needed and this
will fix that.

On Tue, Jan 23 2018 at 10:23 +0000, Ulf Hansson wrote:
>but also makes of_genpd_parse_idle_states() to return the wrong number of
>allocated elements to the caller.
>
How is this happening?

>
>Fixes: b539cc82d493 ("PM / Domains: Ignore domain-idle-states that are not compatible")
>Cc: Lina Iyer <ilina@codeaurora.org>
>Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>---
> drivers/base/power/domain.c | 76 +++++++++++++++++++++++++++------------------
> 1 file changed, 45 insertions(+), 31 deletions(-)
>
>-	/* Loop over the phandles until all the requested entry is found */
>-	of_for_each_phandle(&it, err, dn, "domain-idle-states", NULL, 0) {
>-		np = it.node;
>-		match_id = of_match_node(idle_state_match, np);
>-		if (!match_id)
>-			continue;
>-		ret = genpd_parse_state(&st[i++], np);
This increments only if the state node matches the compatible.

>-		if (ret) {
>-			pr_err
>-			("Parsing idle state node %pOF failed with err %d\n",
>-							np, ret);
>-			of_node_put(np);
>-			kfree(st);
>-			return ret;
>-		}
>+	ret = genpd_iterate_idle_states(dn, st);
>+	if (ret <= 0) {
>+		kfree(st);
>+		return ret < 0 ? ret : -EINVAL;
> 	}
>
>-	*n = i;
Returns the count of matched state nodes.

What am I missing?

-- Lina

  reply	other threads:[~2018-01-23 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 10:23 [PATCH] PM / Domains: Fixup domain-idle-states OF parsing Ulf Hansson
2018-01-23 16:12 ` Lina Iyer [this message]
2018-01-23 20:34   ` Ulf Hansson

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=20180123161201.GA29171@codeaurora.org \
    --to=ilina@codeaurora.org \
    --cc=khilman@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.org \
    --cc=viresh.kumar@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