适配插拔的USB串口应用,减小关闭延时

This commit is contained in:
张兆鹏 2025-02-19 15:47:35 +08:00
parent 69431d7943
commit ceb6524b52
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}