From ceb6524b52acd5a3ac5af670bfa3cfd0335e11c0 Mon Sep 17 00:00:00 2001 From: zhangzhaopeng Date: Wed, 19 Feb 2025 15:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=8F=92=E6=8B=94=E7=9A=84US?= =?UTF-8?q?B=E4=B8=B2=E5=8F=A3=E5=BA=94=E7=94=A8=EF=BC=8C=E5=87=8F?= =?UTF-8?q?=E5=B0=8F=E5=85=B3=E9=97=AD=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lichee/linux-4.9/drivers/usb/gadget/function/u_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lichee/linux-4.9/drivers/usb/gadget/function/u_serial.c b/lichee/linux-4.9/drivers/usb/gadget/function/u_serial.c index 2f151e0aa..57cc7ebfc 100644 --- a/lichee/linux-4.9/drivers/usb/gadget/function/u_serial.c +++ b/lichee/linux-4.9/drivers/usb/gadget/function/u_serial.c @@ -140,6 +140,7 @@ static struct portmaster { } ports[MAX_U_SERIAL_PORTS]; #define GS_CLOSE_TIMEOUT 15 /* seconds */ +#define HAS_GS_CLOSE_TIMEOUT 400 /* ms */ @@ -882,7 +883,8 @@ static void gs_close(struct tty_struct *tty, struct file *file) spin_unlock_irq(&port->port_lock); wait_event_interruptible_timeout(port->drain_wait, gs_writes_finished(port), - GS_CLOSE_TIMEOUT * HZ); + msecs_to_jiffies(HAS_GS_CLOSE_TIMEOUT)); + // GS_CLOSE_TIMEOUT * HZ); spin_lock_irq(&port->port_lock); gser = port->port_usb; }