From: Greg KH <gregkh@linuxfoundation.org>
To: old king <fy15309206903@gmail.com>
Cc: arnd@arndb.de, ralphs@netwinder.org, linux-kernel@vger.kernel.org
Subject: Re: nwbutton: lost wakeup in button_read() -- worth fixing, or is this driver done?
Date: Sat, 22 Aug 2026 18:08:40 +0200 [thread overview]
Message-ID: <2026082255-arrogance-flanking-bd89@gregkh> (raw)
In-Reply-To: <2026082245-speak-gurgle-1f66@gregkh>
On Sat, Aug 22, 2026 at 06:06:13PM +0200, Greg KH wrote:
> On Sat, Aug 22, 2026 at 11:01:38AM -0500, old king wrote:
> > Hi,
> >
> > button_read() in drivers/char/nwbutton.c sleeps unconditionally: nothing is
> > tested before schedule(), not even whether the buffer is empty. If
> > button_sequence_finished() wakes button_wait_queue in the window between
> > read() being entered and prepare_to_wait() queuing the reader, that wakeup
> > is lost and the reader sleeps until some later, unrelated button sequence
> > completes. The race predates commit eb831743f2b4, whose changelog already called
> > the code "inherently racy". I have reproduced it under QEMU and prepared a fix:
> > a sequence counter captured before queuing and re-checked after.
> >
> > Before I send that: is this driver still worth fixing? footbridge is
> > deprecated and its Kconfig says support goes away in 2027 unless remaining
> > users speak up. Every change to nwbutton.c in git history has been a
> > treewide cleanup rather than anything a user asked for, and
> > button_add_callback()/button_del_callback() have no callers in the tree. I
> > have no NetWinder hardware and no way to tell whether anyone else does.
>
> If you don't have the hardware to test it, don't worry about the driver
> at all.
I don't think it can even build, given that there is no definition for
machine_is_netwinder() anywhere in the tree that I can see. So maybe
many of these drivers can just be removed now. Arnd, any ideas?
thanks,
greg k-h
next prev parent reply other threads:[~2026-08-22 16:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 16:01 nwbutton: lost wakeup in button_read() -- worth fixing, or is this driver done? old king
2026-08-22 16:06 ` Greg KH
2026-08-22 16:08 ` Greg KH [this message]
2026-08-22 17:58 ` Arnd Bergmann
2026-08-23 0:12 ` old king
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=2026082255-arrogance-flanking-bd89@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=fy15309206903@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralphs@netwinder.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