summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-02-17 23:38:54 +0000
committerriastradh <riastradh@NetBSD.org>2023-02-17 23:38:54 +0000
commitfda404e94f0cafcc7b9631328157aa2fb4a0cd6d (patch)
tree06207edd38b181b7060e67d49a75db7634e8aec9 /sys/dev/usb
parent1218a515cad1f6b10148af7cf28f3f74a424f6ff (diff)
ucom(4): Nix broken error branch.
This error branch was introduced to make the system act, when a USB serial adapter is yanked, as if the other end had spat out a line feed in an attempt to wake any sleeping readers so they will stop using the USB serial port. This is no longer necessary, because ttycancel will wake them anyway, and it is actually harmful because it puts stuff in the output queue (CR LF) that will never be processed, causing subsequent users to hang trying to open the device. Problem found and patch tested by tih@.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ucom.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 9033d2318e1..79bb8dae86c 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.134 2022/10/26 23:48:43 riastradh Exp $ */
+/* $NetBSD: ucom.c,v 1.135 2023/02/17 23:38:54 riastradh 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 2022/10/26 23:48:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.135 2023/02/17 23:38:54 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1446,18 +1446,8 @@ ucomreadcb(struct usbd_xfer *xfer, void *p, usbd_status status)
if (status == USBD_CANCELLED || status == USBD_IOERROR ||
sc->sc_closing) {
-
DPRINTF("... done (status %jd closing %jd)",
status, sc->sc_closing, 0, 0);
-
- if (status == USBD_IOERROR || sc->sc_closing) {
- /* Send something to wake upper layer */
- (tp->t_linesw->l_rint)('\n', tp);
- ttylock(tp); /* XXX */
- ttwakeup(tp);
- ttyunlock(tp); /* XXX */
- }
-
mutex_exit(&sc->sc_lock);
return;
}