From: Guenter Roeck <linux@roeck-us.net>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/9] thermal/core: Introduce locked version of thermal_zone_device_update
Date: Thu, 10 Nov 2022 06:11:57 -0800 [thread overview]
Message-ID: <20221110141157.GA2404288@roeck-us.net> (raw)
In-Reply-To: <CAJZ5v0je2QSUhU8Knk9UsboGLRpk2sNqE6U4X6eGAe+NUxZt_Q@mail.gmail.com>
On Thu, Nov 10, 2022 at 02:01:49PM +0100, Rafael J. Wysocki wrote:
> On Thu, Nov 10, 2022 at 1:25 AM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Wed, Nov 09, 2022 at 08:15:17PM +0100, Rafael J. Wysocki wrote:
> > > On Mon, Oct 17, 2022 at 3:09 PM Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> > > > In thermal_zone_device_set_mode(), the thermal zone mutex is released only
> > > > to be reacquired in the subsequent call to thermal_zone_device_update().
> > > >
> > > > Introduce __thermal_zone_device_update() as locked version of
> > >
> > > Did you mean "unlocked"?
> > >
> > No, I did mean "locked", as in "must be called with thermal zone device
> > mutex acquired".
> >
> > locked:
> >
> > void __thermal_zone_device_update(struct thermal_zone_device *tz,
> > enum thermal_notify_event event)
> > {
> > ...
> > }
> >
> > unlocked:
> >
> > void thermal_zone_device_update(struct thermal_zone_device *tz,
> > enum thermal_notify_event event)
> > {
> > mutex_lock(&tz->lock);
> > if (device_is_registered(&tz->device))
> > __thermal_zone_device_update(tz, event);
> > mutex_unlock(&tz->lock);
> > }
>
> Thanks for the explanation.
>
> > Should I phrase or explain it differently ?
>
> I would rather say "bare" or something like that so it is all clear to
> people like me, but it is your call.
I updated the commit description to use "must be called with thermal
device mutex held". I kept 'locked' in the subject; I don't think using
'bare' there would add any clarity. Hope that is ok.
Thanks,
Guenter
next prev parent reply other threads:[~2022-11-10 14:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 13:09 [PATCH 0/9] thermal/core: Protect thermal device operations against removal Guenter Roeck
2022-10-17 13:09 ` [PATCH 1/9] thermal/core: Destroy thermal zone device mutex in release function Guenter Roeck
2022-10-17 13:09 ` [PATCH 2/9] thermal/core: Delete device under thermal device zone lock Guenter Roeck
2022-10-17 13:09 ` [PATCH 3/9] thermal/core: Ensure that thermal device is registered in thermal_zone_get_temp Guenter Roeck
2022-11-09 19:07 ` Rafael J. Wysocki
2022-11-10 14:13 ` Guenter Roeck
2022-10-17 13:09 ` [PATCH 4/9] thermal/core: Move parameter validation from __thermal_zone_get_temp to thermal_zone_get_temp Guenter Roeck
2022-11-09 19:12 ` Rafael J. Wysocki
2022-10-17 13:09 ` [PATCH 5/9] thermal/core: Introduce locked version of thermal_zone_device_update Guenter Roeck
2022-11-09 19:15 ` Rafael J. Wysocki
2022-11-10 0:25 ` Guenter Roeck
2022-11-10 13:01 ` Rafael J. Wysocki
2022-11-10 14:11 ` Guenter Roeck [this message]
2022-11-10 14:14 ` Rafael J. Wysocki
2022-10-17 13:09 ` [PATCH 6/9] thermal/core: Protect hwmon accesses to thermal operations with thermal zone mutex Guenter Roeck
2022-11-09 19:19 ` Rafael J. Wysocki
2022-11-10 14:21 ` Guenter Roeck
2022-11-10 14:24 ` Rafael J. Wysocki
2022-10-17 13:09 ` [PATCH 7/9] thermal/core: Protect sysfs " Guenter Roeck
2022-11-09 19:26 ` Rafael J. Wysocki
2022-10-17 13:09 ` [PATCH 8/9] thermal/core: Remove thermal_zone_set_trips() Guenter Roeck
2022-10-17 13:09 ` [PATCH 9/9] thermal/core: Protect thermal device operations against thermal device removal Guenter Roeck
2022-11-02 18:50 ` [PATCH 0/9] thermal/core: Protect thermal device operations against removal Guenter Roeck
2022-11-02 18:55 ` Daniel Lezcano
2022-11-09 19:30 ` Rafael J. Wysocki
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=20221110141157.GA2404288@roeck-us.net \
--to=linux@roeck-us.net \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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
all inboxes | Powered by JetHome®