From: Mark Rutland <mark.rutland@arm.com>
To: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
Pawel Moll <Pawel.Moll@arm.com>,
Kumar Gala <galak@codeaurora.org>,
Stephen Warren <swarren@wwwdotorg.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>, Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH 2/3] PM / OPP: add support to specify phandle of another node for OPP
Date: Mon, 30 Sep 2013 09:57:38 +0100 [thread overview]
Message-ID: <20130930085738.GC19738@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1379501893-12669-3-git-send-email-Sudeep.KarkadaNagesha@arm.com>
On Wed, Sep 18, 2013 at 11:58:12AM +0100, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> Currently we need to replicate the OPP entries in all the nodes even
> though they share OPPs being in the same clock domain.
>
> Few drivers like cpufreq depend on physical cpu0 node to specify the
> OPPs and only that node is referred irrespective of the logical cpu
> accessing it. Alternatively to support cpuhotplug path, few drivers
> parse all the cpu nodes for OPPs. Instead we can specify the phandle
> of the node which contains the OPP tuples.
>
> This patch adds support to the new property 'operating-points-phandle'
> which specifies the phandle pointing to another node which contains the
> actual OPP tuples.
>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Kumar Gala <galak@codeaurora.org>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Nishanth Menon <nm@ti.com>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> drivers/base/power/opp.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index ef89897..a450e2f 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -708,12 +708,20 @@ struct srcu_notifier_head *opp_get_notifier(struct device *dev)
> int of_init_opp_table(struct device *dev)
> {
> const struct property *prop;
> + struct device_node *opp_node;
> const __be32 *val;
> int nr;
>
> - prop = of_find_property(dev->of_node, "operating-points", NULL);
> - if (!prop)
> + opp_node = of_parse_phandle(dev->of_node,
> + "operating-points-phandle", 0);
This will increment the refcount of the node pointed to.
> + if (!opp_node) /* if no OPP phandle, search for OPPs in current node */
> + opp_node = dev->of_node;
> + prop = of_find_property(opp_node, "operating-points", NULL);
> + if (!prop) {
> + dev_warn(dev, "node %s missing operating-points property\n",
> + opp_node->full_name);
> return -ENODEV;
> + }
> if (!prop->value)
> return -ENODATA;
>From the looks of mainline the table gets parsed here, and then the node
is never used again.
At the end there should probably be an of_node_put on the opp_node (if
it's from an operating-points-phandle property).
Cheers,
Mark.
next prev parent reply other threads:[~2013-09-30 8:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 10:58 [PATCH 0/3] PM / OPP: updates to enable sharing OPPs info Sudeep KarkadaNagesha
[not found] ` <1379501893-12669-1-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-09-18 10:58 ` [PATCH 1/3] PM / OPP: extend DT binding to specify phandle of another node for OPP Sudeep KarkadaNagesha
[not found] ` <1379501893-12669-2-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-09-30 8:52 ` Mark Rutland
2013-09-30 12:33 ` Sudeep KarkadaNagesha
[not found] ` <52496FAC.7000901-5wv7dgnIgG8@public.gmane.org>
2013-09-30 15:51 ` Mark Rutland
[not found] ` <20130930155145.GC22259-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-09-30 16:46 ` Sudeep KarkadaNagesha
2013-09-18 10:58 ` [PATCH 2/3] PM / OPP: add support " Sudeep KarkadaNagesha
2013-09-30 8:57 ` Mark Rutland [this message]
2013-09-18 10:58 ` [PATCH 3/3] PM / OPP: check for existing OPP list when initialising from device tree Sudeep KarkadaNagesha
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=20130930085738.GC19738@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=Pawel.Moll@arm.com \
--cc=Sudeep.KarkadaNagesha@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=linux-pm@vger.kernel.org \
--cc=nm@ti.com \
--cc=rjw@sisk.pl \
--cc=rob.herring@calxeda.com \
--cc=swarren@wwwdotorg.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).