From 195e93476c411a1aa392f600e93dc9b210198397 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 17 Feb 2023 23:17:13 +0000 Subject: [PATCH] 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. --- sys/dev/usb/ucom.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 9033d2318e14..034e2fdebcd7 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -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; }