All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
To: Nishanth Menon <nm@ti.com>
Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	"rob.herring@calxeda.com" <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"
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-doc@vger.kernel.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, 01 May 2013 17:33:51 +0100	[thread overview]
Message-ID: <518143EF.3010900@arm.com> (raw)
In-Reply-To: <20130501150403.GA20488@kahuna>

On 01/05/13 16:04, Nishanth Menon wrote:
> 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?

Do we really need to differentiate ? How about returning -EEXIST ?




  reply	other threads:[~2013-05-01 16:33 UTC|newest]

Thread overview: 18+ 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 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
2013-05-01 15:04     ` Nishanth Menon
2013-05-01 16:33     ` Sudeep KarkadaNagesha [this message]
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-05-21 10:00     ` Sudeep KarkadaNagesha
2013-07-20  5:09     ` Grant Likely
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=518143EF.3010900@arm.com \
    --to=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=nm@ti.com \
    --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 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.