[PATCH 502] MVME167 serial: Replace bottom half handler with task queue handler
From: Geert Uytterhoeven (geert_at_linux-m68k.org)
Date: 10/31/04
- Previous message: Geert Uytterhoeven: "[PATCH 479] HP300 8250 serial for DCA and APCI ports"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 31 Oct 2004 11:03:39 +0100 To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
MVME167 serial: Fix compilation by replacing the bottom half handler with a
task queue handler, based on the Cyclades driver (from Kars de Jong)
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
--- linux-2.6.10-rc1/drivers/char/serial167.c 2004-10-23 10:33:01.000000000 +0200
+++ linux-m68k-2.6.10-rc1/drivers/char/serial167.c 2004-10-23 15:42:26.000000000 +0200
@@ -39,6 +39,9 @@
* - don't use the panic function in serial167_init
* - do resource release on failure on serial167_init
* - include missing restore_flags in mvme167_serial_console_setup
+ *
+ * Kars de Jong <jongk@linux-m68k.org> - 2004/09/06
+ * - replace bottom half handler with task queue handler
*/
#include <linux/config.h>
@@ -89,8 +92,6 @@
#define SERIAL_TYPE_NORMAL 1
-DECLARE_TASK_QUEUE(tq_cyclades);
-
static struct tty_driver *cy_serial_driver;
extern int serial_console;
static struct cyclades_port *serial_console_info = NULL;
@@ -373,8 +374,7 @@ static inline void
cy_sched_event(struct cyclades_port *info, int event)
{
info->event |= 1 << event; /* remember what kind of event and who */
- queue_task(&info->tqueue, &tq_cyclades); /* it belongs to */
- mark_bh(CYCLADES_BH); /* then trigger event */
+ schedule_work(&info->tqueue);
} /* cy_sched_event */
@@ -467,7 +467,7 @@ cd2401_rxerr_interrupt(int irq, void *de
and nothing could be done about it!!! */
}
}
- queue_task(&tty->flip.tqueue, &tq_timer);
+ schedule_delayed_work(&tty->flip.work, 1);
/* end of service */
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return IRQ_HANDLED;
@@ -702,7 +702,7 @@ cd2401_rx_interrupt(int irq, void *dev_i
udelay(10L);
#endif
}
- queue_task(&tty->flip.tqueue, &tq_timer);
+ schedule_delayed_work(&tty->flip.work, 1);
}
/* end of service */
base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS;
@@ -713,7 +713,7 @@ cd2401_rx_interrupt(int irq, void *dev_i
* This routine is used to handle the "bottom half" processing for the
* serial driver, known also the "software interrupt" processing.
* This processing is done at the kernel interrupt level, after the
- * cy_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON. This
+ * cy#/_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON. This
* is where time-consuming activities which can not be done in the
* interrupt driver proper are done; the interrupt driver schedules
* them using cy_sched_event(), and they get done here.
@@ -721,9 +721,7 @@ cd2401_rx_interrupt(int irq, void *dev_i
* This is done through one level of indirection--the task queue.
* When a hardware interrupt service routine wants service by the
* driver's bottom half, it enqueues the appropriate tq_struct (one
- * per port) to the tq_cyclades work queue and sets a request flag
- * via mark_bh for processing that queue. When the time is right,
- * do_cyclades_bh is called (because of the mark_bh) and it requests
+ * per port) to the keventd work queue and sets a request flag
* that the work queue be processed.
*
* Although this may seem unwieldy, it gives the system a way to
@@ -732,12 +730,6 @@ cd2401_rx_interrupt(int irq, void *dev_i
* had to poll every port to see if that port needed servicing.
*/
static void
-do_cyclades_bh(void)
-{
- run_task_queue(&tq_cyclades);
-} /* do_cyclades_bh */
-
-static void
do_softint(void *private_)
{
struct cyclades_port *info = (struct cyclades_port *) private_;
@@ -2278,8 +2270,6 @@ scrn[1] = '\0';
return ret;
}
- init_bh(CYCLADES_BH, do_cyclades_bh);
-
port_num = 0;
info = cy_port;
for (index = 0; index < 1; index++) {
@@ -2317,8 +2307,7 @@ scrn[1] = '\0';
info->blocked_open = 0;
info->default_threshold = 0;
info->default_timeout = 0;
- info->tqueue.routine = do_softint;
- info->tqueue.data = info;
+ INIT_WORK(&info->tqueue, do_softint, info);
init_waitqueue_head(&info->open_wait);
init_waitqueue_head(&info->close_wait);
/* info->session */
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Geert Uytterhoeven: "[PATCH 479] HP300 8250 serial for DCA and APCI ports"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: interrupt notification
... Or you might create a point-to-point message queue and send a different ...
DeviceIoControlto your driver. ... This device generates interrupt. ... (microsoft.public.windowsce.platbuilder) - Re: MIDI conjunction device
... InputSelected is not NONE and stat1 is put into a queue. ... which will send
out the queued bytes each time the TxEmpty interrupt ... and the OUT channel a queue
of arbitrary length. ... messages to be sent without their status characters (ie, ...
(comp.arch.embedded) - Re: IF_HANDOFF vs. IFQ_HANDOFF
... Is IF_HANDOFF supposed to be used only when the target queue is not the ...
The network adapter's transmit descriptor ring ... whether coalescing that locking with
existing driver locking makes ... The whole point of the IFF_OACTIVE flag is to
suppress the call to the ... (freebsd-net) - Re: Performance Intel Pro 1000 MT (PWLA8490MT)
... driver changed to not use the braindamaged sk interrupt moderation. ... with
small 50-60 byte UDP packets. ... when the tx queue fills up, the application should
stop sending, at ... For transmission, with non-broken hardware and software, ...
(freebsd-performance) - Re: Changes in the network interface queueing handoff model
... layer output routine via ifp->if_outputwith the ifnet pointer, packet, ...
as ARP), and hands off to the ifnet driver via a call to IFQ_HANDOFF, ... encapsulation
and wrapping, and notifies the hardware. ... The ifnet layer send queue is becoming
decreasingly useful over time. ... (freebsd-arch)