Loading drivers/tty/tty_port.c +16 −11 Original line number Original line Diff line number Diff line Loading @@ -441,6 +441,20 @@ int tty_port_block_til_ready(struct tty_port *port, } } EXPORT_SYMBOL(tty_port_block_til_ready); EXPORT_SYMBOL(tty_port_block_til_ready); static void tty_port_drain_delay(struct tty_port *port, struct tty_struct *tty) { unsigned int bps = tty_get_baud_rate(tty); long timeout; if (bps > 1200) { timeout = (HZ * 10 * port->drain_delay) / bps; timeout = max_t(long, timeout, HZ / 10); } else { timeout = 2 * HZ; } schedule_timeout_interruptible(timeout); } int tty_port_close_start(struct tty_port *port, int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct file *filp) struct tty_struct *tty, struct file *filp) { { Loading Loading @@ -479,17 +493,8 @@ int tty_port_close_start(struct tty_port *port, if (test_bit(ASYNCB_INITIALIZED, &port->flags) && if (test_bit(ASYNCB_INITIALIZED, &port->flags) && port->closing_wait != ASYNC_CLOSING_WAIT_NONE) port->closing_wait != ASYNC_CLOSING_WAIT_NONE) tty_wait_until_sent_from_close(tty, port->closing_wait); tty_wait_until_sent_from_close(tty, port->closing_wait); if (port->drain_delay) { if (port->drain_delay) unsigned int bps = tty_get_baud_rate(tty); tty_port_drain_delay(port, tty); long timeout; if (bps > 1200) timeout = max_t(long, (HZ * 10 * port->drain_delay) / bps, HZ / 10); else timeout = 2 * HZ; schedule_timeout_interruptible(timeout); } /* Flush the ldisc buffering */ /* Flush the ldisc buffering */ tty_ldisc_flush(tty); tty_ldisc_flush(tty); Loading Loading
drivers/tty/tty_port.c +16 −11 Original line number Original line Diff line number Diff line Loading @@ -441,6 +441,20 @@ int tty_port_block_til_ready(struct tty_port *port, } } EXPORT_SYMBOL(tty_port_block_til_ready); EXPORT_SYMBOL(tty_port_block_til_ready); static void tty_port_drain_delay(struct tty_port *port, struct tty_struct *tty) { unsigned int bps = tty_get_baud_rate(tty); long timeout; if (bps > 1200) { timeout = (HZ * 10 * port->drain_delay) / bps; timeout = max_t(long, timeout, HZ / 10); } else { timeout = 2 * HZ; } schedule_timeout_interruptible(timeout); } int tty_port_close_start(struct tty_port *port, int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct file *filp) struct tty_struct *tty, struct file *filp) { { Loading Loading @@ -479,17 +493,8 @@ int tty_port_close_start(struct tty_port *port, if (test_bit(ASYNCB_INITIALIZED, &port->flags) && if (test_bit(ASYNCB_INITIALIZED, &port->flags) && port->closing_wait != ASYNC_CLOSING_WAIT_NONE) port->closing_wait != ASYNC_CLOSING_WAIT_NONE) tty_wait_until_sent_from_close(tty, port->closing_wait); tty_wait_until_sent_from_close(tty, port->closing_wait); if (port->drain_delay) { if (port->drain_delay) unsigned int bps = tty_get_baud_rate(tty); tty_port_drain_delay(port, tty); long timeout; if (bps > 1200) timeout = max_t(long, (HZ * 10 * port->drain_delay) / bps, HZ / 10); else timeout = 2 * HZ; schedule_timeout_interruptible(timeout); } /* Flush the ldisc buffering */ /* Flush the ldisc buffering */ tty_ldisc_flush(tty); tty_ldisc_flush(tty); Loading