Source-Changes-HG archive

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

[src/netbsd-10]: src/sys/dev/usb Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/4316cc7e67bd
branches:  netbsd-10
changeset: 373856:4316cc7e67bd
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 07 19:52:01 2023 +0000

description:
Pull up following revision(s) (requested by thorpej in ticket #113):

        sys/dev/usb/ucom.c: revision 1.137

In the HUP-wait path in ucomopen():
- Use cv_timedwait() rather than cv_timedwait_sig(); the wait here is
 bounded (and fairly short besides) and seems appropriate to treat like
 other uninterruptible waits.  The behavior is now consistent with com(4)
 in this regard.
- Map EWOULDBLOCK return from cv_timedwait() to 0, as the successful passage
 of time is not an error in this case.
- If the HUP-wait time has passed, clear the HUP-wait timestamp.

PR kern/57259 (although insufficient -- another change to vfs_syscalls.c
is required)

diffstat:

 sys/dev/usb/ucom.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 6de0c467cbbf -r 4316cc7e67bd sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c        Sun Mar 05 14:38:29 2023 +0000
+++ b/sys/dev/usb/ucom.c        Tue Mar 07 19:52:01 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ucom.c,v 1.134.2.1 2023/02/22 13:06:42 martin Exp $    */
+/*     $NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $    */
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.1 2023/02/22 13:06:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -552,11 +552,16 @@
                        ms = MIN(INT_MAX - 1000, delta.tv_sec*1000);
                        ms += howmany(delta.tv_usec, 1000);
                        ticks = MAX(1, MIN(INT_MAX, mstohz(ms)));
-                       error = cv_timedwait_sig(&sc->sc_statecv, &sc->sc_lock,
+                       error = cv_timedwait(&sc->sc_statecv, &sc->sc_lock,
                            ticks);
                        mutex_exit(&sc->sc_lock);
+                       /* The successful passage of time is not an error. */
+                       if (error == EWOULDBLOCK) {
+                               error = 0;
+                       }
                        return error ? error : ERESTART;
                }
+               timerclear(&sc->sc_hup_time);
        }
 
        /*



Home | Main Index | Thread Index | Old Index