linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Chander Kashyap <chander.kashyap@linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, "Brown, Len" <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Chander Kashyap <k.chander@samsung.com>,
	Inderpal Singh <inderpal.s@samsung.com>
Subject: Re: [PATCH v3] PM / OPP: discard duplicate OPPs
Date: Tue, 20 May 2014 08:36:15 -0500	[thread overview]
Message-ID: <537B5A4F.2040209@ti.com> (raw)
In-Reply-To: <CAKohponRwcd8C-OyhrY2ExgMUP-WcrYo641j6osXekmRTc4m6A@mail.gmail.com>

On 05/20/2014 08:31 AM, Viresh Kumar wrote:
> On 20 May 2014 17:35, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> Though after more thought into this I feel this must also be done:
>>
>> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
>> index bdf09f5..3f540d8 100644
>> --- a/drivers/base/power/opp.c
>> +++ b/drivers/base/power/opp.c
>> @@ -453,9 +453,13 @@ int dev_pm_opp_add(struct device *dev, unsigned
>> long freq, unsigned long u_volt)
>>         }
>>
>>         if (new_opp->rate == opp->rate) {
>> +               int ret = 0;
>> +
>> +               if (new_opp->u_volt == opp->u_volt)
>> +                       ret = -EEXIST;
>>                 mutex_unlock(&dev_opp_list_lock);
>>                 kfree(new_opp);
>> -               return 0;
>> +               return ret;
> 
> Ahh, sorry gentlemen. I have screwed up yet again.
> 
> I meant this instead:
> 
>> +               if (new_opp->u_volt != opp->u_volt)
>> +                       ret = -EEXIST;
> 
> Otherwise we are trying to add same OPP again and we can
> return zero.
> 
if it was added and disabled? I suggest:
new_opp->u_volt != opp->u_volt || !opp->available

I still dont like the idea that we are allowing folks to do:
{
	{1GHz 1.1V}
	{1GHz 1.1V}
	{1.2GHz 1.2V}
}

if you already had an OPP added and are trying to add it again, you
might want some debug ability. but anyways, with the mentioned check
above, my opposition is lower.

-- 
Regards,
Nishanth Menon

      reply	other threads:[~2014-05-20 13:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  9:00 [PATCH v3] PM / OPP: discard duplicate OPPs Chander Kashyap
2014-05-16 10:03 ` Viresh Kumar
2014-05-19 13:08 ` Nishanth Menon
2014-05-20  4:00   ` Viresh Kumar
2014-05-20 11:24     ` Nishanth Menon
2014-05-20 11:26       ` Viresh Kumar
2014-05-20 12:05         ` Viresh Kumar
2014-05-20 12:32           ` Nishanth Menon
2014-05-20 13:36             ` Viresh Kumar
2014-05-20 12:45           ` Rafael J. Wysocki
2014-05-20 13:29             ` Viresh Kumar
2014-05-20 13:31           ` Viresh Kumar
2014-05-20 13:36             ` Nishanth Menon [this message]

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=537B5A4F.2040209@ti.com \
    --to=nm@ti.com \
    --cc=chander.kashyap@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=inderpal.s@samsung.com \
    --cc=k.chander@samsung.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --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).