git: cbc5350359b9 - main - ucom(4): Make sure the open routine is executed synchronously.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Tue, 30 Aug 2022 14:21:16 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=cbc5350359b9be916cc0dc1986147013c6f90483

commit cbc5350359b9be916cc0dc1986147013c6f90483
Author:     Dave Baukus <daveb@spectralogic.com>
AuthorDate: 2022-08-30 14:19:40 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-08-30 14:19:58 +0000

    ucom(4): Make sure the open routine is executed synchronously.
    
    To avoid issues starting any USB transfers before the open
    function is complete.
    
    Differential Revision:  https://reviews.freebsd.org/D36391
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking
---
 sys/dev/usb/serial/usb_serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c
index 89e568eb13c0..8117043ed8dc 100644
--- a/sys/dev/usb/serial/usb_serial.c
+++ b/sys/dev/usb/serial/usb_serial.c
@@ -628,9 +628,9 @@ ucom_queue_command(struct ucom_softc *sc,
 		task->termios_copy = *pt;
 
 	/*
-	 * Closing the device should be synchronous.
+	 * Closing or opening the device should be synchronous.
 	 */
-	if (fn == ucom_cfg_close)
+	if (fn == ucom_cfg_close || fn == ucom_cfg_open)
 		usb_proc_mwait(&ssc->sc_tq, t0, t1);
 
 	/*