From: Jiri Slaby Date: Thu, 18 Oct 2007 10:06:19 +0000 (-0700) Subject: Char: moxa, fix and optimise empty timer X-Git-Tag: firefly_0821_release~24970 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c43422053bea7a5ce09f18d0c50a606fe1a549f4;p=firefly-linux-kernel-4.4.55.git Char: moxa, fix and optimise empty timer moxa, fix and optimise empty timer don't wait and delete empty timer in empty timer function. Also fire next empty timer at rounded jiffies to save power. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index ed76f0a127fd..5000b3bd091e 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data) struct moxa_port *ch; ch = (struct moxa_port *) data; - del_timer_sync(&moxa_ports[ch->port].emptyTimer); if (ch->tty && (ch->statusflags & EMPTYWAIT)) { if (MoxaPortTxQueue(ch->port) == 0) { ch->statusflags &= ~EMPTYWAIT; tty_wakeup(ch->tty); return; } - mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ); + mod_timer(&moxa_ports[ch->port].emptyTimer, + round_jiffies(jiffies + HZ)); } else ch->statusflags &= ~EMPTYWAIT; }