linux-pm.vger.kernel.org archive mirror
 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 v2] PM / Domains: Fixup domain-idle-states OF parsing
Date: Tue, 23 Jan 2018 21:01:28 +0000	[thread overview]
Message-ID: <20180123210128.GA16708@codeaurora.org> (raw)
In-Reply-To: <1516740188-3580-1-git-send-email-ulf.hansson@linaro.org>

On Tue, Jan 23 2018 at 20:43 +0000, Ulf Hansson wrote:
>The commit b539cc82d493 ("PM / Domains: Ignore domain-idle-states that are
>not compatible"), made it possible to ignore non-compatible
>domain-idle-states OF nodes. However, in case that happens while doing the
>OF parsing, the number of elements in the allocated array would exceed the
>numbers actually needed, thus wasting memory.
>
>Fix this by pre-iterating the genpd OF node and counting the number of
>compatible domain-idle-states nodes, before doing the allocation. While
>doing this, it makes sense to rework the code a bit to avoid open coding,
>of parts responsible for the OF node iteration.
>
>Let's also take the opportunity to clarify the function header for
>of_genpd_parse_idle_states(), about what is being returned in case of
>errors.
>
>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>
>---
>
>Changes in v2:
>	- Updated changelog to clarify the problem is really about avoiding to
>	waste memory, according to comment from Lina.
>
>---
Reviewed-by: Lina Iyer <ilina@codeaurora.org>

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 20:43 [PATCH v2] PM / Domains: Fixup domain-idle-states OF parsing Ulf Hansson
2018-01-23 21:01 ` Lina Iyer [this message]
2018-02-08 10:09   ` Rafael J. Wysocki

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=20180123210128.GA16708@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;
as well as URLs for NNTP newsgroup(s).