Commit d2e7a4b66d762cad383c5469c1e8b6076792ab6a

Authored by Jiri Slaby
Committed by Linus Torvalds
1 parent 1386a820b3

Char: esp, remove hangup and wakeup bottomhalves

There is no need to schedule a bottomhalf for either of them. One is fast
and the another schedules a bottomhalf itself.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 5 additions and 57 deletions Side-by-side Diff

... ... @@ -242,17 +242,6 @@
242 242 * -----------------------------------------------------------------------
243 243 */
244 244  
245   -/*
246   - * This routine is used by the interrupt handler to schedule
247   - * processing in the software interrupt portion of the driver.
248   - */
249   -static inline void rs_sched_event(struct esp_struct *info,
250   - int event)
251   -{
252   - info->event |= 1 << event;
253   - schedule_work(&info->tqueue);
254   -}
255   -
256 245 static DEFINE_SPINLOCK(pio_lock);
257 246  
258 247 static inline struct esp_pio_buffer *get_pio_buffer(void)
... ... @@ -474,7 +463,8 @@
474 463 }
475 464  
476 465 if (info->xmit_cnt < WAKEUP_CHARS) {
477   - rs_sched_event(info, ESP_EVENT_WRITE_WAKEUP);
  466 + if (info->tty)
  467 + tty_wakeup(info->tty);
478 468  
479 469 #ifdef SERIAL_DEBUG_INTR
480 470 printk("THRE...");
... ... @@ -512,7 +502,8 @@
512 502 info->xmit_tail = (info->xmit_tail + dma_bytes) & (ESP_XMIT_SIZE - 1);
513 503  
514 504 if (info->xmit_cnt < WAKEUP_CHARS) {
515   - rs_sched_event(info, ESP_EVENT_WRITE_WAKEUP);
  505 + if (info->tty)
  506 + tty_wakeup(info->tty);
516 507  
517 508 #ifdef SERIAL_DEBUG_INTR
518 509 printk("THRE...");
... ... @@ -604,7 +595,7 @@
604 595 #ifdef SERIAL_DEBUG_OPEN
605 596 printk("scheduling hangup...");
606 597 #endif
607   - schedule_work(&info->tqueue_hangup);
  598 + tty_hangup(info->tty);
608 599 }
609 600 }
610 601 }
611 602  
... ... @@ -720,42 +711,7 @@
720 711 * -------------------------------------------------------------------
721 712 */
722 713  
723   -static void do_softint(struct work_struct *work)
724   -{
725   - struct esp_struct *info =
726   - container_of(work, struct esp_struct, tqueue);
727   - struct tty_struct *tty;
728   -
729   - tty = info->tty;
730   - if (!tty)
731   - return;
732   -
733   - if (test_and_clear_bit(ESP_EVENT_WRITE_WAKEUP, &info->event)) {
734   - tty_wakeup(tty);
735   - }
736   -}
737   -
738 714 /*
739   - * This routine is called from the scheduler tqueue when the interrupt
740   - * routine has signalled that a hangup has occurred. The path of
741   - * hangup processing is:
742   - *
743   - * serial interrupt routine -> (scheduler tqueue) ->
744   - * do_serial_hangup() -> tty->hangup() -> esp_hangup()
745   - *
746   - */
747   -static void do_serial_hangup(struct work_struct *work)
748   -{
749   - struct esp_struct *info =
750   - container_of(work, struct esp_struct, tqueue_hangup);
751   - struct tty_struct *tty;
752   -
753   - tty = info->tty;
754   - if (tty)
755   - tty_hangup(tty);
756   -}
757   -
758   -/*
759 715 * ---------------------------------------------------------------
760 716 * Low level utility subroutines for the serial driver: routines to
761 717 * figure out the appropriate timeout for an interrupt chain, routines
... ... @@ -2038,7 +1994,6 @@
2038 1994 tty->driver->flush_buffer(tty);
2039 1995 tty_ldisc_flush(tty);
2040 1996 tty->closing = 0;
2041   - info->event = 0;
2042 1997 info->tty = NULL;
2043 1998  
2044 1999 if (info->blocked_open) {
... ... @@ -2106,7 +2061,6 @@
2106 2061  
2107 2062 rs_flush_buffer(tty);
2108 2063 shutdown(info);
2109   - info->event = 0;
2110 2064 info->count = 0;
2111 2065 info->flags &= ~ASYNC_NORMAL_ACTIVE;
2112 2066 info->tty = NULL;
... ... @@ -2492,8 +2446,6 @@
2492 2446 info->magic = ESP_MAGIC;
2493 2447 info->close_delay = 5*HZ/10;
2494 2448 info->closing_wait = 30*HZ;
2495   - INIT_WORK(&info->tqueue, do_softint);
2496   - INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
2497 2449 info->config.rx_timeout = rx_timeout;
2498 2450 info->config.flow_on = flow_on;
2499 2451 info->config.flow_off = flow_off;
include/linux/hayesesp.h
... ... @@ -71,7 +71,6 @@
71 71 #define ESP_STAT_NEVER_DMA 0x08
72 72 #define ESP_STAT_USE_PIO 0x10
73 73  
74   -#define ESP_EVENT_WRITE_WAKEUP 0
75 74 #define ESP_MAGIC 0x53ee
76 75 #define ESP_XMIT_SIZE 4096
77 76  
... ... @@ -92,7 +91,6 @@
92 91 unsigned short closing_wait2;
93 92 int IER; /* Interrupt Enable Register */
94 93 int MCR; /* Modem control register */
95   - unsigned long event;
96 94 unsigned long last_active;
97 95 int line;
98 96 int count; /* # of fd on device */
... ... @@ -101,8 +99,6 @@
101 99 int xmit_head;
102 100 int xmit_tail;
103 101 int xmit_cnt;
104   - struct work_struct tqueue;
105   - struct work_struct tqueue_hangup;
106 102 wait_queue_head_t open_wait;
107 103 wait_queue_head_t close_wait;
108 104 wait_queue_head_t delta_msr_wait;