适配插拔的USB串口应用,减小关闭延时
This commit is contained in:
parent
69431d7943
commit
ceb6524b52
|
@ -140,6 +140,7 @@ static struct portmaster {
|
||||||
} ports[MAX_U_SERIAL_PORTS];
|
} ports[MAX_U_SERIAL_PORTS];
|
||||||
|
|
||||||
#define GS_CLOSE_TIMEOUT 15 /* seconds */
|
#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);
|
spin_unlock_irq(&port->port_lock);
|
||||||
wait_event_interruptible_timeout(port->drain_wait,
|
wait_event_interruptible_timeout(port->drain_wait,
|
||||||
gs_writes_finished(port),
|
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);
|
spin_lock_irq(&port->port_lock);
|
||||||
gser = port->port_usb;
|
gser = port->port_usb;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue