提交 c4342205 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

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: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fc37449f
...@@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data) ...@@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data)
struct moxa_port *ch; struct moxa_port *ch;
ch = (struct moxa_port *) data; ch = (struct moxa_port *) data;
del_timer_sync(&moxa_ports[ch->port].emptyTimer);
if (ch->tty && (ch->statusflags & EMPTYWAIT)) { if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
if (MoxaPortTxQueue(ch->port) == 0) { if (MoxaPortTxQueue(ch->port) == 0) {
ch->statusflags &= ~EMPTYWAIT; ch->statusflags &= ~EMPTYWAIT;
tty_wakeup(ch->tty); tty_wakeup(ch->tty);
return; return;
} }
mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ); mod_timer(&moxa_ports[ch->port].emptyTimer,
round_jiffies(jiffies + HZ));
} else } else
ch->statusflags &= ~EMPTYWAIT; ch->statusflags &= ~EMPTYWAIT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册