From: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
To: Sudeep KarkadaNagesha
<Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>,
cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
Viresh Kumar
<viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v2 3/5] PM / OPP: check for existing OPP list when initialising from device tree
Date: Thu, 3 Oct 2013 09:25:01 -0500 [thread overview]
Message-ID: <524D7E3D.4050705@ti.com> (raw)
In-Reply-To: <1380634382-15609-4-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
On 10/01/2013 08:33 AM, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha-5wv7dgnIgG8@public.gmane.org>
>
> CPUs are registered as devices and their OPPs can be initialised from
> the device tree. Whenever CPUs are hotplugged out, the corresponding
> cpu devices are not removed. As a result all their OPPs remain intact
> even when they are offlined.
>
> But when they are hotplugged back-in, the cpufreq along with other cpu
> related subsystem gets re-initialised. Since its almost same as secondary
> cpu being brought up, no special consideration is taken in the hotplug
> path. This may result in cpufreq trying to initialise the OPPs again though
> the cpu device already contains the OPPs.
>
> This patch checks if there exist an OPP list associated with the device,
> before attempting to initialise it.
>
> Cc: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
> Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
> Cc: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha-5wv7dgnIgG8@public.gmane.org>
> ---
> drivers/base/power/opp.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index bb6ff64..05b2ebf 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -709,9 +709,15 @@ int of_init_opp_table(struct device *dev)
> {
> const struct property *prop;
> struct device_node *opp_node;
> + struct device_opp *dev_opp;
> const __be32 *val;
> int nr;
>
> + /* Check for existing list for 'dev' */
> + dev_opp = find_device_opp(dev);
> + if (!IS_ERR(dev_opp))
> + return -EEXIST; /* Device OPP already initialized */
in the interest of remaining code, Prefer comments not inline with
code -> example if additional logic gets added later on in the if
condition, someone'd have to move that comment over, instead, prefer
it embedded before the if check as a line of it's own.
> +
> opp_node = of_parse_phandle(dev->of_node,
> "operating-points-phandle", 0);
> if (!opp_node) /* if no OPP phandle, search for OPPs in current node */
>
other than that,
Acked-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-10-03 14:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 13:32 [PATCH v2 0/5] PM / OPP: updates to enable sharing OPPs info Sudeep KarkadaNagesha
2013-10-01 13:32 ` [PATCH v2 2/5] PM / OPP: add support to specify phandle of another node for OPP Sudeep KarkadaNagesha
[not found] ` <1380634382-15609-3-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-10-01 16:46 ` Sudeep KarkadaNagesha
[not found] ` <524AFC52.8080201-5wv7dgnIgG8@public.gmane.org>
2013-10-03 14:20 ` Nishanth Menon
2013-10-03 15:39 ` Sudeep KarkadaNagesha
[not found] ` <1380634382-15609-1-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-10-01 13:32 ` [PATCH v2 1/5] PM / OPP: extend DT binding " Sudeep KarkadaNagesha
2013-10-03 12:40 ` Nishanth Menon
[not found] ` <524D65A3.5090906-l0cyMroinI0@public.gmane.org>
2013-10-03 13:05 ` Sudeep KarkadaNagesha
2013-10-03 14:29 ` Nishanth Menon
2013-10-07 12:40 ` Sudeep KarkadaNagesha
2013-10-07 16:01 ` Rob Herring
2013-10-08 12:55 ` Sudeep KarkadaNagesha
2013-10-17 11:15 ` Sudeep KarkadaNagesha
2013-10-17 13:22 ` Rob Herring
2013-10-17 17:22 ` Sudeep KarkadaNagesha
2013-10-17 18:36 ` Nishanth Menon
2013-10-18 8:40 ` Lorenzo Pieralisi
2013-10-01 13:33 ` [PATCH v2 3/5] PM / OPP: check for existing OPP list when initialising from device tree Sudeep KarkadaNagesha
2013-10-03 4:54 ` Viresh Kumar
[not found] ` <1380634382-15609-4-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-10-03 14:25 ` Nishanth Menon [this message]
2013-10-01 13:33 ` [PATCH v2 4/5] cpufreq: arm_big_little_dt: enhance OPP error checking Sudeep KarkadaNagesha
2013-10-03 4:55 ` Viresh Kumar
[not found] ` <1380634382-15609-5-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-10-03 14:26 ` Nishanth Menon
2013-10-01 13:33 ` [PATCH v2 5/5] cpufreq: arm_big_little_dt: return success if OPP list already exists Sudeep KarkadaNagesha
[not found] ` <1380634382-15609-6-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-10-03 4:54 ` Viresh Kumar
2013-10-16 23:12 ` [PATCH v2 0/5] PM / OPP: updates to enable sharing OPPs info Rafael J. Wysocki
2013-10-17 17:26 ` 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=524D7E3D.4050705@ti.com \
--to=nm-l0cymroini0@public.gmane.org \
--cc=Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org \
--cc=cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rjw-KKrjLPT3xs0@public.gmane.org \
--cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.