diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-10-18 06:06:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:26 -0400 |
commit | c43422053bea7a5ce09f18d0c50a606fe1a549f4 (patch) | |
tree | ee04c7bf4f6009f026c704db97032af370bcc19f | |
parent | fc37449f7959aeedc2d38b183468ae73c9166fb6 (diff) |
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 <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/char/moxa.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
1040 | struct moxa_port *ch; | 1040 | struct moxa_port *ch; |
1041 | 1041 | ||
1042 | ch = (struct moxa_port *) data; | 1042 | ch = (struct moxa_port *) data; |
1043 | del_timer_sync(&moxa_ports[ch->port].emptyTimer); | ||
1044 | if (ch->tty && (ch->statusflags & EMPTYWAIT)) { | 1043 | if (ch->tty && (ch->statusflags & EMPTYWAIT)) { |
1045 | if (MoxaPortTxQueue(ch->port) == 0) { | 1044 | if (MoxaPortTxQueue(ch->port) == 0) { |
1046 | ch->statusflags &= ~EMPTYWAIT; | 1045 | ch->statusflags &= ~EMPTYWAIT; |
1047 | tty_wakeup(ch->tty); | 1046 | tty_wakeup(ch->tty); |
1048 | return; | 1047 | return; |
1049 | } | 1048 | } |
1050 | mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ); | 1049 | mod_timer(&moxa_ports[ch->port].emptyTimer, |
1050 | round_jiffies(jiffies + HZ)); | ||
1051 | } else | 1051 | } else |
1052 | ch->statusflags &= ~EMPTYWAIT; | 1052 | ch->statusflags &= ~EMPTYWAIT; |
1053 | } | 1053 | } |