From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Zhu GuangLei <zhugl3@xiaopeng.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, liuwb@xiaopeng.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2] misc/pvpanic: share the shutdown handler across devices
Date: Wed, 25 Nov 2026 11:06:22 +0100 [thread overview]
Message-ID: <2026112558-shirt-supply-0cf0@gregkh> (raw)
In-Reply-To: <20261125091520.173803-1-zhugl3@xiaopeng.com>
On Wed, Nov 25, 2026 at 05:15:20PM +0800, Zhu GuangLei wrote:
> @@ -141,6 +151,8 @@ static ssize_t events_show(struct device *dev, struct device_attribute *attr, ch
> {
> struct pvpanic_instance *pi = dev_get_drvdata(dev);
>
> + guard(mutex)(&pvpanic_sys_off_lock);
> +
> return sysfs_emit(buf, "%x\n", pi->events);
> }
Why do you need a lock to read a single value that could change right
after it is read?
thanks,
greg k-h
next prev parent reply other threads:[~2026-11-25 10:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 8:06 [PATCH] misc/pvpanic: share the shutdown handler across devices Zhu GuangLei
2026-11-25 8:34 ` Greg Kroah-Hartman
2026-11-25 9:15 ` Zhu GuangLei
2026-11-25 9:15 ` [PATCH v2] " Zhu GuangLei
2026-11-25 10:06 ` Greg Kroah-Hartman [this message]
2026-11-25 11:56 ` Zhu GuangLei
2026-11-25 11:56 ` [PATCH v3] " Zhu GuangLei
2026-11-25 12:12 ` Greg Kroah-Hartman
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=2026112558-shirt-supply-0cf0@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=liuwb@xiaopeng.com \
--cc=stable@vger.kernel.org \
--cc=zhugl3@xiaopeng.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 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.