Commit c4342205 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds
Browse files

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: default avatarJiri Slaby <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fc37449f
......@@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data)
struct moxa_port *ch;
ch = (struct moxa_port *) data;
if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
if (MoxaPortTxQueue(ch->port) == 0) {
ch->statusflags &= ~EMPTYWAIT;
mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ);
round_jiffies(jiffies + HZ));
} else
ch->statusflags &= ~EMPTYWAIT;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment