NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/57259: ucom serial ports cannot be re-opened "too quickly" with O_NONBLOCK



The following reply was made to PR kern/57259; it has been noted by GNATS.

From: Jason Thorpe <thorpej%me.com@localhost>
To: Taylor Campbell <riastradh%NetBSD.org@localhost>
Cc: "gnats-bugs%netbsd.org@localhost" <gnats-bugs%NetBSD.org@localhost>
Subject: Re: kern/57259: ucom serial ports cannot be re-opened "too quickly"
 with O_NONBLOCK
Date: Sun, 5 Mar 2023 04:29:09 -0800

 > On Mar 4, 2023, at 2:15 PM, Taylor R Campbell <riastradh%NetBSD.org@localhost> =
 wrote:
 >=20
 > is now implemented by sleeping only for the _remainder_ of the 1sec
 > delay in open(2):
 
 Yes, as it turns out, there were a couple of bugs in that block of code. =
  Most notably:
 
 - In the case if a spurious wake, it would not wait for the full =
 duration.
 - Even suppressing EWOULDBLOCK (resulting in an ERESTART), it would =
 simply fail with a spurious EINTR that I couldn=E2=80=99t determine =
 where that was coming from (clearly from some higher-up layer).
 
 I have a fix now that=E2=80=99s been tested for a few dozen rapid =
 open-close-open cycles, and is not crashy in the face of pulling the =
 device (which I did a couple of times).
 
 -- thorpej
 


Home | Main Index | Thread Index | Old Index