Skip to contentSkip to conversation

serial/aspeed-vuart: fix a couple mod_timer() calls

PATCH In review Dan Carpenter 2 participants 2 messages Apr 26, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial/aspeed-vuart: fix a couple mod_timer() calls

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")
drivers/tty/serial/8250/8250_aspeed_vuart.c +3 -2
index 023db3266757..435bec40dee6 100644
@@ -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 {
Acked-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 2 lines

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.

Cheers,

Jeremy