* [PATCH] serial/aspeed-vuart: fix a couple mod_timer() calls
@ 2018-04-26 5:50 Dan Carpenter
2018-04-26 21:38 ` Jeremy Kerr
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-04-26 5:50 UTC (permalink / raw)
To: linux-aspeed
The "unthrottle_timeout" is HZ/10 but mod_timer() takes a the actual
jiffie where you want it to timeout, not an offset.
Fixes: 5909c0bf9c7a ("serial/aspeed-vuart: Implement quick throttle mechanism")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index 023db3266757..435bec40dee6 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -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;
}
@@ -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 {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] serial/aspeed-vuart: fix a couple mod_timer() calls
2018-04-26 5:50 [PATCH] serial/aspeed-vuart: fix a couple mod_timer() calls Dan Carpenter
@ 2018-04-26 21:38 ` Jeremy Kerr
0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Kerr @ 2018-04-26 21:38 UTC (permalink / raw)
To: linux-aspeed
Hi Dan,
> The "unthrottle_timeout" is HZ/10 but mod_timer() takes a the actual
> jiffie where you want it to timeout, not an offset.
Ah, of course.
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-26 21:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 5:50 [PATCH] serial/aspeed-vuart: fix a couple mod_timer() calls Dan Carpenter
2018-04-26 21:38 ` Jeremy Kerr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).