linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: rjw@rjwysocki.net, ulf.hansson@linaro.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thara Gopinath <thara.gopinath@linaro.org>,
	Lina Iyer <ilina@codeaurora.org>,
	Ram Chandrasekar <rkumbako@codeaurora.org>,
	Zhang Rui <rui.zhang@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	"open list:GENERIC INCLUDE/ASM HEADER FILES" 
	<linux-arch@vger.kernel.org>
Subject: Re: [PATCH v4 3/4] powercap/drivers/dtpm: Add API for dynamic thermal power management
Date: Wed, 2 Dec 2020 17:19:35 +0000	[thread overview]
Message-ID: <b26cab76-a18f-06ee-23d6-bbcc4393364e@arm.com> (raw)
In-Reply-To: <9db21e5e-ede0-87c3-a556-8a5e666d52bc@arm.com>



On 12/2/20 12:37 PM, Lukasz Luba wrote:
> Hi Daniel,
> 
> I realized small issue when I went through this new mutex code
> (which is safer IMHO).
> 
> On 12/1/20 7:28 PM, Daniel Lezcano wrote:
> 
> [snip]
> 
>> +int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm 
>> *parent)
>> +{
>> +    struct powercap_zone *pcz;
>> +
>> +    if (!pct)
>> +        return -EAGAIN;
>> +
>> +    if (root && !parent)
>> +        return -EBUSY;
>> +
>> +    if (!root && parent)
>> +        return -EINVAL;
>> +
>> +    if (parent && parent->ops)
>> +        return -EINVAL;
>> +
> 
> Maybe it worth to add a check of dtpm pointer here, just to play safe?
> 
>      if (!dtpm)
>          return -EINVAL;
> 
> The dtpm->ops might explode when we don't capture this miss-usage during
> reviews of future drivers/shim layers. What do you think?
> 
> 
>> +    if (dtpm->ops && !(dtpm->ops->set_power_uw &&
>> +               dtpm->ops->get_power_uw &&
>> +               dtpm->ops->release))
>> +        return -EINVAL;
>> +
> 
> I am going to stress test the whole series with hotplug today
> and add review for patch 4/4.
> 

I have tested with a hotplug stress and looks OK with the mutex.
You can add again the tag:

Tested-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz

  reply	other threads:[~2020-12-02 17:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 19:27 [PATCH V4 0/4] powercap/dtpm: Add the DTPM framework Daniel Lezcano
2020-12-01 19:27 ` [PATCH v4 1/4] units: Add Watt units Daniel Lezcano
2020-12-01 19:27 ` [PATCH v4 2/4] Documentation/powercap/dtpm: Add documentation for dtpm Daniel Lezcano
2020-12-02 13:33   ` Lukasz Luba
2020-12-01 19:28 ` [PATCH v4 3/4] powercap/drivers/dtpm: Add API for dynamic thermal power management Daniel Lezcano
2020-12-02 12:37   ` Lukasz Luba
2020-12-02 17:19     ` Lukasz Luba [this message]
2020-12-01 19:28 ` [PATCH v4 4/4] powercap/drivers/dtpm: Add CPU energy model based support Daniel Lezcano
2020-12-02 17:09   ` Lukasz Luba

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=b26cab76-a18f-06ee-23d6-bbcc4393364e@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=arnd@arndb.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=ilina@codeaurora.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rkumbako@codeaurora.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@linaro.org \
    --cc=ulf.hansson@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).