Re: [PATCH] USB: cdc-acm: fix racy TIOCMIWAIT implementation
From: Johan Hovold
Date: Tue Sep 08 2026 - 03:30:10 EST
On Tue, Sep 08, 2026 at 08:54:36AM +0200, Oliver Neukum wrote:
>
>
> On 07.09.26 15:03, Johan Hovold wrote:
> > On Mon, Sep 07, 2026 at 02:46:16PM +0200, Oliver Neukum wrote:
> >>
>
> >> We could do that and it would indeed be simpler.
> >>
> >> But it would change the semantics so that past status changes
> >> no longer show up in TIOCMIWAIT. Is that really a good idea?
> >
> > Yes, as the current behaviour is both non-standard and inconsistent.
> >
> > If you have multiple tasks waiting waiting on status change, then only
> > one of them will detect it, for example.
> >
> > And if there are multiple changes (before or during TIOCMIWAIT) events
> > may be lost too.
>
> Very well. Ample reasons. Do you have a patch or do you want me to fix it?
I sent a v2 yesterday that should take care of it all:
https://lore.kernel.org/all/20260907095130.130636-1-johan@xxxxxxxxxx/
Johan