From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00C053B993F for ; Sat, 22 Aug 2026 16:10:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787415040; cv=none; b=L91I7guZJGSyjFH/565Qu6k/TzAqKfX1vyjPjuo+LewUDU8RVtRWQ/S95k1LNhwaO2yTD2204C2WQueV3AuHDa7FJVlJkiXLfUbQ+hJvo6k69Bi7nrUJMKF1hkQbiBrGhaUYsf5EG05/dZpShSB9t3EpvyBvjyxBP9XDJy5o4L4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787415040; c=relaxed/simple; bh=Fm6JqYsY5Mit+t5pynRJCvCdARdbRiqmWvgFv7CLTu4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UtEkYnK4kiOiEvFu+Y9AkcTXRobut7IWb72IQTA0Z4Qbc1QcBDvk4HBkKzQXlt5+2mf6GsPJfDaQwd6o1ULJrs3Jy7eYUjG5vHVYqJB6GxyQVQg0ATFxRUBAjY1VU5dJWMbFZa+ulOICATM8yqw3pKuyEfrspQpsypbibwDfVNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YdMmUPno; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YdMmUPno" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F2A1F000E9; Sat, 22 Aug 2026 16:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787415038; bh=YrsPXmVuvUhJa9QE4l/Jv7mCz8/TocDE1WlXy9e/Yr4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=YdMmUPno1Npuf+l1dTS3JSxwP3YaLAct79zTBWrjpo184jkMHNYkDA6tEbt/H0ipd o8ox9UcCzmh4EXKTA3fFZa4491An6tRlEzujCKqe0LYh3mbY38mpmSmllTVIKXCkMi 5iBvQdZLnIWOqOj1NTZYRvYtaTiCwB33L42ek1fA= Date: Sat, 22 Aug 2026 18:08:40 +0200 From: Greg KH To: old king 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? Message-ID: <2026082255-arrogance-flanking-bd89@gregkh> References: <2026082245-speak-gurgle-1f66@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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