Re: [PATCH] USB: cdc-acm: fix racy TIOCMIWAIT implementation
From: Johan Hovold
Date: Mon Sep 07 2026 - 05:04:53 EST
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?
Looking at the implementation again now, it seems further changes are
needed to fix the implementation, though. The completion handler should
not be updating old_count. That's for each TIOCMIWAIT to do.
Johan