From: Nishanth Menon <nm@ti.com>
To: Sudeep.KarkadaNagesha@arm.com
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>, "Rafael J. Wysocki" <rjw@sisk.pl>,
Shawn Guo <shawn.guo@linaro.org>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 2/2] PM / OPP: check for existing OPP list when initialising from device tree
Date: Wed, 1 May 2013 10:04:03 -0500 [thread overview]
Message-ID: <20130501150403.GA20488@kahuna> (raw)
In-Reply-To: <1367406679-21603-3-git-send-email-Sudeep.KarkadaNagesha@arm.com>
On 12:11-20130501, Sudeep.KarkadaNagesha@arm.com wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> CPUs are registered as devices and their OPPs can be initialised from
> the device tree. Whenever CPUs can be 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. As a result of this the cpufreq will try 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.
>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> drivers/base/power/opp.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index 4dfdc01..66d52d2 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -706,6 +706,11 @@ static int of_init_opp_table_from_ofnode(struct device *dev,
> const __be32 *val;
> int nr;
>
> + /* Check for existing list for 'dev' */
> + dev_opp = find_device_opp(dev);
> + if (!IS_ERR(dev_opp))
> + return 0; /* Device OPP already initialized */
> +
It gets a little touchy here -> the normal expectation is for the OPP
entries to be populated onetime at boot.
For example - driver bug where same device was attempted twice Vs the
usecase you mention here - how'd we differentiate between the two?
> prop = of_find_property(of_node, "operating-points", NULL);
> if (!prop)
> return -ENODEV;
> --
> 1.7.10.4
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2013-05-01 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 11:11 [PATCH 0/2] PM / OPP: updates to enable sharing OPPs info Sudeep.KarkadaNagesha
2013-05-01 11:11 ` [PATCH 1/2] PM / OPP: add support to specify phandle of another node for OPP Sudeep.KarkadaNagesha
2013-05-01 14:41 ` Nishanth Menon
2013-05-01 16:28 ` Sudeep KarkadaNagesha
2013-05-01 16:49 ` Nishanth Menon
2013-05-13 16:12 ` Sudeep KarkadaNagesha
2013-05-01 11:11 ` [PATCH 2/2] PM / OPP: check for existing OPP list when initialising from device tree Sudeep.KarkadaNagesha
2013-05-01 15:04 ` Nishanth Menon [this message]
2013-05-01 16:33 ` Sudeep KarkadaNagesha
2013-05-01 16:51 ` Nishanth Menon
[not found] ` <1367406679-21603-1-git-send-email-Sudeep.KarkadaNagesha-5wv7dgnIgG8@public.gmane.org>
2013-05-21 10:00 ` [PATCH 0/2] PM / OPP: updates to enable sharing OPPs info Sudeep KarkadaNagesha
2013-07-20 5:09 ` Grant Likely
2013-07-22 12:56 ` Sudeep KarkadaNagesha
2013-07-22 13:01 ` 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=20130501150403.GA20488@kahuna \
--to=nm@ti.com \
--cc=Sudeep.KarkadaNagesha@arm.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=shawn.guo@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).