Skip to content

Commit

Permalink
serial/aspeed-vuart: fix a couple mod_timer() calls
Browse files Browse the repository at this point in the history
The "unthrottle_timeout" is HZ/10 but mod_timer() takes a the actual
jiffie where you want it to timeout, not an offset.

Fixes: 5909c0b ("serial/aspeed-vuart: Implement quick throttle mechanism")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed May 14, 2018
1 parent 8afb1d2 commit a451deb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/tty/serial/8250/8250_aspeed_vuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ static void aspeed_vuart_unthrottle_exp(struct timer_list *timer)
struct uart_8250_port *up = vuart->port;

if (!tty_buffer_space_avail(&up->port.state->port)) {
mod_timer(&vuart->unthrottle_timer, unthrottle_timeout);
mod_timer(&vuart->unthrottle_timer,
jiffies + unthrottle_timeout);
return;
}

Expand Down Expand Up @@ -271,7 +272,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
if (!timer_pending(&vuart->unthrottle_timer)) {
vuart->port = up;
mod_timer(&vuart->unthrottle_timer,
unthrottle_timeout);
jiffies + unthrottle_timeout);
}

} else {
Expand Down

0 comments on commit a451deb

Please sign in to comment.