From: Eduardo Valentin <edubezval@gmail.com>
To: Javi Merino <javi.merino@arm.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH] thermal: lock the thermal zone when switching governors
Date: Mon, 8 Dec 2014 10:31:33 -0400 [thread overview]
Message-ID: <20141208143131.GA4613@developer> (raw)
In-Reply-To: <20141203191109.GA22781@e104805>
Hello,
On Wed, Dec 03, 2014 at 07:11:09PM +0000, Javi Merino wrote:
> Ping
>
> On Tue, Nov 25, 2014 at 04:00:33PM +0000, Javi Merino wrote:
> > Currently, userspace can request a governor change while the governor
> > itself is running. Grab the thermal zone lock when changing the
> > governor to prevent this race.
> >
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: Eduardo Valentin <edubezval@gmail.com>
> > Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
But I believe Rui has already merged this one. Just for the record
anyways.
> > ---
> > drivers/thermal/thermal_core.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> > index 43b90709585f..c1901961f8c0 100644
> > --- a/drivers/thermal/thermal_core.c
> > +++ b/drivers/thermal/thermal_core.c
> > @@ -757,6 +757,7 @@ policy_store(struct device *dev, struct device_attribute *attr,
> > snprintf(name, sizeof(name), "%s", buf);
> >
> > mutex_lock(&thermal_governor_lock);
> > + mutex_lock(&tz->lock);
> >
> > gov = __find_governor(strim(name));
> > if (!gov)
> > @@ -766,6 +767,7 @@ policy_store(struct device *dev, struct device_attribute *attr,
> > ret = count;
> >
> > exit:
> > + mutex_unlock(&tz->lock);
> > mutex_unlock(&thermal_governor_lock);
> > return ret;
> > }
> > --
> > 1.9.1
> >
>
prev parent reply other threads:[~2014-12-08 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 16:00 [PATCH] thermal: lock the thermal zone when switching governors Javi Merino
2014-12-03 19:11 ` Javi Merino
2014-12-08 14:31 ` Eduardo Valentin [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=20141208143131.GA4613@developer \
--to=edubezval@gmail.com \
--cc=javi.merino@arm.com \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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).