aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-02-10 04:45:15 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:28 -0500
commit47c85c0db159bb0e5f8f5cb4ae7cc19a5c3359de (patch)
tree78ab2ca0ac8552a6d80bba5f7f8d1e71e9690e61 /drivers
parent98c47ea28a7d1b4a3fb003a805c312d5c977b1d2 (diff)
[PATCH] Char: mxser_new, remove tty_wakeup bottomhalf
It's safe to call tty_wakeup from irq context. Do not schedule it for later calling. 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/mxser_new.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 4d4721e5c6ae..420d23f50206 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -269,7 +269,6 @@ struct mxser_port {
269 struct mxser_mon mon_data; 269 struct mxser_mon mon_data;
270 270
271 spinlock_t slock; 271 spinlock_t slock;
272 struct work_struct tqueue;
273 wait_queue_head_t open_wait; 272 wait_queue_head_t open_wait;
274 wait_queue_head_t delta_msr_wait; 273 wait_queue_head_t delta_msr_wait;
275}; 274};
@@ -355,15 +354,6 @@ static void process_txrx_fifo(struct mxser_port *info)
355 } 354 }
356} 355}
357 356
358static void mxser_do_softint(struct work_struct *work)
359{
360 struct mxser_port *info = container_of(work, struct mxser_port, tqueue);
361 struct tty_struct *tty = info->tty;
362
363 if (test_and_clear_bit(MXSER_EVENT_TXLOW, &info->event))
364 tty_wakeup(tty);
365}
366
367static unsigned char mxser_get_msr(int baseaddr, int mode, int port) 357static unsigned char mxser_get_msr(int baseaddr, int mode, int port)
368{ 358{
369 unsigned char status = 0; 359 unsigned char status = 0;
@@ -607,8 +597,8 @@ static int mxser_change_speed(struct mxser_port *info,
607 outb(info->IER, info->ioaddr + 597 outb(info->IER, info->ioaddr +
608 UART_IER); 598 UART_IER);
609 } 599 }
610 set_bit(MXSER_EVENT_TXLOW, &info->event); 600 tty_wakeup(info->tty);
611 schedule_work(&info->tqueue); } 601 }
612 } else { 602 } else {
613 if (!(status & UART_MSR_CTS)) { 603 if (!(status & UART_MSR_CTS)) {
614 info->tty->hw_stopped = 1; 604 info->tty->hw_stopped = 1;
@@ -703,7 +693,6 @@ static void mxser_check_modem_status(struct mxser_port *port, int status)
703 if ((port->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) { 693 if ((port->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
704 if (status & UART_MSR_DCD) 694 if (status & UART_MSR_DCD)
705 wake_up_interruptible(&port->open_wait); 695 wake_up_interruptible(&port->open_wait);
706 schedule_work(&port->tqueue);
707 } 696 }
708 697
709 if (port->flags & ASYNC_CTS_FLOW) { 698 if (port->flags & ASYNC_CTS_FLOW) {
@@ -719,8 +708,7 @@ static void mxser_check_modem_status(struct mxser_port *port, int status)
719 outb(port->IER, port->ioaddr + 708 outb(port->IER, port->ioaddr +
720 UART_IER); 709 UART_IER);
721 } 710 }
722 set_bit(MXSER_EVENT_TXLOW, &port->event); 711 tty_wakeup(port->tty);
723 schedule_work(&port->tqueue);
724 } 712 }
725 } else { 713 } else {
726 if (!(status & UART_MSR_CTS)) { 714 if (!(status & UART_MSR_CTS)) {
@@ -2220,10 +2208,9 @@ static void mxser_transmit_chars(struct mxser_port *port)
2220 port->mon_data.up_txcnt += (cnt - port->xmit_cnt); 2208 port->mon_data.up_txcnt += (cnt - port->xmit_cnt);
2221 port->icount.tx += (cnt - port->xmit_cnt); 2209 port->icount.tx += (cnt - port->xmit_cnt);
2222 2210
2223 if (port->xmit_cnt < WAKEUP_CHARS) { 2211 if (port->xmit_cnt < WAKEUP_CHARS)
2224 set_bit(MXSER_EVENT_TXLOW, &port->event); 2212 tty_wakeup(port->tty);
2225 schedule_work(&port->tqueue); 2213
2226 }
2227 if (port->xmit_cnt <= 0) { 2214 if (port->xmit_cnt <= 0) {
2228 port->IER &= ~UART_IER_THRI; 2215 port->IER &= ~UART_IER_THRI;
2229 outb(port->IER, port->ioaddr + UART_IER); 2216 outb(port->IER, port->ioaddr + UART_IER);
@@ -2400,7 +2387,6 @@ static int __devinit mxser_initbrd(struct mxser_board *brd,
2400 info->custom_divisor = info->baud_base * 16; 2387 info->custom_divisor = info->baud_base * 16;
2401 info->close_delay = 5 * HZ / 10; 2388 info->close_delay = 5 * HZ / 10;
2402 info->closing_wait = 30 * HZ; 2389 info->closing_wait = 30 * HZ;
2403 INIT_WORK(&info->tqueue, mxser_do_softint);
2404 info->normal_termios = mxvar_sdriver->init_termios; 2390 info->normal_termios = mxvar_sdriver->init_termios;
2405 init_waitqueue_head(&info->open_wait); 2391 init_waitqueue_head(&info->open_wait);
2406 init_waitqueue_head(&info->delta_msr_wait); 2392 init_waitqueue_head(&info->delta_msr_wait);