Re: [PATCH] USB: cdc-acm: fix racy TIOCMIWAIT implementation

From: Johan Hovold

Date: Mon Sep 07 2026 - 05:19:46 EST


On Mon, Sep 07, 2026 at 10:47:49AM +0200, Johan Hovold wrote:
> On Mon, Sep 07, 2026 at 10:17:38AM +0200, Oliver Neukum wrote:
> > On 07.09.26 08:55, Johan Hovold wrote:
> > > The wakeup condition needs to be checked after adding the task to the
> > > waitqueue and updating the task state to avoid missing a racing modem
> > > status update or disconnect.
> >
> > I am sorry, but in this case I have to ask:
> > Isn't TIOCMIWAIT inherently racy against the hardware?
>
> What do you mean?

Ok, I think I see what you're getting at. Nothing prevents a modem
status change just before calling TIOCMIWAIT from being missed. That is
indeed a general problem with the interface.

Johan