diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-09-30 22:17:42 -0700 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2002-09-30 22:17:42 -0700 |
| commit | 6ed12ff83c765aeda7d38d3bf9df7d46d24bfb11 (patch) | |
| tree | d2dd4a9cefd38743d3e51fbbab3d79920bb19ae1 /drivers | |
| parent | 7570df54ef8cc5b42500d26562ff50fcbe265aa2 (diff) | |
[PATCH] Workqueue Abstraction
This is the next iteration of the workqueue abstraction.
The framework includes:
- per-CPU queueing support.
on SMP there is a per-CPU worker thread (bound to its CPU) and per-CPU
work queues - this feature is completely transparent to workqueue-users.
keventd automatically uses this feature. XFS can now update to work-queues
and have the same per-CPU performance as it had with its per-CPU worker
threads.
- delayed work submission
there's a new queue_delayed_work(wq, work, delay) function and a new
schedule_delayed_work(work, delay) function. The later one is used to
correctly fix former tq_timer users. I've reverted those changes in 2.5.40
that changed tq_timer uses to schedule_work() - eg. in the case of
random.c or the tty flip queue it was definitely the wrong thing to do.
delayed work means a timer embedded in struct work_struct. I considered
using split struct work_struct and delayed_work_struct types, but lots
of code actively uses task-queues in both delayed and non-delayed mode,
so i went for the more generic approach that allows both methods of work
submission. Delayed timers do not cause any other overhead in the
normal submission path otherwise.
- multithreaded run_workqueue() implementation
the run_workqueue() function can now be called from multiple contexts, and
a worker thread will only use up a single entryy - this property is used
by the flushing code, and can potentially be used in the future to extend
the number of per-CPU worker threads.
- more reliable flushing
there's now a 'pending work' counter, which is used to accurately detect
when the last work-function has finished execution. It's also used to
correctly flush against timed requests. I'm not convinced whether the old
keventd implementation got this detail right.
- i switched the arguments of the queueing function(s) per Jeff's
suggestion, it's more straightforward this way.
Driver fixes:
i have converted almost every affected driver to the new framework. This
cleaned up tons of code. I also fixed a number of drivers that were still
using BHs (these drivers did not compile in 2.5.40).
while this means lots of changes, it might ease the QA decision whether to
put this patch into 2.5.
The pach converts roughly 80% of all tqueue-using code to workqueues - and
all the places that are not converted to workqueues yet are places that do
not compile in vanilla 2.5.40 anyway, due to unrelated changes. I've
converted a fair number of drivers that do not compile in 2.5.40, and i
think i've managed to convert every driver that compiles under 2.5.40.
Diffstat (limited to 'drivers')
155 files changed, 550 insertions, 805 deletions
diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index d59a5deffd47..867cce4df91d 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c @@ -131,7 +131,7 @@ #include <linux/kernel.h> #include <linux/interrupt.h> #include <linux/timer.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/fd.h> #include <linux/fd1772.h> #include <linux/errno.h> @@ -324,8 +324,7 @@ static unsigned long changed_floppies = 0xff, fake_change = 0; static void fd1772_checkint(void); -struct tq_struct fd1772_tq = -{ 0,0, (void *)fd1772_checkint, 0 }; +DECLARE_WORK(fd1772_tq, (void *)fd1772_checkint, NULL); /* * The driver is trying to determine the correct media format * while Probing is set. fd_rwsec_done() clears it after a @@ -1288,8 +1287,7 @@ static void fd1772_checkint(void) floppy_irqconsequencehandler(); if ((MultReadInProgress) && (fdc1772_bytestogo==0)) fd_readtrack_check(0); if (fdc_busy) { - queue_task(&fd1772_tq,&tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&fd1772_tq); } } @@ -1311,8 +1309,7 @@ static void do_fd_request(request_queue_t* q) redo_fd_request(); - queue_task(&fd1772_tq,&tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&fd1772_tq); } diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 6e663fa8694b..dbbfc3d7305f 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -33,7 +33,7 @@ #include <linux/interrupt.h> #include <linux/kmod.h> #include <linux/delay.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/io.h> #include "acpi.h" @@ -586,8 +586,8 @@ acpi_os_queue_for_execution( * Queue via DPC: * -------------- * Note that we have to use two different processes for queuing DPCs: - * Interrupt-Level: Use schedule_task; can't spawn a new thread. - * Kernel-Level: Spawn a new kernel thread, as schedule_task has + * Interrupt-Level: Use schedule_work; can't spawn a new thread. + * Kernel-Level: Spawn a new kernel thread, as schedule_work has * its limitations (e.g. single-threaded model), and * all other task queues run at interrupt-level. */ @@ -605,9 +605,9 @@ acpi_os_queue_for_execution( * We can save time and code by allocating the DPC and tq_structs * from the same memory. */ - struct tq_struct *task; + struct work_struct *task; - dpc = kmalloc(sizeof(ACPI_OS_DPC)+sizeof(struct tq_struct), GFP_ATOMIC); + dpc = kmalloc(sizeof(ACPI_OS_DPC)+sizeof(struct work_struct), GFP_ATOMIC); if (!dpc) return_ACPI_STATUS (AE_NO_MEMORY); @@ -615,10 +615,10 @@ acpi_os_queue_for_execution( dpc->context = context; task = (void *)(dpc+1); - INIT_TQUEUE(task, acpi_os_schedule_exec, (void*)dpc); + INIT_WORK(task, acpi_os_schedule_exec, (void*)dpc); - if (schedule_task(task) < 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_task() failed.\n")); + if (schedule_work(task) < 0) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_work() failed.\n")); kfree(dpc); status = AE_ERROR; } diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index fc74c1e64801..6c77447f57b8 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c @@ -926,8 +926,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) if (irq_work) { #ifdef FILL_RX_POOLS_IN_BH - queue_task (&dev->bh, &tq_immediate); - mark_bh (IMMEDIATE_BH); + schedule_work (&dev->bh); #else fill_rx_pools (dev); #endif @@ -2402,10 +2401,7 @@ static int __init amb_probe (void) { #ifdef FILL_RX_POOLS_IN_BH // initialise bottom half - INIT_LIST_HEAD(&dev->bh.list); - dev->bh.sync = 0; - dev->bh.routine = (void (*)(void *)) fill_rx_pools; - dev->bh.data = dev; + INIT_WORK(&dev->bh, (void (*)(void *)) fill_rx_pools, dev); #endif // semaphore for txer/rxer modifications - we cannot use a diff --git a/drivers/atm/ambassador.h b/drivers/atm/ambassador.h index bddadf43294b..e83a63ecea68 100644 --- a/drivers/atm/ambassador.h +++ b/drivers/atm/ambassador.h @@ -632,7 +632,7 @@ struct amb_dev { u32 * membase; #ifdef FILL_RX_POOLS_IN_BH - struct tq_struct bh; + struct work_struct bh; #endif amb_cq cq; diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index f6d41caad5ab..633c40bd8e04 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -2896,8 +2896,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) if (stat & SAR_STAT_FBQ3A) card->irqstat[8]++; - queue_task(&card->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->tqueue); } out: @@ -3737,8 +3736,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) card->pcidev = pcidev; sprintf(card->name, "idt77252-%d", card->index); - card->tqueue.routine = idt77252_softint; - card->tqueue.data = (void *)card; + INIT_WORK(&card->tqueue, idt77252_softint, (void *)card); membase = pci_resource_start(pcidev, 1); srambase = pci_resource_start(pcidev, 2); diff --git a/drivers/atm/idt77252.h b/drivers/atm/idt77252.h index 0f68af3dcafe..5a087c4e9ba6 100644 --- a/drivers/atm/idt77252.h +++ b/drivers/atm/idt77252.h @@ -36,7 +36,7 @@ #include <linux/ptrace.h> #include <linux/skbuff.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> /*****************************************************************************/ @@ -365,7 +365,7 @@ struct idt77252_dev unsigned long softstat; unsigned long flags; /* see blow */ - struct tq_struct tqueue; + struct work_struct tqueue; unsigned long tct_base; /* TCT base address in SRAM */ unsigned long rct_base; /* RCT base address in SRAM */ diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index a2c374f5074f..f738b5ba02e0 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -150,7 +150,7 @@ static int print_unex=1; #include <linux/fs.h> #include <linux/kernel.h> #include <linux/timer.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #define FDPATCHES #include <linux/fdreg.h> @@ -1004,12 +1004,12 @@ static void empty(void) { } -static struct tq_struct floppy_tq; +static DECLARE_WORK(floppy_work, NULL, NULL); static void schedule_bh( void (*handler)(void*) ) { - floppy_tq.routine = (void *)(void *) handler; - schedule_task(&floppy_tq); + PREPARE_WORK(&floppy_work, handler, NULL); + schedule_work(&floppy_work); } static struct timer_list fd_timer; @@ -1017,7 +1017,7 @@ static struct timer_list fd_timer; static void cancel_activity(void) { do_floppy = NULL; - floppy_tq.routine = (void *)(void *) empty; + PREPARE_WORK(&floppy_work, (void*)(void*)empty, NULL); del_timer(&fd_timer); } @@ -1886,8 +1886,8 @@ static void show_floppy(void) printk("fdc_busy=%lu\n", fdc_busy); if (do_floppy) printk("do_floppy=%p\n", do_floppy); - if (floppy_tq.sync) - printk("floppy_tq.routine=%p\n", floppy_tq.routine); + if (floppy_work.pending) + printk("floppy_work.func=%p\n", floppy_work.func); if (timer_pending(&fd_timer)) printk("fd_timer.function=%p\n", fd_timer.function); if (timer_pending(&fd_timeout)){ @@ -4355,7 +4355,7 @@ int __init floppy_init(void) if (have_no_fdc) { DPRINT("no floppy controllers found\n"); - flush_scheduled_tasks(); + flush_scheduled_work(); if (usage_count) floppy_release_irq_and_dma(); blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); @@ -4511,8 +4511,8 @@ static void floppy_release_irq_and_dma(void) printk("floppy timer still active:%s\n", timeout_message); if (timer_pending(&fd_timer)) printk("auxiliary floppy timer still active\n"); - if (floppy_tq.sync) - printk("task queue still active\n"); + if (floppy_work.pending) + printk("work still pending\n"); #endif old_fdc = fdc; for (fdc = 0; fdc < N_FDC; fdc++) diff --git a/drivers/block/paride/pseudo.h b/drivers/block/paride/pseudo.h index 25cde3063cb1..3cfb03fd6a71 100644 --- a/drivers/block/paride/pseudo.h +++ b/drivers/block/paride/pseudo.h @@ -34,7 +34,7 @@ #include <linux/sched.h> #include <linux/timer.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> static void ps_timer_int( unsigned long data); static void ps_tq_int( void *data); @@ -50,7 +50,7 @@ static int ps_nice = 0; static spinlock_t ps_spinlock __attribute__((unused)) = SPIN_LOCK_UNLOCKED; static struct timer_list ps_timer = { function: ps_timer_int }; -static struct tq_struct ps_tq = { routine: ps_tq_int }; +static DECLARE_WORK(ps_tq, ps_tq_int, NULL); static void ps_set_intr( void (*continuation)(void), int (*ready)(void), @@ -71,7 +71,7 @@ static void ps_set_intr( void (*continuation)(void), disable_hlt(); #endif ps_tq_active = 1; - schedule_task(&ps_tq); + schedule_work(&ps_tq); } if (!ps_timer_active) { @@ -114,7 +114,7 @@ static void ps_tq_int( void *data ) #endif ps_tq_active = 1; - schedule_task(&ps_tq); + schedule_work(&ps_tq); spin_unlock_irqrestore(&ps_spinlock,flags); } diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 0d7a56ad5ff6..63cd1a149f2b 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -712,8 +712,6 @@ cy_get_user(unsigned long *addr) #define JIFFIES_DIFF(n, j) ((j) - (n)) -static DECLARE_TASK_QUEUE(tq_cyclades); - static struct tty_driver cy_serial_driver, cy_callout_driver; static int serial_refcount; @@ -934,8 +932,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 */ @@ -951,9 +948,7 @@ cy_sched_event(struct cyclades_port *info, int event) * 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 @@ -962,12 +957,6 @@ cy_sched_event(struct cyclades_port *info, int event) * 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_; @@ -1291,7 +1280,7 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs) #endif } } - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); } /* end of service */ cy_writeb((u_long)base_addr+(CyRIR<<index), (save_xir & 0x3f)); @@ -1673,7 +1662,7 @@ cyz_handle_rx(struct cyclades_port *info, volatile struct CH_CTRL *ch_ctrl, } #endif info->idle_stats.recv_idle = jiffies; - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); } /* Update rx_get */ cy_writel(&buf_ctrl->rx_get, new_rx_get); @@ -1888,7 +1877,7 @@ cyz_handle_cmd(struct cyclades_card *cinfo) if(delta_count) cy_sched_event(info, Cy_EVENT_DELTA_WAKEUP); if(special_count) - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); } } @@ -5513,8 +5502,6 @@ cy_init(void) unsigned short chip_number; int nports; - init_bh(CYCLADES_BH, do_cyclades_bh); - show_version(); /* Initialize the tty_driver structure */ @@ -5661,8 +5648,7 @@ cy_init(void) 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); info->callout_termios = cy_callout_driver.init_termios; info->normal_termios = @@ -5740,8 +5726,7 @@ cy_init(void) 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); info->callout_termios = cy_callout_driver.init_termios; info->normal_termios = @@ -5791,7 +5776,6 @@ cy_cleanup_module(void) #endif /* CONFIG_CYZ_INTR */ save_flags(flags); cli(); - remove_bh(CYCLADES_BH); if ((e1 = tty_unregister_driver(&cy_serial_driver))) printk("cyc: failed to unregister Cyclades serial driver(%d)\n", diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index 2b10c6a9db89..48825cbfc483 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h @@ -66,7 +66,7 @@ #include <linux/types.h> #include <linux/agp_backend.h> #endif -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/poll.h> #include <asm/pgalloc.h> #include "drm.h" @@ -575,7 +575,7 @@ typedef struct drm_device { int last_checked; /* Last context checked for DMA */ int last_context; /* Last current context */ unsigned long last_switch; /* jiffies at last context switch */ - struct tq_struct tq; + struct work_struct work; cycles_t ctx_start; cycles_t lck_start; #if __HAVE_DMA_HISTOGRAM diff --git a/drivers/char/drm/drm_dma.h b/drivers/char/drm/drm_dma.h index dce376f6cad2..b3482b06c76a 100644 --- a/drivers/char/drm/drm_dma.h +++ b/drivers/char/drm/drm_dma.h @@ -532,10 +532,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) dev->dma->this_buffer = NULL; #if __HAVE_DMA_IRQ_BH - INIT_LIST_HEAD( &dev->tq.list ); - dev->tq.sync = 0; - dev->tq.routine = DRM(dma_immediate_bh); - dev->tq.data = dev; + INIT_WORK(&dev->work, DRM(dma_immediate_bh), dev); #endif /* Before installing handler */ diff --git a/drivers/char/drm/gamma_dma.c b/drivers/char/drm/gamma_dma.c index e18a577c73f8..66bd224b7224 100644 --- a/drivers/char/drm/gamma_dma.c +++ b/drivers/char/drm/gamma_dma.c @@ -128,8 +128,7 @@ void gamma_dma_service(int irq, void *device, struct pt_regs *regs) clear_bit(0, &dev->dma_flag); /* Dispatch new buffer */ - queue_task(&dev->tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&dev->tq); } } diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c index 86138a234c8e..36f667e0df98 100644 --- a/drivers/char/drm/radeon_irq.c +++ b/drivers/char/drm/radeon_irq.c @@ -69,7 +69,7 @@ void DRM(dma_service)( DRM_IRQ_ARGS ) atomic_inc(&dev_priv->irq_received); #ifdef __linux__ - schedule_task(&dev->tq); + schedule_work(&dev->work); #endif /* __linux__ */ #ifdef __FreeBSD__ taskqueue_enqueue(taskqueue_swi, &dev->task); diff --git a/drivers/char/epca.c b/drivers/char/epca.c index f2a54d6cc11a..21cfffd84642 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -488,7 +488,7 @@ static inline void pc_sched_event(struct channel *ch, int event) ch->event |= 1 << event; MOD_INC_USE_COUNT; - if (schedule_task(&ch->tqueue) == 0) + if (schedule_work(&ch->tqueue) == 0) MOD_DEC_USE_COUNT; @@ -2039,8 +2039,7 @@ static void post_fep_init(unsigned int crd) ch->brdchan = bc; ch->mailbox = gd; - ch->tqueue.routine = do_softint; - ch->tqueue.data = ch; + INIT_WORK(&ch->tqueue, do_softint, ch); ch->board = &boards[crd]; switch (bd->type) diff --git a/drivers/char/epca.h b/drivers/char/epca.h index 1673ba859621..5ae3a270d28e 100644 --- a/drivers/char/epca.h +++ b/drivers/char/epca.h @@ -142,7 +142,7 @@ struct channel struct termios callout_termios; wait_queue_head_t open_wait; wait_queue_head_t close_wait; - struct tq_struct tqueue; + struct work_struct tqueue; volatile struct global_data *mailbox; }; diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 0af50fd3829f..9af004b642b5 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c @@ -48,7 +48,7 @@ #include <linux/init.h> #include <linux/poll.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -82,7 +82,7 @@ unsigned char days_in_mo[] = static int irq_active; #ifdef CONFIG_GEN_RTC_X -struct tq_struct genrtc_task; +struct work_struct genrtc_task; static struct timer_list timer_task; static unsigned int oldsecs; @@ -91,7 +91,7 @@ static int tt_exp; void gen_rtc_timer(unsigned long data); -static volatile int stask_active; /* schedule_task */ +static volatile int stask_active; /* schedule_work */ static volatile int ttask_active; /* timer_task */ static int stop_rtc_timers; /* don't requeue tasks */ static spinlock_t gen_rtc_lock = SPIN_LOCK_UNLOCKED; @@ -120,7 +120,7 @@ void genrtc_troutine(void *data) add_timer(&timer_task); gen_rtc_interrupt(0); - } else if (schedule_task(&genrtc_task) == 0) + } else if (schedule_work(&genrtc_task) == 0) stask_active = 0; } @@ -134,7 +134,7 @@ void gen_rtc_timer(unsigned long data) jiffies-tt_exp); ttask_active=0; stask_active=1; - if ((schedule_task(&genrtc_task) == 0)) + if ((schedule_work(&genrtc_task) == 0)) stask_active = 0; } @@ -253,12 +253,12 @@ static inline int gen_set_rtc_irq_bit(unsigned char bit) irq_active = 1; stop_rtc_timers = 0; lostint = 0; - genrtc_task.routine = genrtc_troutine; + INIT_WORK(&genrtc_task, genrtc_troutine, NULL); oldsecs = get_rtc_ss(); init_timer(&timer_task); stask_active = 1; - if (schedule_task(&genrtc_task) == 0){ + if (schedule_work(&genrtc_task) == 0){ stask_active = 0; } } diff --git a/drivers/char/ip2/i2ellis.h b/drivers/char/ip2/i2ellis.h index e6754e8127ec..72984869bea3 100644 --- a/drivers/char/ip2/i2ellis.h +++ b/drivers/char/ip2/i2ellis.h @@ -401,7 +401,7 @@ typedef struct _i2eBordStr rwlock_t write_fifo_spinlock; // For queuing interupt bottom half handlers. /\/\|=mhw=|\/\/ - struct tq_struct tqueue_interrupt; + struct work_struct tqueue_interrupt; struct timer_list SendPendingTimer; // Used by iiSendPending unsigned int SendPendingRetry; diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 4955f59d2eda..3d3711c1eff2 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c @@ -1582,8 +1582,7 @@ i2StripFifo(i2eBordStrPtr pB) WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); #ifdef USE_IQ - queue_task(&pCh->tqueue_input, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&pCh->tqueue_input); #else do_input(pCh); #endif @@ -1820,8 +1819,7 @@ i2StripFifo(i2eBordStrPtr pB) } /* End of switch on status type */ if (dss_change) { #ifdef USE_IQ - queue_task(&pCh->tqueue_status, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&pCh->tqueue_status); #else do_status(pCh); #endif diff --git a/drivers/char/ip2/i2lib.h b/drivers/char/ip2/i2lib.h index 44bc53bcec44..417a708c4ee1 100644 --- a/drivers/char/ip2/i2lib.h +++ b/drivers/char/ip2/i2lib.h @@ -27,6 +27,7 @@ #include "i2ellis.h" #include "i2pack.h" #include "i2cmd.h" +#include <linux/workqueue.h> //------------------------------------------------------------------------------ // i2ChanStr -- Channel Structure: @@ -224,9 +225,9 @@ typedef struct _i2ChanStr /* * Task queues for processing input packets from the board. */ - struct tq_struct tqueue_input; - struct tq_struct tqueue_status; - struct tq_struct tqueue_hangup; + struct work_struct tqueue_input; + struct work_struct tqueue_status; + struct work_struct tqueue_hangup; rwlock_t Ibuf_spinlock; rwlock_t Obuf_spinlock; diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c index a956deb09a6d..0dd0c527c380 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2main.c @@ -1097,8 +1097,7 @@ ip2_init_board( int boardnum ) pCh++; } ex_exit: - pB->tqueue_interrupt.routine = (void(*)(void*)) ip2_interrupt_bh; - pB->tqueue_interrupt.data = pB; + INIT_WORK(&pB->tqueue_interrupt, (void(*)(void*)) ip2_interrupt_bh, pB); return; err_release_region: @@ -1376,10 +1375,9 @@ ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs) iiDisableMailIrq(pB); // Park the board on the immediate queue for processing. - queue_task(&pB->tqueue_interrupt, &tq_immediate); + schedule_work(&pB->tqueue_interrupt); // Make sure the immediate queue is flagged to fire. - mark_bh(IMMEDIATE_BH); } #else // We are using immediate servicing here. This sucks and can diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index f2df983dc27c..145a324f46a5 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -159,7 +159,7 @@ struct moxa_str { struct termios callout_termios; wait_queue_head_t open_wait; wait_queue_head_t close_wait; - struct tq_struct tqueue; + struct work_struct tqueue; }; struct mxser_mstatus { @@ -384,8 +384,7 @@ int moxa_init(void) for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { ch->type = PORT_16550A; ch->port = i; - ch->tqueue.routine = do_moxa_softint; - ch->tqueue.data = ch; + INIT_WORK(&ch->tqueue, do_moxa_softint, ch); ch->tty = 0; ch->close_delay = 5 * HZ / 10; ch->closing_wait = 30 * HZ; @@ -1026,7 +1025,7 @@ static void moxa_poll(unsigned long ignored) else { set_bit(MOXA_EVENT_HANGUP, &ch->event); MOD_DEC_USE_COUNT; - if (schedule_task(&ch->tqueue) == 0) + if (schedule_work(&ch->tqueue) == 0) MOD_INC_USE_COUNT; } } diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 09bc80286cd8..4679215e7639 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -262,7 +262,7 @@ struct mxser_struct { int xmit_head; int xmit_tail; int xmit_cnt; - struct tq_struct tqueue; + struct work_struct tqueue; struct termios normal_termios; struct termios callout_termios; wait_queue_head_t open_wait; @@ -449,8 +449,7 @@ int mxser_initbrd(int board, struct mxser_hwconf *hwconf) info->custom_divisor = hwconf->baud_base[i] * 16; info->close_delay = 5 * HZ / 10; info->closing_wait = 30 * HZ; - info->tqueue.routine = mxser_do_softint; - info->tqueue.data = info; + INIT_WORK(&info->tqueue, mxser_do_softint, info); info->callout_termios = mxvar_cdriver.init_termios; info->normal_termios = mxvar_sdriver.init_termios; init_waitqueue_head(&info->open_wait); @@ -1480,7 +1479,7 @@ static inline void mxser_receive_chars(struct mxser_struct *info, *status = inb(info->base + UART_LSR) & info->read_status_mask; } while (*status & UART_LSR_DR); mxvar_log.rxcnt[info->port] += cnt; - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); } @@ -1513,7 +1512,7 @@ static inline void mxser_transmit_chars(struct mxser_struct *info) if (info->xmit_cnt < WAKEUP_CHARS) { set_bit(MXSER_EVENT_TXLOW, &info->event); MOD_INC_USE_COUNT; - if (schedule_task(&info->tqueue) == 0) + if (schedule_work(&info->tqueue) == 0) MOD_DEC_USE_COUNT; } if (info->xmit_cnt <= 0) { @@ -1544,7 +1543,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info, (info->flags & ASYNC_CALLOUT_NOHUP))) set_bit(MXSER_EVENT_HANGUP, &info->event); MOD_INC_USE_COUNT; - if (schedule_task(&info->tqueue) == 0) + if (schedule_work(&info->tqueue) == 0) MOD_DEC_USE_COUNT; } if (info->flags & ASYNC_CTS_FLOW) { @@ -1556,7 +1555,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info, set_bit(MXSER_EVENT_TXLOW, &info->event); MOD_INC_USE_COUNT; - if (schedule_task(&info->tqueue) == 0) + if (schedule_work(&info->tqueue) == 0) MOD_DEC_USE_COUNT; } } else { diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 26863600bf74..449324f86afb 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -68,7 +68,7 @@ #include <asm/bitops.h> #include <asm/types.h> #include <linux/termios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <pcmcia/version.h> #include <pcmcia/cs_types.h> @@ -195,7 +195,7 @@ typedef struct _mgslpc_info { unsigned char pim_value; spinlock_t lock; - struct tq_struct task; /* task structure for scheduling bh */ + struct work_struct task; /* task structure for scheduling bh */ u32 max_frame_size; @@ -562,9 +562,7 @@ static dev_link_t *mgslpc_attach(void) memset(info, 0, sizeof(MGSLPC_INFO)); info->magic = MGSLPC_MAGIC; - info->task.sync = 0; - info->task.routine = bh_handler; - info->task.data = info; + INIT_WORK(&info->task, bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; @@ -1460,8 +1458,7 @@ static void mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs) if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s(%d):%s queueing bh task.\n", __FILE__,__LINE__,info->device_name); - queue_task(&info->task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&info->task); info->bh_requested = 1; } diff --git a/drivers/char/random.c b/drivers/char/random.c index 6184f5c6adb5..634e98a8fbdf 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -252,7 +252,7 @@ #include <linux/poll.h> #include <linux/init.h> #include <linux/fs.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/processor.h> #include <asm/uaccess.h> @@ -624,8 +624,8 @@ static __u32 *batch_entropy_pool; static int *batch_entropy_credit; static int batch_max; static int batch_head, batch_tail; -static struct tq_struct batch_tqueue; static void batch_entropy_process(void *private_); +static DECLARE_WORK(batch_work, batch_entropy_process, NULL); /* note: the size must be a power of 2 */ static int __init batch_entropy_init(int size, struct entropy_store *r) @@ -640,8 +640,7 @@ static int __init batch_entropy_init(int size, struct entropy_store *r) } batch_head = batch_tail = 0; batch_max = size; - batch_tqueue.routine = batch_entropy_process; - batch_tqueue.data = r; + batch_work.data = r; return 0; } @@ -664,8 +663,10 @@ void batch_entropy_store(u32 a, u32 b, int num) new = (batch_head+1) & (batch_max-1); if (new != batch_tail) { - // FIXME: is this correct? - schedule_task(&batch_tqueue); + /* + * Schedule it for the next timer tick: + */ + schedule_delayed_work(&batch_work, 1); batch_head = new; } else { DEBUG_ENT("batch entropy buffer full\n"); @@ -1749,7 +1750,7 @@ static int change_poolsize(int poolsize) sysctl_init_random(new_store); old_store = random_state; - random_state = batch_tqueue.data = new_store; + random_state = batch_work.data = new_store; free_entropy_store(old_store); return 0; } diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h index 8e768a0cc4bc..d1302f0afcad 100644 --- a/drivers/char/rocket_int.h +++ b/drivers/char/rocket_int.h @@ -1143,7 +1143,6 @@ struct r_port { int cps; struct termios normal_termios; struct termios callout_termios; - struct tq_struct tqueue; wait_queue_head_t open_wait; wait_queue_head_t close_wait; }; diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c index 6ae9b63721af..2543c64cb769 100644 --- a/drivers/char/sh-sci.c +++ b/drivers/char/sh-sci.c @@ -431,8 +431,7 @@ static int sci_set_real_termios(void *ptr) static inline void sci_sched_event(struct sci_port *port, int event) { port->event |= 1 << event; - queue_task(&port->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&port->tqueue); } static void sci_transmit_chars(struct sci_port *port) @@ -825,8 +824,7 @@ static int sci_open(struct tty_struct * tty, struct file * filp) port->gs.count++; port->event = 0; - port->tqueue.routine = do_softint; - port->tqueue.data = port; + INIT_WORK(&port->tqueue, do_softint, port); /* * Start up serial port diff --git a/drivers/char/sh-sci.h b/drivers/char/sh-sci.h index f24ed0c75ea2..95746c8cd438 100644 --- a/drivers/char/sh-sci.h +++ b/drivers/char/sh-sci.h @@ -200,7 +200,7 @@ struct sci_port { void (*init_pins)(struct sci_port* port, unsigned int cflag); unsigned int old_cflag; struct async_icount icount; - struct tq_struct tqueue; + struct work_struct tqueue; unsigned long event; }; diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 694b0e1e9283..d7fb1d1ef9a1 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -220,7 +220,6 @@ #include <linux/fcntl.h> #include <linux/major.h> #include <linux/delay.h> -#include <linux/tqueue.h> #include <linux/version.h> #include <linux/pci.h> #include <linux/slab.h> diff --git a/drivers/char/sx.h b/drivers/char/sx.h index 1979be5c5064..17e06f49f027 100644 --- a/drivers/char/sx.h +++ b/drivers/char/sx.h @@ -22,10 +22,6 @@ struct sx_port { struct gs_port gs; - /* - struct tq_struct tqueue; - struct tq_struct tqueue_hangup; - */ struct wait_queue *shutdown_wait; int ch_base; int c_dcd; diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 6df0c24ef75b..aa4199d0054f 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -100,7 +100,7 @@ #include <asm/bitops.h> #include <asm/types.h> #include <linux/termios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #ifdef CONFIG_SYNCLINK_SYNCPPP_MODULE #define CONFIG_SYNCLINK_SYNCPPP 1 @@ -223,7 +223,7 @@ struct mgsl_struct { struct mgsl_struct *next_device; /* device list link */ spinlock_t irq_spinlock; /* spinlock for synchronizing with ISR */ - struct tq_struct task; /* task structure for scheduling bh */ + struct work_struct task; /* task structure for scheduling bh */ u32 EventMask; /* event trigger mask */ u32 RecordedEvents; /* pending events */ @@ -1757,8 +1757,7 @@ static void mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs) if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s(%d):%s queueing bh task.\n", __FILE__,__LINE__,info->device_name); - queue_task(&info->task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&info->task); info->bh_requested = 1; } @@ -4543,9 +4542,7 @@ struct mgsl_struct* mgsl_allocate_device() } else { memset(info, 0, sizeof(struct mgsl_struct)); info->magic = MGSL_MAGIC; - info->task.sync = 0; - info->task.routine = mgsl_bh_handler; - info->task.data = info; + INIT_WORK(&info->task, mgsl_bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 5eb95fa602b7..2cbeb4101663 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -67,7 +67,7 @@ #include <asm/bitops.h> #include <asm/types.h> #include <linux/termios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #ifdef CONFIG_SYNCLINK_SYNCPPP_MODULE #define CONFIG_SYNCLINK_SYNCPPP 1 @@ -194,7 +194,7 @@ typedef struct _synclinkmp_info { struct timer_list status_timer; /* input signal status check timer */ spinlock_t lock; /* spinlock for synchronizing with ISR */ - struct tq_struct task; /* task structure for scheduling bh */ + struct work_struct task; /* task structure for scheduling bh */ u32 max_frame_size; /* as set by device config */ @@ -2572,8 +2572,7 @@ static void synclinkmp_interrupt(int irq, void *dev_id, struct pt_regs * regs) if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s(%d):%s queueing bh task.\n", __FILE__,__LINE__,port->device_name); - queue_task(&port->task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&port->task); port->bh_requested = 1; } } @@ -3736,9 +3735,7 @@ SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) } else { memset(info, 0, sizeof(SLMP_INFO)); info->magic = MGSL_MAGIC; - info->task.sync = 0; - info->task.routine = bh_handler; - info->task.data = info; + INIT_WORK(&info->task, bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 82027ad3d67a..bccffaccce3a 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -538,7 +538,7 @@ void tty_hangup(struct tty_struct * tty) printk(KERN_DEBUG "%s hangup...\n", tty_name(tty, buf)); #endif - schedule_task(&tty->tq_hangup); + schedule_work(&tty->hangup_work); } void tty_vhangup(struct tty_struct * tty) @@ -1265,7 +1265,7 @@ static void release_dev(struct file * filp) /* * Make sure that the tty's task queue isn't activated. */ - flush_scheduled_tasks(); + flush_scheduled_work(); /* * The release_mem function takes care of the details of clearing @@ -1874,8 +1874,8 @@ static void __do_SAK(void *arg) } /* - * The tq handling here is a little racy - tty->SAK_tq may already be queued. - * Fortunately we don't need to worry, because if ->SAK_tq is already queued, + * The tq handling here is a little racy - tty->SAK_work may already be queued. + * Fortunately we don't need to worry, because if ->SAK_work is already queued, * the values which we write to it will be identical to the values which it * already has. --akpm */ @@ -1883,8 +1883,8 @@ void do_SAK(struct tty_struct *tty) { if (!tty) return; - PREPARE_TQUEUE(&tty->SAK_tq, __do_SAK, tty); - schedule_task(&tty->SAK_tq); + PREPARE_WORK(&tty->SAK_work, __do_SAK, tty); + schedule_work(&tty->SAK_work); } /* @@ -1900,7 +1900,10 @@ static void flush_to_ldisc(void *private_) unsigned long flags; if (test_bit(TTY_DONT_FLIP, &tty->flags)) { - schedule_task(&tty->flip.tqueue); + /* + * Do it after the next timer tick: + */ + schedule_delayed_work(&tty->flip.work, 1); return; } if (tty->flip.buf_num) { @@ -1977,7 +1980,7 @@ void tty_flip_buffer_push(struct tty_struct *tty) if (tty->low_latency) flush_to_ldisc((void *) tty); else - schedule_task(&tty->flip.tqueue); + schedule_delayed_work(&tty->flip.work, 1); } /* @@ -1991,18 +1994,16 @@ static void initialize_tty_struct(struct tty_struct *tty) tty->pgrp = -1; tty->flip.char_buf_ptr = tty->flip.char_buf; tty->flip.flag_buf_ptr = tty->flip.flag_buf; - tty->flip.tqueue.routine = flush_to_ldisc; - tty->flip.tqueue.data = tty; + INIT_WORK(&tty->flip.work, flush_to_ldisc, tty); init_MUTEX(&tty->flip.pty_sem); init_waitqueue_head(&tty->write_wait); init_waitqueue_head(&tty->read_wait); - tty->tq_hangup.routine = do_tty_hangup; - tty->tq_hangup.data = tty; + INIT_WORK(&tty->hangup_work, do_tty_hangup, tty); sema_init(&tty->atomic_read, 1); sema_init(&tty->atomic_write, 1); spin_lock_init(&tty->read_lock); INIT_LIST_HEAD(&tty->tty_files); - INIT_TQUEUE(&tty->SAK_tq, 0, 0); + INIT_WORK(&tty->SAK_work, NULL, NULL); } /* diff --git a/drivers/char/vt.c b/drivers/char/vt.c index f2d264ccfcb3..b88de4fe13b6 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -97,7 +97,7 @@ #include <linux/interrupt.h> #include <linux/config.h> #include <linux/version.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/bootmem.h> #include <linux/pm.h> @@ -161,9 +161,7 @@ static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ static int blankinterval = 10*60*HZ; static int vesa_off_interval; -static struct tq_struct console_callback_tq = { - routine: console_callback, -}; +static DECLARE_WORK(console_work, console_callback, NULL); /* * fg_console is the current virtual console, @@ -241,7 +239,7 @@ static inline void scrolldelta(int lines) void schedule_console_callback(void) { - schedule_task(&console_callback_tq); + schedule_work(&console_work); } static void scrup(int currcons, unsigned int t, unsigned int b, int nr) diff --git a/drivers/hotplug/cpqphp.h b/drivers/hotplug/cpqphp.h index 0be973674055..29b6b47da539 100644 --- a/drivers/hotplug/cpqphp.h +++ b/drivers/hotplug/cpqphp.h @@ -317,7 +317,7 @@ struct controller { u16 vendor_id; char proc_name[20]; char proc_name2[20]; - struct tq_struct int_task_event; + struct work_struct int_task_event; wait_queue_head_t queue; /* sleep & wake process */ }; diff --git a/drivers/hotplug/cpqphp_core.c b/drivers/hotplug/cpqphp_core.c index 4241575713e8..3cb48d075157 100644 --- a/drivers/hotplug/cpqphp_core.c +++ b/drivers/hotplug/cpqphp_core.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/miscdevice.h> #include <linux/slab.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/pci.h> #include <linux/init.h> #include <asm/uaccess.h> diff --git a/drivers/hotplug/cpqphp_ctrl.c b/drivers/hotplug/cpqphp_ctrl.c index d90f7eaee445..4086fe656f3f 100644 --- a/drivers/hotplug/cpqphp_ctrl.c +++ b/drivers/hotplug/cpqphp_ctrl.c @@ -31,7 +31,7 @@ #include <linux/kernel.h> #include <linux/types.h> #include <linux/slab.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/wait.h> @@ -971,7 +971,6 @@ void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs) if (schedule_flag) { up(&event_semaphore); dbg("Signal event_semaphore\n"); - mark_bh(IMMEDIATE_BH); } } diff --git a/drivers/hotplug/cpqphp_nvram.c b/drivers/hotplug/cpqphp_nvram.c index 08dca3fba90c..d8208ca574de 100644 --- a/drivers/hotplug/cpqphp_nvram.c +++ b/drivers/hotplug/cpqphp_nvram.c @@ -33,7 +33,7 @@ #include <linux/proc_fs.h> #include <linux/miscdevice.h> #include <linux/slab.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/pci.h> #include <linux/init.h> #include <asm/uaccess.h> diff --git a/drivers/hotplug/cpqphp_pci.c b/drivers/hotplug/cpqphp_pci.c index 8b9b16589f3b..22baa9198815 100644 --- a/drivers/hotplug/cpqphp_pci.c +++ b/drivers/hotplug/cpqphp_pci.c @@ -31,7 +31,7 @@ #include <linux/kernel.h> #include <linux/types.h> #include <linux/slab.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/proc_fs.h> #include <linux/pci.h> #include "cpqphp.h" diff --git a/drivers/hotplug/cpqphp_proc.c b/drivers/hotplug/cpqphp_proc.c index 8912f881664a..e06e929e95f1 100644 --- a/drivers/hotplug/cpqphp_proc.c +++ b/drivers/hotplug/cpqphp_proc.c @@ -31,7 +31,7 @@ #include <linux/kernel.h> #include <linux/types.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/pci.h> #include "cpqphp.h" diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 5f62532ab71f..6445c2add0ba 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -17,7 +17,7 @@ #include <linux/init.h> #include <linux/input.h> #include <linux/serio.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); MODULE_DESCRIPTION("AT and PS/2 keyboard driver"); diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index faabf8c1198e..cfc630290b9b 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c @@ -35,7 +35,7 @@ #include <linux/init.h> #include <linux/input.h> #include <linux/serio.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_DESCRIPTION("Sun keyboard driver"); @@ -76,7 +76,7 @@ struct sunkbd { unsigned char keycode[128]; struct input_dev dev; struct serio *serio; - struct tq_struct tq; + struct work_struct tq; char name[64]; char phys[32]; char type; @@ -106,7 +106,7 @@ static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned i switch (data) { case SUNKBD_RET_RESET: - schedule_task(&sunkbd->tq); + schedule_work(&sunkbd->tq); sunkbd->reset = -1; return; @@ -240,8 +240,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev) sunkbd->serio = serio; - sunkbd->tq.routine = sunkbd_reinit; - sunkbd->tq.data = sunkbd; + INIT_WORK(&sunkbd->tq, sunkbd_reinit, sunkbd); sunkbd->dev.keycode = sunkbd->keycode; sunkbd->dev.keycodesize = sizeof(unsigned char); diff --git a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c index 20adeed4b2fc..60f42caf64a9 100644 --- a/drivers/input/mouse/psmouse.c +++ b/drivers/input/mouse/psmouse.c @@ -17,7 +17,6 @@ #include <linux/input.h> #include <linux/serio.h> #include <linux/init.h> -#include <linux/tqueue.h> MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); MODULE_DESCRIPTION("PS/2 mouse driver"); @@ -43,7 +42,6 @@ struct psmouse { struct serio *serio; char *vendor; char *name; - struct tq_struct tq; unsigned char cmdbuf[8]; unsigned char packet[8]; unsigned char cmdcnt; diff --git a/drivers/input/power.c b/drivers/input/power.c index 793f4313fd24..4637cbec7325 100644 --- a/drivers/input/power.c +++ b/drivers/input/power.c @@ -51,9 +51,7 @@ static void suspend_button_task_handler(void *data) suspend_button_pushed = 0; } -static struct tq_struct suspend_button_task = { - routine: suspend_button_task_handler -}; +static DECLARE_WORK(suspend_button_task, suspend_button_task_handler, NULL); static void power_event(struct input_handle *handle, unsigned int type, unsigned int code, int down) @@ -73,7 +71,7 @@ static void power_event(struct input_handle *handle, unsigned int type, if (!suspend_button_pushed) { suspend_button_pushed = 1; - schedule_task(&suspend_button_task); + schedule_work(&suspend_button_task); } break; case KEY_POWER: diff --git a/drivers/isdn/act2000/act2000.h b/drivers/isdn/act2000/act2000.h index 7f71f94dd0a9..ebf3cd90ebcb 100644 --- a/drivers/isdn/act2000/act2000.h +++ b/drivers/isdn/act2000/act2000.h @@ -62,7 +62,7 @@ typedef struct act2000_fwid { #include <linux/sched.h> #include <linux/string.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/skbuff.h> #include <linux/errno.h> @@ -162,9 +162,9 @@ typedef struct act2000_card { __u16 need_b3ack; /* Flag: Need ACK for current skb */ struct sk_buff *sbuf; /* skb which is currently sent */ struct timer_list ptimer; /* Poll timer */ - struct tq_struct snd_tq; /* Task struct for xmit bh */ - struct tq_struct rcv_tq; /* Task struct for rcv bh */ - struct tq_struct poll_tq; /* Task struct for polled rcv bh */ + struct work_struct snd_tq; /* Task struct for xmit bh */ + struct work_struct rcv_tq; /* Task struct for rcv bh */ + struct work_struct poll_tq; /* Task struct for polled rcv bh */ msn_entry *msn_list; unsigned short msgnum; /* Message number fur sending */ act2000_chan bch[ACT2000_BCH]; /* B-Channel status/control */ @@ -179,20 +179,17 @@ typedef struct act2000_card { extern __inline__ void act2000_schedule_tx(act2000_card *card) { - queue_task(&card->snd_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->snd_tq); } extern __inline__ void act2000_schedule_rx(act2000_card *card) { - queue_task(&card->rcv_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->rcv_tq); } extern __inline__ void act2000_schedule_poll(act2000_card *card) { - queue_task(&card->poll_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->poll_tq); } extern char *act2000_find_eaz(act2000_card *, char); diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index 9e19feeb1b8b..9683dae6ae55 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c @@ -616,12 +616,9 @@ act2000_alloccard(int bus, int port, int irq, char *id) skb_queue_head_init(&card->sndq); skb_queue_head_init(&card->rcvq); skb_queue_head_init(&card->ackq); - card->snd_tq.routine = (void *) (void *) act2000_transmit; - card->snd_tq.data = card; - card->rcv_tq.routine = (void *) (void *) actcapi_dispatch; - card->rcv_tq.data = card; - card->poll_tq.routine = (void *) (void *) act2000_receive; - card->poll_tq.data = card; + INIT_WORK(&card->snd_tq, (void *) (void *) act2000_transmit, card); + INIT_WORK(&card->rcv_tq, (void *) (void *) actcapi_dispatch, card); + INIT_WORK(&card->poll_tq, (void *) (void *) act2000_receive, card); init_timer(&card->ptimer); card->interface.channels = ACT2000_BCH; card->interface.maxbufsize = 4000; diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index 7fef0b21eb7c..949a9497b0b5 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -20,7 +20,7 @@ #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/skbuff.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/capi.h> #include <linux/kernelcapi.h> #include <linux/init.h> @@ -69,8 +69,8 @@ struct capi_ctr *capi_cards[CAPI_MAXCONTR]; static int ncards; static struct sk_buff_head recv_queue; -static struct tq_struct tq_state_notify; -static struct tq_struct tq_recv_notify; +static struct work_struct tq_state_notify; +static struct work_struct tq_recv_notify; /* -------- ref counting -------------------------------------- */ @@ -234,7 +234,7 @@ static int notify_push(unsigned int cmd, u32 controller, * user process, not in bh. */ MOD_INC_USE_COUNT; - if (schedule_task(&tq_state_notify) == 0) + if (schedule_work(&tq_state_notify) == 0) MOD_DEC_USE_COUNT; return 0; } @@ -359,8 +359,7 @@ void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *s } skb_queue_tail(&recv_queue, skb); - queue_task(&tq_recv_notify, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&tq_recv_notify); return; error: @@ -875,11 +874,8 @@ static int __init kcapi_init(void) skb_queue_head_init(&recv_queue); - tq_state_notify.routine = notify_handler; - tq_state_notify.data = 0; - - tq_recv_notify.routine = recv_handler; - tq_recv_notify.data = 0; + INIT_WORK(&tq_state_notify, notify_handler, NULL); + INIT_WORK(&tq_recv_notify, recv_handler, NULL); kcapi_proc_init(); diff --git a/drivers/isdn/eicon/eicon.h b/drivers/isdn/eicon/eicon.h index 8d9c5acb6c10..c925f21b2f70 100644 --- a/drivers/isdn/eicon/eicon.h +++ b/drivers/isdn/eicon/eicon.h @@ -117,7 +117,7 @@ typedef struct { #include <linux/config.h> #include <linux/sched.h> #include <linux/string.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/skbuff.h> #include <linux/errno.h> @@ -321,9 +321,9 @@ typedef struct eicon_card { struct sk_buff_head sackq; /* Data-Ack-Message queue */ struct sk_buff_head statq; /* Status-Message queue */ int statq_entries; - struct tq_struct snd_tq; /* Task struct for xmit bh */ - struct tq_struct rcv_tq; /* Task struct for rcv bh */ - struct tq_struct ack_tq; /* Task struct for ack bh */ + struct work_struct snd_tq; /* Task struct for xmit bh */ + struct work_struct rcv_tq; /* Task struct for rcv bh */ + struct work_struct ack_tq; /* Task struct for ack bh */ eicon_chan* IdTable[256]; /* Table to find entity */ __u16 ref_in; __u16 ref_out; @@ -349,20 +349,17 @@ extern char *eicon_ctype_name[]; extern __inline__ void eicon_schedule_tx(eicon_card *card) { - queue_task(&card->snd_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->snd_tq); } extern __inline__ void eicon_schedule_rx(eicon_card *card) { - queue_task(&card->rcv_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->rcv_tq); } extern __inline__ void eicon_schedule_ack(eicon_card *card) { - queue_task(&card->ack_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->ack_tq); } extern int eicon_addcard(int, int, int, char *, int); diff --git a/drivers/isdn/eicon/linsys.c b/drivers/isdn/eicon/linsys.c index 14b0dab638e2..30680c6c9086 100644 --- a/drivers/isdn/eicon/linsys.c +++ b/drivers/isdn/eicon/linsys.c @@ -10,7 +10,7 @@ #include <linux/sched.h> #undef N_DATA -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/smp.h> struct pt_regs; @@ -79,26 +79,20 @@ int DivasBRIInitPCI(card_t *card, dia_card_t *cfg) int DivasDpcSchedule(void) { - static struct tq_struct DivasTask; + static struct work_struct DivasTask; - DivasTask.routine = DivasDoDpc; - DivasTask.data = (void *) 0; - - queue_task(&DivasTask, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&DivasTask, DivasDoDpc, NULL); + schedule_work(&DivasTask); return 0; } int DivasScheduleRequestDpc(void) { - static struct tq_struct DivasTask; - - DivasTask.routine = DivasDoRequestDpc; - DivasTask.data = (void *) 0; + static struct work_struct DivasTask; - queue_task(&DivasTask, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&DivasTask, DivasDoRequestDpc, NULL); + schedule_work(&DivasTask); return 0; } diff --git a/drivers/isdn/hisax/amd7930.c b/drivers/isdn/hisax/amd7930.c index dcc407c5fc14..5040215aa4ff 100644 --- a/drivers/isdn/hisax/amd7930.c +++ b/drivers/isdn/hisax/amd7930.c @@ -120,16 +120,14 @@ Bchan_xmt_bh(struct BCState *bcs) } else { clear_bit(BC_FLG_BUSY, &bcs->Flag); bcs->event |= 1 << B_XMTBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } } static void Bchan_xmit_callback(struct BCState *bcs) { - queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->hw.amd7930.tq_xmt); } /* B channel transmission: two modes (three, if you count L1_MODE_NULL) @@ -261,8 +259,7 @@ Bchan_recv_callback(struct BCState *bcs) (void *) &Bchan_recv_callback, (void *) bcs); } - queue_task(&hw->tq_rcv, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&hw->tq_rcv); } static void @@ -308,7 +305,7 @@ Bchan_rcv_bh(struct BCState *bcs) skb_queue_tail(&bcs->rqueue, hw->rv_skb); hw->rv_skb = skb; bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); + schedule_work(&bcs->tqueue); } } else if (len > 0) { /* Small packet received */ @@ -319,8 +316,7 @@ Bchan_rcv_bh(struct BCState *bcs) memcpy(skb_put(skb, len), hw->rv_skb->tail, len); skb_queue_tail(&bcs->rqueue, skb); bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } } else { /* Reception Error */ @@ -336,8 +332,7 @@ Bchan_rcv_bh(struct BCState *bcs) RCV_BUFSIZE/RCV_BUFBLKS); skb_queue_tail(&bcs->rqueue, skb); bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } } @@ -422,12 +417,11 @@ Bchan_init(struct BCState *bcs) } bcs->hw.amd7930.tq_rcv.sync = 0; - bcs->hw.amd7930.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh; - bcs->hw.amd7930.tq_rcv.data = (void *) bcs; + INIT_WORK(&bcs->hw.amd7930.tq_rcv, (void (*)(void *)) &Bchan_rcv_bh, + (void *) bcs); - bcs->hw.amd7930.tq_xmt.sync = 0; - bcs->hw.amd7930.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh; - bcs->hw.amd7930.tq_xmt.data = (void *) bcs; + INIT_WORK(&bcs->hw.amd7930.tq_xmt, (void (*)(void *)) &Bchan_xmt_bh, + (void *) bcs); } static void @@ -466,7 +460,7 @@ static void amd7930_drecv_callback(void *arg, int error, unsigned int count) { struct IsdnCardState *cs = (struct IsdnCardState *) arg; - static struct tq_struct task; + static struct work_struct task; struct sk_buff *skb; /* NOTE: This function is called directly from an interrupt handler */ @@ -479,10 +473,8 @@ amd7930_drecv_callback(void *arg, int error, unsigned int count) skb_queue_tail(&cs->rq, skb); } - task.routine = (void *) DChannel_proc_rcv; - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&task, (void *) DChannel_proc_rcv, (void *) cs); + schedule_work(&task); } if (cs->debug & L1_DEB_ISAC_FIFO) { @@ -503,7 +495,7 @@ static void amd7930_dxmit_callback(void *arg, int error) { struct IsdnCardState *cs = (struct IsdnCardState *) arg; - static struct tq_struct task; + static struct work_struct task; /* NOTE: This function is called directly from an interrupt handler */ @@ -521,10 +513,8 @@ amd7930_dxmit_callback(void *arg, int error) cs->tx_skb = NULL; - task.routine = (void *) DChannel_proc_xmt; - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&task, (void *) DChannel_proc_xmt, (void *) cs); + schedule_work(&task); } static void @@ -643,7 +633,7 @@ amd7930_new_ph(struct IsdnCardState *cs) static void amd7930_liu_callback(struct IsdnCardState *cs) { - static struct tq_struct task; + static struct work_struct task; if (!cs) return; @@ -654,11 +644,8 @@ amd7930_liu_callback(struct IsdnCardState *cs) debugl1(cs, tmp); } - task.sync = 0; - task.routine = (void *) &amd7930_new_ph; - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&task, (void *) &amd7930_new_ph, (void *) cs); + schedule_work(&task); } void diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index eaa497fa8d6f..02fbf3d54b5f 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c @@ -277,8 +277,7 @@ Amd7930_sched_event(struct IsdnCardState *cs, int event) // ok } test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } static void @@ -791,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs) cs->dc.amd7930.old_state = 0; cs->dc.amd7930.lmr1 = 0x40; cs->dc.amd7930.ph_command = Amd7930_ph_command; - cs->tqueue.routine = (void *) (void *) Amd7930_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) Amd7930_bh, NULL); cs->setstack_d = setstack_Amd7930; cs->DC_Close = DC_Close_Amd7930; cs->dbusytimer.function = (void *) dbusy_timer_handler; diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index c79475b5937b..a0681c24148e 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -200,8 +200,7 @@ void inline hdlc_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } void diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index a7323e797d8e..7efd1aa3164c 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -22,7 +22,7 @@ #include "hisax.h" #include <linux/module.h> #include <linux/kernel_stat.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #define HISAX_STATUS_BUFSIZE 4096 #define INCLUDE_INLINE_FUNCS @@ -1789,7 +1789,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], hisax_d_if->cs = cs; cs->hw.hisax_d_if = hisax_d_if; cs->cardmsg = hisax_cardmsg; - cs->tqueue.routine = (void *) (void *) hisax_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) hisax_bh, NULL); cs->channel[0].d_st->l1.l2l1 = hisax_d_l2l1; for (i = 0; i < 2; i++) { cs->bcs[i].BC_SetStack = hisax_bc_setstack; @@ -1818,8 +1818,7 @@ void hisax_unregister(struct hisax_d_if *hisax_d_if) static void hisax_sched_event(struct IsdnCardState *cs, int event) { cs->event |= 1 << event; - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } static void hisax_bh(struct IsdnCardState *cs) @@ -1845,8 +1844,7 @@ static void hisax_bh(struct IsdnCardState *cs) static void hisax_b_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static inline void D_L2L1(struct hisax_d_if *d_if, int pr, void *arg) diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index 6aa6df7efe6e..65b9e22913ee 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c @@ -202,8 +202,7 @@ static void hfc_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static struct sk_buff @@ -646,8 +645,7 @@ void sched_event_D(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } static @@ -1129,7 +1127,7 @@ init2bds0(struct IsdnCardState *cs) cs->dbusytimer.function = (void *) hfc_dbusy_timer; cs->dbusytimer.data = (long) cs; init_timer(&cs->dbusytimer); - cs->tqueue.routine = (void *) (void *) hfcd_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) hfcd_bh, NULL); if (!cs->hw.hfcD.send) cs->hw.hfcD.send = init_send_hfcd(16); if (!cs->bcs[0].hw.hfc.send) diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c index da8d9a48ce30..f6c39022701d 100644 --- a/drivers/isdn/hisax/hfc_2bs0.c +++ b/drivers/isdn/hisax/hfc_2bs0.c @@ -86,8 +86,7 @@ void hfc_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static void diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 1c3cde4e1cfc..e606de8c5bf1 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -194,8 +194,7 @@ static void sched_event_D_pci(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } /*********************************/ @@ -205,8 +204,7 @@ static void hfcpci_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } /************************************************/ @@ -1624,7 +1622,7 @@ inithfcpci(struct IsdnCardState *cs) cs->dbusytimer.function = (void *) hfcpci_dbusy_timer; cs->dbusytimer.data = (long) cs; init_timer(&cs->dbusytimer); - cs->tqueue.routine = (void *) (void *) hfcpci_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) hfcpci_bh, NULL); cs->BC_Send_Data = &hfcpci_send_data; cs->bcs[0].BC_SetStack = setstack_2b; cs->bcs[1].BC_SetStack = setstack_2b; diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index d9ea9ea9b9ea..dd8172c5443c 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c @@ -464,8 +464,7 @@ static void sched_event_D_sx(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } /*********************************/ @@ -475,8 +474,7 @@ static void hfcsx_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } /************************************************/ @@ -1412,7 +1410,7 @@ inithfcsx(struct IsdnCardState *cs) cs->dbusytimer.function = (void *) hfcsx_dbusy_timer; cs->dbusytimer.data = (long) cs; init_timer(&cs->dbusytimer); - cs->tqueue.routine = (void *) (void *) hfcsx_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) hfcsx_bh, NULL); cs->BC_Send_Data = &hfcsx_send_data; cs->bcs[0].BC_SetStack = setstack_2b; cs->bcs[1].BC_SetStack = setstack_2b; diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 3fb58ceb3639..dceac063b896 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -453,8 +453,8 @@ struct amd7930_hw { int rv_buff_out; struct sk_buff *rv_skb; struct hdlc_state *hdlc_state; - struct tq_struct tq_rcv; - struct tq_struct tq_xmt; + struct work_struct tq_rcv; + struct work_struct tq_xmt; }; #define BC_FLG_INIT 1 @@ -495,7 +495,7 @@ struct BCState { u_char *blog; u_char *conmsg; struct timer_list transbusy; - struct tq_struct tqueue; + struct work_struct tqueue; unsigned long event; int (*BC_SetStack) (struct PStack *, struct BCState *); void (*BC_Close) (struct BCState *); @@ -954,7 +954,7 @@ struct IsdnCardState { struct sk_buff *tx_skb; int tx_cnt; long event; - struct tq_struct tqueue; + struct work_struct tqueue; struct timer_list dbusytimer; #ifdef ERROR_STATISTIC int err_crc; diff --git a/drivers/isdn/hisax/hscx.c b/drivers/isdn/hisax/hscx.c index 0022d4635abf..0770479e41d0 100644 --- a/drivers/isdn/hisax/hscx.c +++ b/drivers/isdn/hisax/hscx.c @@ -95,8 +95,7 @@ void hscx_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } void diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c index e5578ea42c6b..aee1cca364d2 100644 --- a/drivers/isdn/hisax/icc.c +++ b/drivers/isdn/hisax/icc.c @@ -191,8 +191,7 @@ void icc_sched_event(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } void @@ -625,7 +624,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) void __init initicc(struct IsdnCardState *cs) { - cs->tqueue.routine = (void *) (void *) icc_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) icc_bh, NULL); cs->setstack_d = setstack_icc; cs->DC_Close = DC_Close_icc; cs->dc.icc.mon_tx = NULL; diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c index 360e98cda54f..5d5ab330996d 100644 --- a/drivers/isdn/hisax/ipacx.c +++ b/drivers/isdn/hisax/ipacx.c @@ -304,8 +304,7 @@ static void dch_sched_event(struct IsdnCardState *cs, int event) { set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } //---------------------------------------------------------- @@ -510,7 +509,7 @@ dch_init(struct IsdnCardState *cs) { printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n"); - cs->tqueue.routine = (void *)(void *) dch_bh; + INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh); cs->setstack_d = dch_setstack; cs->dbusytimer.function = (void *) dbusy_timer_handler; @@ -593,8 +592,7 @@ static void bch_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } //---------------------------------------------------------- diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c index 28d36fa27086..f90ee9a78bd0 100644 --- a/drivers/isdn/hisax/isac.c +++ b/drivers/isdn/hisax/isac.c @@ -195,8 +195,7 @@ void isac_sched_event(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } void @@ -627,7 +626,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) void __devinit initisac(struct IsdnCardState *cs) { - cs->tqueue.routine = (void *) (void *) isac_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) isac_bh, NULL); cs->setstack_d = setstack_isac; cs->DC_Close = DC_Close_isac; cs->dc.isac.mon_tx = NULL; diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index fa2db36de37a..6eec59bc3207 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -447,8 +447,7 @@ static void isar_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static inline void @@ -1561,7 +1560,7 @@ isar_setup(struct IsdnCardState *cs) cs->bcs[i].mode = 0; cs->bcs[i].hw.isar.dpath = i + 1; modeisar(&cs->bcs[i], 0, 0); - cs->bcs[i].tqueue.routine = (void *) (void *) isar_bh; + INIT_WORK(&cs->bcs[i].tqueue, (void *) (void *) isar_bh, NULL); } } diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index 02f8681e821f..22643af00e4b 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -345,9 +345,7 @@ init_bcstate(struct IsdnCardState *cs, bcs->cs = cs; bcs->channel = bc; - bcs->tqueue.sync = 0; - bcs->tqueue.routine = (void *) (void *) BChannel_bh; - bcs->tqueue.data = bcs; + INIT_WORK(&bcs->tqueue, (void *) (void *) BChannel_bh, bcs); bcs->BC_SetStack = NULL; bcs->BC_Close = NULL; bcs->Flag = 0; diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c index 09b03e137af5..b3d75918e907 100644 --- a/drivers/isdn/hisax/jade.c +++ b/drivers/isdn/hisax/jade.c @@ -138,8 +138,7 @@ void jade_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static void diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c index e48193cf55c2..525cd6544e79 100644 --- a/drivers/isdn/hisax/netjet.c +++ b/drivers/isdn/hisax/netjet.c @@ -434,8 +434,7 @@ static void got_frame(struct BCState *bcs, int count) { skb_queue_tail(&bcs->rqueue, skb); } bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); if (bcs->cs->debug & L1_DEB_RECEIVE_FRAME) printframe(bcs->cs, bcs->hw.tiger.rcvbuf, count, "rec"); @@ -791,8 +790,7 @@ static void write_raw(struct BCState *bcs, u_int *buf, int cnt) { cnt - s_cnt); } bcs->event |= 1 << B_XMTBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } } } else if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) { diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index c67153f1cf4f..715b84e4d773 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -135,16 +135,14 @@ void W6692_sched_event(struct IsdnCardState *cs, int event) { test_and_set_bit(event, &cs->event); - queue_task(&cs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&cs->tqueue); } static void W6692B_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&bcs->tqueue); } static void @@ -889,7 +887,7 @@ void resetW6692(struct IsdnCardState *cs) void __init initW6692(struct IsdnCardState *cs, int part) { if (part & 1) { - cs->tqueue.routine = (void *) (void *) W6692_bh; + INIT_WORK(&cs->tqueue, (void *) (void *) W6692_bh, NULL); cs->setstack_d = setstack_W6692; cs->DC_Close = DC_Close_W6692; cs->dbusytimer.function = (void *) dbusy_timer_handler; diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index aae47971c5f0..c2e7117ebd3d 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -59,10 +59,8 @@ ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs) b |= dpr->ToHyInt; /* and for champ */ /* start kernel task immediately after leaving all interrupts */ - if (!card->hw_lock) { - queue_task(&card->irq_queue, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } + if (!card->hw_lock) + schedule_work(&card->irq_queue); restore_flags(flags); } /* ergo_interrupt */ @@ -177,8 +175,7 @@ ergo_set_errlog_state(hysdn_card * card, int on) card->err_log_state = ERRLOG_STATE_STOP; /* request stop */ restore_flags(flags); - queue_task(&card->irq_queue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->irq_queue); } /* ergo_set_errlog_state */ /******************************************/ @@ -450,9 +447,7 @@ ergo_inithardware(hysdn_card * card) card->writebootseq = ergo_writebootseq; card->waitpofready = ergo_waitpofready; card->set_errlog_state = ergo_set_errlog_state; - card->irq_queue.sync = 0; - card->irq_queue.data = card; /* init task queue for interrupt */ - card->irq_queue.routine = (void *) (void *) ergo_irq_bh; + INIT_WORK(&card->irq_queue, (void *) (void *) ergo_irq_bh, card); return (0); } /* ergo_inithardware */ diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index 0c828f7c9b49..dd3860405be2 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c @@ -131,8 +131,7 @@ hycapi_sendmsg_internal(struct capi_ctr *ctrl, struct sk_buff *skb) } cinfo->tx_skb = skb; spin_unlock_irq(&cinfo->lock); - queue_task(&card->irq_queue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->irq_queue); } /*********************************************************** diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h index 0db4a0294379..ce411e38d11a 100644 --- a/drivers/isdn/hysdn/hysdn_defs.h +++ b/drivers/isdn/hysdn/hysdn_defs.h @@ -17,7 +17,7 @@ #include <linux/config.h> #include <linux/hysdn_if.h> #include <linux/interrupt.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/skbuff.h> /****************************/ @@ -173,7 +173,7 @@ typedef struct HYSDN_CARD { void (*set_errlog_state) (struct HYSDN_CARD *, int); /* interrupt handler + interrupt synchronisation */ - struct tq_struct irq_queue; /* interrupt task queue */ + struct work_struct irq_queue; /* interrupt task queue */ uchar volatile irq_enabled; /* interrupt enabled if != 0 */ uchar volatile hw_lock; /* hardware is currently locked -> no access */ diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c index cb49e9d41c5b..abfe601e9eea 100644 --- a/drivers/isdn/hysdn/hysdn_net.c +++ b/drivers/isdn/hysdn/hysdn_net.c @@ -169,8 +169,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev) spin_unlock_irq(&lp->lock); if (lp->sk_count <= 3) { - queue_task(&((hysdn_card *) dev->priv)->irq_queue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&((hysdn_card *) dev->priv)->irq_queue); } return (0); /* success */ } /* net_send_packet */ diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index 1586fcaf0308..1a2015ecfda5 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c @@ -175,8 +175,7 @@ hysdn_tx_cfgline(hysdn_card * card, uchar * line, word chan) card->async_busy = 1; /* request transfer */ /* now queue the task */ - queue_task(&card->irq_queue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->irq_queue); sti(); if (card->debug_flags & LOG_SCHED_ASYN) diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 3f0ed3f65896..a64b0e3d8b6f 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -161,8 +161,7 @@ static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp) if (!(isdn_net_device_busy(lp))) { if (!skb_queue_empty(&lp->super_tx_queue)) { - queue_task(&lp->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&lp->tqueue); } else { isdn_net_device_wake_queue(lp); } @@ -852,8 +851,7 @@ void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb) // we can't grab the lock from irq context, // so we just queue the packet skb_queue_tail(&lp->super_tx_queue, skb); - queue_task(&lp->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&lp->tqueue); return; } @@ -1595,9 +1593,7 @@ isdn_net_new(char *name, struct net_device *master) netdev->local.netdev = netdev; netdev->local.next = &netdev->local; - netdev->local.tqueue.sync = 0; - netdev->local.tqueue.routine = isdn_net_softint; - netdev->local.tqueue.data = &netdev->local; + INIT_WORK(&netdev->local.tqueue, isdn_net_softint, &netdev->local); spin_lock_init(&netdev->local.xmit_lock); netdev->isdn_slot = -1; diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 2e06c1627bd2..eb7fb2f0ca00 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -101,7 +101,7 @@ isdn_tty_try_read(modem_info * info, struct sk_buff *skb) #endif if (info->emu.mdmreg[REG_CPPP] & BIT_CPPP) tty->flip.flag_buf_ptr[len - 1] = 0xff; - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); kfree_skb(skb); return 1; } @@ -153,7 +153,7 @@ isdn_tty_readmodem(void) tty->flip.flag_buf_ptr += r; tty->flip.char_buf_ptr += r; if (r) - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); restore_flags(flags); } } else @@ -2498,7 +2498,7 @@ isdn_tty_at_cout(char *msg, modem_info * info) } else { restore_flags(flags); - queue_task(&tty->flip.tqueue, &tq_timer); + schedule_delayed_work(&tty->flip.work, 1); } } diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 617f953a3944..0379424b6d35 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -130,9 +130,7 @@ int pcbit_init_dev(int board, int mem_base, int irq) memset(dev->b2, 0, sizeof(struct pcbit_chan)); dev->b2->id = 1; - dev->qdelivery.sync = 0; - dev->qdelivery.routine = pcbit_deliver; - dev->qdelivery.data = dev; + INIT_WORK(&dev->qdelivery, pcbit_deliver, dev); /* * interrupts diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c index de23be7edd6c..007de8a05e2d 100644 --- a/drivers/isdn/pcbit/layer2.c +++ b/drivers/isdn/pcbit/layer2.c @@ -30,7 +30,7 @@ #include <linux/types.h> #include <linux/slab.h> #include <linux/interrupt.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/mm.h> #include <linux/skbuff.h> @@ -81,8 +81,7 @@ static void pcbit_firmware_bug(struct pcbit_dev *dev); static __inline__ void pcbit_sched_delivery(struct pcbit_dev *dev) { - queue_task(&dev->qdelivery, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&dev->qdelivery); } diff --git a/drivers/isdn/pcbit/pcbit.h b/drivers/isdn/pcbit/pcbit.h index c10e79a4251f..b9c02c7dbcb3 100644 --- a/drivers/isdn/pcbit/pcbit.h +++ b/drivers/isdn/pcbit/pcbit.h @@ -12,7 +12,7 @@ #ifndef PCBIT_H #define PCBIT_H -#include <linux/tqueue.h> +#include <linux/workqueue.h> #define MAX_PCBIT_CARDS 4 @@ -74,7 +74,7 @@ struct pcbit_dev { struct timer_list error_recover_timer; - struct tq_struct qdelivery; + struct work_struct qdelivery; u_char w_busy; u_char r_busy; diff --git a/drivers/isdn/tpam/tpam.h b/drivers/isdn/tpam/tpam.h index 56d7d3fb569c..b57937badc9f 100644 --- a/drivers/isdn/tpam/tpam.h +++ b/drivers/isdn/tpam/tpam.h @@ -16,7 +16,7 @@ #include <linux/isdnif.h> #include <linux/init.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> /* Maximum number of channels for this board */ #define TPAM_NBCHANNEL 30 @@ -86,8 +86,8 @@ typedef struct tpam_card { int roundrobin; /* round robin between channels */ struct sk_buff_head sendq; /* send queue */ struct sk_buff_head recvq; /* receive queue */ - struct tq_struct send_tq; /* send task queue */ - struct tq_struct recv_tq; /* receive task queue */ + struct work_struct send_tq; /* send task queue */ + struct work_struct recv_tq; /* receive task queue */ spinlock_t lock; /* lock for the card */ } tpam_card; diff --git a/drivers/isdn/tpam/tpam_main.c b/drivers/isdn/tpam/tpam_main.c index 172df397b366..15e453057f21 100644 --- a/drivers/isdn/tpam/tpam_main.c +++ b/drivers/isdn/tpam/tpam_main.c @@ -176,10 +176,8 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id card->loopmode = 0; skb_queue_head_init(&card->sendq); skb_queue_head_init(&card->recvq); - card->recv_tq.routine = (void *) (void *) tpam_recv_tq; - card->recv_tq.data = card; - card->send_tq.routine = (void *) (void *) tpam_send_tq; - card->send_tq.data = card; + INIT_WORK(&card->recv_tq, (void *) (void *) tpam_recv_tq, card); + INIT_WORK(&card->send_tq, (void *) (void *) tpam_send_tq, card); /* add the board at the end of the list of boards */ card->next = NULL; diff --git a/drivers/isdn/tpam/tpam_queues.c b/drivers/isdn/tpam/tpam_queues.c index 97dfe0286b8a..63bef59a70ca 100644 --- a/drivers/isdn/tpam/tpam_queues.c +++ b/drivers/isdn/tpam/tpam_queues.c @@ -13,7 +13,7 @@ #include <linux/pci.h> #include <linux/sched.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <asm/io.h> @@ -36,8 +36,7 @@ void tpam_enqueue(tpam_card *card, struct sk_buff *skb) { skb_queue_tail(&card->sendq, skb); /* queue the board's send task struct for immediate treatment */ - queue_task(&card->send_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->send_tq); } /* @@ -58,8 +57,7 @@ void tpam_enqueue_data(tpam_channel *channel, struct sk_buff *skb) { skb_queue_tail(&channel->sendq, skb); /* queue the channel's send task struct for immediate treatment */ - queue_task(&channel->card->send_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&channel->card->send_tq); } /* @@ -169,8 +167,7 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) { else { /* put the message in the receive queue */ skb_queue_tail(&card->recvq, skb); - queue_task(&card->recv_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->recv_tq); } return; } @@ -187,8 +184,7 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) { spin_unlock(&card->lock); /* schedule the send queue for execution */ - queue_task(&card->send_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&card->send_tq); return; } diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c index 4f596012cd53..6202b39265b0 100644 --- a/drivers/media/video/cpia_pp.c +++ b/drivers/media/video/cpia_pp.c @@ -32,7 +32,7 @@ #include <linux/parport.h> #include <linux/interrupt.h> #include <linux/delay.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/smp_lock.h> #include <linux/kmod.h> @@ -137,7 +137,7 @@ static int parport_ptr = 0; struct pp_cam_entry { struct pardevice *pdev; struct parport *port; - struct tq_struct cb_task; + struct work_struct cb_task; int open_count; wait_queue_head_t wq_stream; /* image state flags */ @@ -518,8 +518,7 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo int retval = 0; if(cam->port->irq != PARPORT_IRQ_NONE) { - cam->cb_task.routine = cb; - cam->cb_task.data = cbdata; + INIT_WORK(&cam->cb_task, cb, cbdata); } else { retval = -1; } diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index f4484ed7ef37..8d3e9a9284bf 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c @@ -132,7 +132,7 @@ struct mpt_lan_priv { u32 total_received; struct net_device_stats stats; /* Per device statistics */ - struct tq_struct post_buckets_task; + struct work_struct post_buckets_task; unsigned long post_buckets_active; }; @@ -876,10 +876,9 @@ mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority) if (test_and_set_bit(0, &priv->post_buckets_active) == 0) { if (priority) { - queue_task(&priv->post_buckets_task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&priv->post_buckets_task); } else { - queue_task(&priv->post_buckets_task, &tq_timer); + schedule_delayed_work(&priv->post_buckets_task, 1); dioprintk((KERN_INFO MYNAM ": post_buckets queued on " "timer.\n")); } @@ -1365,9 +1364,8 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) priv->mpt_dev = mpt_dev; priv->pnum = pnum; - memset(&priv->post_buckets_task, 0, sizeof(struct tq_struct)); - priv->post_buckets_task.routine = mpt_lan_post_receive_buckets; - priv->post_buckets_task.data = dev; + memset(&priv->post_buckets_task, 0, sizeof(struct work_struct)); + INIT_WORK(&priv->post_buckets_task, mpt_lan_post_receive_buckets, dev); priv->post_buckets_active = 0; dlprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n", diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index bc0403f85849..63a8ae08a703 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -76,6 +76,7 @@ #include <linux/delay.h> /* for mdelay */ #include <linux/interrupt.h> /* needed for in_interrupt() proto */ #include <linux/reboot.h> /* notifier code */ +#include <linux/workqueue.h> #include "../../scsi/scsi.h" #include "../../scsi/hosts.h" #include "../../scsi/sd.h" @@ -244,7 +245,7 @@ static struct proc_dir_entry proc_mpt_scsihost = */ static spinlock_t mytaskQ_lock = SPIN_LOCK_UNLOCKED; static int mytaskQ_bh_active = 0; -static struct tq_struct mptscsih_ptaskfoo; +static struct work_struct mptscsih_ptaskfoo; static atomic_t mpt_taskQdepth; #endif @@ -255,7 +256,7 @@ static atomic_t mpt_taskQdepth; static spinlock_t dvtaskQ_lock = SPIN_LOCK_UNLOCKED; static int dvtaskQ_active = 0; static int dvtaskQ_release = 0; -static struct tq_struct mptscsih_dvTask; +static struct work_struct mptscsih_dvTask; #endif /* @@ -2019,10 +2020,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) if (!dvtaskQ_active) { dvtaskQ_active = 1; spin_unlock_irqrestore(&dvtaskQ_lock, lflags); - mptscsih_dvTask.sync = 0; - mptscsih_dvTask.routine = mptscsih_domainValidation; - mptscsih_dvTask.data = (void *) hd; - + INIT_WORK(&mptscsih_dvTask, mptscsih_domainValidation, (void *) hd); SCHEDULE_TASK(&mptscsih_dvTask); } else { spin_unlock_irqrestore(&dvtaskQ_lock, lflags); @@ -3048,7 +3046,7 @@ mptscsih_old_abort(Scsi_Cmnd *SCpnt) { MPT_SCSI_HOST *hd; MPT_FRAME_HDR *mf; - struct tq_struct *ptaskfoo; + struct work_struct *ptaskfoo; unsigned long flags; int scpnt_idx; @@ -3156,7 +3154,7 @@ mptscsih_old_abort(Scsi_Cmnd *SCpnt) * Oh how cute, no alloc/free/mgmt needed if we use * (bottom/unused portion of) MPT request frame. */ - ptaskfoo = (struct tq_struct *) &mptscsih_ptaskfoo; + ptaskfoo = (struct work_struct *) &mptscsih_ptaskfoo; ptaskfoo->sync = 0; ptaskfoo->routine = mptscsih_taskmgmt_bh; ptaskfoo->data = SCpnt; @@ -3184,7 +3182,7 @@ mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) { MPT_SCSI_HOST *hd; MPT_FRAME_HDR *mf; - struct tq_struct *ptaskfoo; + struct work_struct *ptaskfoo; unsigned long flags; int scpnt_idx; @@ -3286,7 +3284,7 @@ mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) * Oh how cute, no alloc/free/mgmt needed if we use * (bottom/unused portion of) MPT request frame. */ - ptaskfoo = (struct tq_struct *) &mptscsih_ptaskfoo; + ptaskfoo = (struct work_struct *) &mptscsih_ptaskfoo; ptaskfoo->sync = 0; ptaskfoo->routine = mptscsih_taskmgmt_bh; ptaskfoo->data = SCpnt; diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 42f29799ce86..768f7e1ce70b 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h @@ -157,12 +157,11 @@ struct mptscsih_driver_setup #ifdef HAVE_TQ_SCHED #define SCHEDULE_TASK(x) \ /*MOD_INC_USE_COUNT*/; \ - (x)->next = NULL; \ - queue_task(x, &tq_scheduler) + schedule_work(x) #else #define SCHEDULE_TASK(x) \ /*MOD_INC_USE_COUNT*/; \ - if (schedule_task(x) == 0) { \ + if (schedule_work(x) == 0) { \ /*MOD_DEC_USE_COUNT*/; \ } #endif diff --git a/drivers/message/i2o/i2o_lan.c b/drivers/message/i2o/i2o_lan.c index 7b117be03ad1..5e19d5388d63 100644 --- a/drivers/message/i2o/i2o_lan.c +++ b/drivers/message/i2o/i2o_lan.c @@ -43,7 +43,7 @@ #include <linux/slab.h> #include <linux/init.h> #include <linux/spinlock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/io.h> #include <linux/errno.h> @@ -116,11 +116,8 @@ static struct i2o_handler i2o_lan_handler = { }; static int lan_context; -DECLARE_TASK_QUEUE(i2o_post_buckets_task); -struct tq_struct run_i2o_post_buckets_task = { - routine: (void (*)(void *)) run_task_queue, - data: (void *) 0 -}; +struct DECLARE_WORK(run_i2o_post_buckets_task, + (void (*)(void *)) run_task_queue, NULL); /* Functions to handle message failures and transaction errors: ==============================================================*/ @@ -386,8 +383,7 @@ static void i2o_lan_receive_post_reply(struct i2o_handler *h, if (atomic_read(&priv->buckets_out) <= priv->max_buckets_out - priv->bucket_thresh) { run_i2o_post_buckets_task.data = (void *)dev; - queue_task(&run_i2o_post_buckets_task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&run_i2o_post_buckets_task); } return; @@ -908,7 +904,7 @@ static int i2o_lan_sdu_send(struct sk_buff *skb, struct net_device *dev) if ((priv->tx_batch_mode & 0x01) && !priv->send_active) { priv->send_active = 1; MOD_INC_USE_COUNT; - if (schedule_task(&priv->i2o_batch_send_task) == 0) + if (schedule_work(&priv->i2o_batch_send_task) == 0) MOD_DEC_USE_COUNT; } } else { /* Add new SGL element to the previous message frame */ @@ -996,7 +992,7 @@ static int i2o_lan_packet_send(struct sk_buff *skb, struct net_device *dev) if ((priv->tx_batch_mode & 0x01) && !priv->send_active) { priv->send_active = 1; MOD_INC_USE_COUNT; - if (schedule_task(&priv->i2o_batch_send_task) == 0) + if (schedule_work(&priv->i2o_batch_send_task) == 0) MOD_DEC_USE_COUNT; } } else { /* Add new SGL element to the previous message frame */ @@ -1409,8 +1405,8 @@ struct net_device *i2o_lan_register_device(struct i2o_device *i2o_dev) INIT_LIST_HEAD(&priv->i2o_batch_send_task.list); priv->i2o_batch_send_task.sync = 0; - priv->i2o_batch_send_task.routine = (void *)i2o_lan_batch_send; - priv->i2o_batch_send_task.data = (void *)dev; + INIT_WORK(&priv->i2o_batch_send_task, (void *)i2o_lan_batch_send, + (void *)dev); dev->open = i2o_lan_open; dev->stop = i2o_lan_close; diff --git a/drivers/message/i2o/i2o_lan.h b/drivers/message/i2o/i2o_lan.h index 075f6438d4e7..561d63304d7e 100644 --- a/drivers/message/i2o/i2o_lan.h +++ b/drivers/message/i2o/i2o_lan.h @@ -136,7 +136,7 @@ struct i2o_lan_local { u8 sgl_max; /* max SGLs in one message frame */ u32 m; /* IOP address of the batch msg frame */ - struct tq_struct i2o_batch_send_task; + struct work_struct i2o_batch_send_task; int send_active; struct sk_buff **i2o_fbl; /* Free bucket list (to reuse skbs) */ int i2o_fbl_tail; diff --git a/drivers/net/aironet4500.h b/drivers/net/aironet4500.h index 24eebfa6ecca..cd4ad8052bed 100644 --- a/drivers/net/aironet4500.h +++ b/drivers/net/aironet4500.h @@ -1478,8 +1478,8 @@ struct awc_private { u8 link_status_changed; volatile int ejected; - volatile int bh_running; - volatile int bh_active; + volatile int work_running; + volatile int work_active; volatile long tx_chain_active; volatile u16 enabled_interrupts; volatile u16 waiting_interrupts; @@ -1499,7 +1499,7 @@ struct awc_private { struct awc_command cmd; long long async_command_start; volatile int command_semaphore_on; - struct tq_struct immediate_bh; + struct work_struct work; volatile int process_tx_results; u8 p2p[6]; @@ -1559,7 +1559,7 @@ extern int awc_receive_packet(struct net_device * dev); extern int awc_transmit_packet(struct net_device * dev, struct awc_fid * tx_buff) ; extern int awc_tx_complete_check(struct net_device * dev); extern int awc_interrupt_process(struct net_device * dev); -extern void awc_bh(struct net_device *dev); +extern void awc_work(struct net_device *dev); extern int awc_802_11_find_copy_path(struct net_device * dev, struct awc_fid * rx_buff); extern void awc_802_11_router_rx(struct net_device * dev,struct awc_fid * rx_buff); extern int awc_802_11_tx_find_path_and_post(struct net_device * dev, struct sk_buff * skb); diff --git a/drivers/net/aironet4500_core.c b/drivers/net/aironet4500_core.c index 5fce5b5722ba..582f09c0994f 100644 --- a/drivers/net/aironet4500_core.c +++ b/drivers/net/aironet4500_core.c @@ -22,7 +22,7 @@ #include <linux/init.h> #include <linux/config.h> #include <linux/kernel.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> @@ -2202,10 +2202,9 @@ awc_tx_complete_check(struct net_device * dev){ #define AWC_QUEUE_BH {\ - if (!priv->bh_active && !priv->bh_running){\ - priv->bh_active = 1;\ - queue_task(&priv->immediate_bh, &tq_immediate);\ - mark_bh(IMMEDIATE_BH);\ + if (!priv->work_active && !priv->work_running){\ + priv->work_active = 1;\ + schedule_work(&priv->work); \ }\ } @@ -2223,7 +2222,7 @@ awc_bh(struct net_device *dev){ DEBUG(8, "awc_bh awoken on jiffie %ld \n",jiffies); - priv->bh_running = 1; + priv->work_running = 1; active_interrupts = awc_event_status(dev->base_addr); @@ -2233,7 +2232,7 @@ awc_bh(struct net_device *dev){ if (test_and_set_bit( 0, (void *) &priv->tx_chain_active) ) { // printk(KERN_ERR "tx chain active in bh \n"); -// queue_task(&priv->immediate_bh, &tq_immediate); +// schedule_work(&priv->work); goto bad_end; } start: @@ -2281,8 +2280,8 @@ start: goto start; } }; - priv->bh_active = 0; - priv->bh_running = 0; + priv->work_active = 0; + priv->work_running = 0; priv->tx_chain_active = 0; @@ -2292,8 +2291,8 @@ start: // if (!priv->tx_chain_active) // wake_up(&priv->tx_chain_wait_queue); - priv->bh_running = 0; - priv->bh_active = 0; + priv->work_running = 0; + priv->work_active = 0; return ; }; @@ -2366,7 +2365,7 @@ start: //priv-> netif_device_detach (dev); priv->ejected = 1; - if (priv->bh_active || priv->bh_running){ + if (priv->work_active || priv->work_running){ priv->interrupt_count--; goto bad_end; } else if (priv->command_semaphore_on){ @@ -2498,8 +2497,8 @@ start: active_interrupts = awc_event_status(dev->base_addr); if ((active_interrupts & 0x7) && - !priv->bh_active && - !priv->bh_running ){ + !priv->work_active && + !priv->work_running ){ if (multi_ints++ < 5) goto start; } @@ -2874,12 +2873,9 @@ int awc_private_init(struct net_device * dev){ priv->command_semaphore_on = 0; priv->unlock_command_postponed = 0; - INIT_LIST_HEAD(&priv->immediate_bh.list); - priv->immediate_bh.sync = 0; - priv->immediate_bh.routine = (void *)(void *)awc_bh; - priv->immediate_bh.data = dev; - priv->bh_running = 0; - priv->bh_active = 0; + INIT_WORK(&priv->work, (void *)(void *)awc_work, dev); + priv->work_running = 0; + priv->work_active = 0; priv->tx_chain_active = 0; priv->enabled_interrupts= 0x00; priv->waiting_interrupts= 0x00; diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index a02b35e62de4..5919a1f38666 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -64,7 +64,7 @@ #include <linux/list.h> #include <linux/reboot.h> #include <net/checksum.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/ethtool.h> #include <linux/if_vlan.h> @@ -160,7 +160,7 @@ struct e1000_adapter { uint16_t link_duplex; spinlock_t stats_lock; atomic_t irq_sem; - struct tq_struct tx_timeout_task; + struct work_struct tx_timeout_task; struct timer_list blink_timer; unsigned long led_status; diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index be54e2b9414a..ed1826de999b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -470,7 +470,7 @@ e1000_probe(struct pci_dev *pdev, adapter->phy_info_timer.function = &e1000_update_phy_info; adapter->phy_info_timer.data = (unsigned long) adapter; - INIT_TQUEUE(&adapter->tx_timeout_task, + INIT_WORK(&adapter->tx_timeout_task, (void (*)(void *))e1000_tx_timeout_task, netdev); register_netdev(netdev); @@ -1542,7 +1542,7 @@ e1000_tx_timeout(struct net_device *netdev) struct e1000_adapter *adapter = netdev->priv; /* Do the reset outside of interrupt context */ - schedule_task(&adapter->tx_timeout_task); + schedule_work(&adapter->tx_timeout_task); } static void diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index d43905dea4cc..fc9e7482f38b 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -45,7 +45,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/string.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/fs.h> #include <linux/parport.h> #include <linux/smp_lock.h> @@ -194,8 +194,8 @@ struct baycom_state { int magic; struct pardevice *pdev; - unsigned int bh_running; - struct tq_struct run_bh; + unsigned int work_running; + struct work_struct run_work; unsigned int modem; unsigned int bitrate; unsigned char stat; @@ -829,7 +829,7 @@ static void epp_bh(struct net_device *dev) baycom_paranoia_check_void(dev, "epp_bh"); bc = (struct baycom_state *)dev->priv; - if (!bc->bh_running) + if (!bc->work_running) return; baycom_int_freq(bc); pp = bc->pdev->port; @@ -928,7 +928,7 @@ static void epp_bh(struct net_device *dev) bc->debug_vals.mod_cycles = time2 - time1; bc->debug_vals.demod_cycles = time3 - time2; #endif /* BAYCOM_DEBUG */ - queue_task(&bc->run_bh, &tq_timer); + schedule_delayed_work(&bc->run_work, 1); if (!bc->skb) netif_wake_queue(dev); return; @@ -1019,10 +1019,6 @@ static int epp_open(struct net_device *dev) { struct baycom_state *bc; struct parport *pp; - const struct tq_struct run_bh = { - .routine = (void *)(void *)epp_bh, - .data = dev - }; unsigned int i, j; unsigned char tmp[128]; unsigned char stat; @@ -1060,8 +1056,8 @@ static int epp_open(struct net_device *dev) return -EBUSY; } dev->irq = /*pp->irq*/ 0; - bc->run_bh = run_bh; - bc->bh_running = 1; + INIT_WORK(&bc->run_work, (void *)(void *)epp_bh, dev); + bc->work_running = 1; bc->modem = EPP_CONVENTIONAL; if (eppconfig(bc)) printk(KERN_INFO "%s: no FPGA detected, assuming conventional EPP modem\n", bc_drvname); @@ -1121,7 +1117,7 @@ static int epp_open(struct net_device *dev) bc->hdlctx.slotcnt = bc->ch_params.slottime; bc->hdlctx.calibrate = 0; /* start the bottom half stuff */ - queue_task(&bc->run_bh, &tq_timer); + schedule_delayed_work(&bc->run_work, 1); netif_start_queue(dev); MOD_INC_USE_COUNT; return 0; @@ -1145,8 +1141,8 @@ static int epp_close(struct net_device *dev) baycom_paranoia_check(dev, "epp_close", -EINVAL); bc = (struct baycom_state *)dev->priv; pp = bc->pdev->port; - bc->bh_running = 0; - run_task_queue(&tq_timer); /* dequeue bottom half */ + bc->work_running = 0; + flush_scheduled_work(); bc->stat = EPP_DCDBIT; tmp[0] = 0; pp->ops->epp_write_addr(pp, tmp, 1, 0); diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index fbdd9aee23ee..551d06f46d4d 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c @@ -36,7 +36,7 @@ #include <linux/netdevice.h> #include <linux/rtnetlink.h> #include <linux/sockios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/version.h> #include <asm/atomic.h> #include <asm/bitops.h> @@ -225,7 +225,7 @@ struct scc_priv { char rx_buf[NUM_RX_BUF][BUF_SIZE]; int rx_len[NUM_RX_BUF]; int rx_ptr; - struct tq_struct rx_task; + struct work_struct rx_work; int rx_head, rx_tail, rx_count; int rx_over; char tx_buf[NUM_TX_BUF][BUF_SIZE]; @@ -569,8 +569,7 @@ int __init setup_adapter(int card_base, int type, int n) { priv->param.clocks = TCTRxCP | RCRTxCP; priv->param.persist = 256; priv->param.dma = -1; - priv->rx_task.routine = rx_bh; - priv->rx_task.data = priv; + INIT_WORK(&priv->rx_work, rx_bh, priv); dev->priv = priv; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name; @@ -1072,9 +1071,7 @@ static void special_condition(struct scc_priv *priv, int rc) { priv->rx_len[priv->rx_head] = cb; priv->rx_head = (priv->rx_head + 1) % NUM_RX_BUF; priv->rx_count++; - /* Mark bottom half handler */ - queue_task(&priv->rx_task, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&priv->rx_work); } else { priv->stats.rx_errors++; priv->stats.rx_over_errors++; diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 59fe43aeece6..12cc2a667073 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -93,7 +93,7 @@ #include <linux/etherdevice.h> #include <linux/delay.h> #include <linux/smp_lock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/init.h> #include <linux/ip.h> /* for iph */ #include <linux/in.h> /* for IPPROTO_... */ @@ -411,7 +411,7 @@ struct ns83820 { struct tasklet_struct rx_tasklet; unsigned ihr; - struct tq_struct tq_refill; + struct work_struct tq_refill; /* protects everything below. irqsave when using. */ spinlock_t misc_lock; @@ -784,7 +784,7 @@ static void ns83820_rx_kick(struct ns83820 *dev) } if (dev->rx_info.up && nr_rx_empty(dev) > NR_RX_DESC*3/4) - schedule_task(&dev->tq_refill); + schedule_work(&dev->tq_refill); else kick_rx(dev); if (dev->rx_info.idle) @@ -1438,7 +1438,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ dev->ee.lock = &dev->misc_lock; dev->net_dev.owner = THIS_MODULE; - PREPARE_TQUEUE(&dev->tq_refill, queue_refill, dev); + INIT_WORK(&dev->tq_refill, queue_refill, dev); tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)dev); err = pci_enable_device(pci_dev); diff --git a/drivers/net/plip.c b/drivers/net/plip.c index c3c6d7c51253..d82e8bcddb52 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -110,7 +110,7 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" #include <linux/if_plip.h> #include <net/neighbour.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/ioport.h> #include <linux/spinlock.h> #include <asm/bitops.h> @@ -211,9 +211,9 @@ struct plip_local { struct net_local { struct net_device_stats enet_stats; - struct tq_struct immediate; - struct tq_struct deferred; - struct tq_struct timer; + struct work_struct immediate; + struct work_struct deferred; + struct work_struct timer; struct plip_local snd_data; struct plip_local rcv_data; struct pardevice *pardev; @@ -348,22 +348,11 @@ plip_init_dev(struct net_device *dev, struct parport *pb) nl->nibble = PLIP_NIBBLE_WAIT; /* Initialize task queue structures */ - INIT_LIST_HEAD(&nl->immediate.list); - nl->immediate.sync = 0; - nl->immediate.routine = (void (*)(void *))plip_bh; - nl->immediate.data = dev; - - INIT_LIST_HEAD(&nl->deferred.list); - nl->deferred.sync = 0; - nl->deferred.routine = (void (*)(void *))plip_kick_bh; - nl->deferred.data = dev; - - if (dev->irq == -1) { - INIT_LIST_HEAD(&nl->timer.list); - nl->timer.sync = 0; - nl->timer.routine = (void (*)(void *))plip_timer_bh; - nl->timer.data = dev; - } + INIT_WORK(&nl->immediate, (void (*)(void *))plip_bh, dev); + INIT_WORK(&nl->deferred, (void (*)(void *))plip_kick_bh, dev); + + if (dev->irq == -1) + INIT_WORK(&nl->timer, (void (*)(void *))plip_timer_bh, dev); spin_lock_init(&nl->lock); @@ -378,10 +367,8 @@ plip_kick_bh(struct net_device *dev) { struct net_local *nl = (struct net_local *)dev->priv; - if (nl->is_deferred) { - queue_task(&nl->immediate, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } + if (nl->is_deferred) + schedule_work(&nl->immediate); } /* Forward declarations of internal routines */ @@ -432,7 +419,7 @@ plip_bh(struct net_device *dev) if ((r = (*f)(dev, nl, snd, rcv)) != OK && (r = plip_bh_timeout_error(dev, nl, snd, rcv, r)) != OK) { nl->is_deferred = 1; - queue_task(&nl->deferred, &tq_timer); + schedule_delayed_work(&nl->deferred, 1); } } @@ -444,7 +431,7 @@ plip_timer_bh(struct net_device *dev) if (!(atomic_read (&nl->kill_timer))) { plip_interrupt (-1, dev, NULL); - queue_task (&nl->timer, &tq_timer); + schedule_delayed_work(&nl->timer, 1); } else { up (&nl->killed_timer_sem); @@ -665,7 +652,7 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, rcv->state = PLIP_PK_DONE; nl->is_deferred = 1; nl->connection = PLIP_CN_SEND; - queue_task(&nl->deferred, &tq_timer); + schedule_delayed_work(&nl->deferred, 1); enable_parport_interrupts (dev); ENABLE(dev->irq); return OK; @@ -740,8 +727,7 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, if (snd->state != PLIP_PK_DONE) { nl->connection = PLIP_CN_SEND; spin_unlock_irq(&nl->lock); - queue_task(&nl->immediate, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&nl->immediate); enable_parport_interrupts (dev); ENABLE(dev->irq); return OK; @@ -909,7 +895,7 @@ plip_send_packet(struct net_device *dev, struct net_local *nl, printk(KERN_DEBUG "%s: send end\n", dev->name); nl->connection = PLIP_CN_CLOSING; nl->is_deferred = 1; - queue_task(&nl->deferred, &tq_timer); + schedule_delayed_work(&nl->deferred, 1); enable_parport_interrupts (dev); ENABLE(dev->irq); return OK; @@ -953,7 +939,7 @@ plip_error(struct net_device *dev, struct net_local *nl, netif_wake_queue (dev); } else { nl->is_deferred = 1; - queue_task(&nl->deferred, &tq_timer); + schedule_delayed_work(&nl->deferred, 1); } return OK; @@ -997,8 +983,7 @@ plip_interrupt(int irq, void *dev_id, struct pt_regs * regs) rcv->state = PLIP_PK_TRIGGER; nl->connection = PLIP_CN_RECEIVE; nl->timeout_count = 0; - queue_task(&nl->immediate, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&nl->immediate); break; case PLIP_CN_RECEIVE: @@ -1051,8 +1036,7 @@ plip_tx_packet(struct sk_buff *skb, struct net_device *dev) nl->connection = PLIP_CN_SEND; nl->timeout_count = 0; } - queue_task(&nl->immediate, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&nl->immediate); spin_unlock_irq(&nl->lock); return 0; @@ -1131,7 +1115,7 @@ plip_open(struct net_device *dev) if (dev->irq == -1) { atomic_set (&nl->kill_timer, 0); - queue_task (&nl->timer, &tq_timer); + schedule_delayed_work(&nl->timer, 1); } /* Initialize the state machine. */ diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 833ba7589044..81abde13491a 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -40,7 +40,7 @@ #include <linux/ethtool.h> #include <linux/crc32.h> #include <linux/random.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/system.h> #include <asm/bitops.h> @@ -584,7 +584,7 @@ static int gem_abnormal_irq(struct net_device *dev, struct gem *gp, u32 gem_stat do_reset: gp->reset_task_pending = 2; - schedule_task(&gp->reset_task); + schedule_work(&gp->reset_task); return 1; } @@ -821,7 +821,7 @@ static void gem_tx_timeout(struct net_device *dev) spin_lock_irq(&gp->lock); gp->reset_task_pending = 2; - schedule_task(&gp->reset_task); + schedule_work(&gp->reset_task); spin_unlock_irq(&gp->lock); } @@ -975,10 +975,10 @@ static int gem_change_mtu(struct net_device *dev, int new_mtu) spin_lock_irq(&gp->lock); dev->mtu = new_mtu; gp->reset_task_pending = 1; - schedule_task(&gp->reset_task); + schedule_work(&gp->reset_task); spin_unlock_irq(&gp->lock); - flush_scheduled_tasks(); + flush_scheduled_work(); return 0; } @@ -1384,7 +1384,7 @@ static void gem_link_timer(unsigned long data) printk(KERN_INFO "%s: Link down\n", gp->dev->name); gp->reset_task_pending = 2; - schedule_task(&gp->reset_task); + schedule_work(&gp->reset_task); restart = 1; } else if (++gp->timer_ticks > 10) restart = gem_mdio_link_not_up(gp); @@ -2299,7 +2299,7 @@ static void gem_pm_timer(unsigned long data) { struct gem *gp = (struct gem *) data; - schedule_task(&gp->pm_task); + schedule_work(&gp->pm_task); } static int gem_open(struct net_device *dev) @@ -2313,7 +2313,7 @@ static int gem_open(struct net_device *dev) /* Stop the PM timer/task */ del_timer(&gp->pm_timer); - flush_scheduled_tasks(); + flush_scheduled_work(); /* The power-management semaphore protects the hw_running * etc. state so it is safe to do this bit without gp->lock @@ -2445,7 +2445,7 @@ static int gem_suspend(struct pci_dev *pdev, u32 state) if (gp->hw_running) { /* Kill PM timer if any */ del_timer_sync(&gp->pm_timer); - flush_scheduled_tasks(); + flush_scheduled_work(); gem_shutdown(gp); } @@ -2955,8 +2955,8 @@ static int __devinit gem_init_one(struct pci_dev *pdev, gp->pm_timer.function = gem_pm_timer; gp->pm_timer.data = (unsigned long) gp; - INIT_TQUEUE(&gp->pm_task, gem_pm_task, gp); - INIT_TQUEUE(&gp->reset_task, gem_reset_task, gp); + INIT_WORK(&gp->pm_task, gem_pm_task, gp); + INIT_WORK(&gp->reset_task, gem_reset_task, gp); /* Default link parameters */ if (link_mode >= 0 && link_mode <= 6) @@ -3061,7 +3061,7 @@ err_out_iounmap: down(&gp->pm_sem); /* Stop the PM timer & task */ del_timer_sync(&gp->pm_timer); - flush_scheduled_tasks(); + flush_scheduled_work(); if (gp->hw_running) gem_shutdown(gp); up(&gp->pm_sem); @@ -3090,7 +3090,7 @@ static void __devexit gem_remove_one(struct pci_dev *pdev) down(&gp->pm_sem); /* Stop the PM timer & task */ del_timer_sync(&gp->pm_timer); - flush_scheduled_tasks(); + flush_scheduled_work(); if (gp->hw_running) gem_shutdown(gp); up(&gp->pm_sem); diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h index d26652f9d64e..fa113a607ce1 100644 --- a/drivers/net/sungem.h +++ b/drivers/net/sungem.h @@ -967,7 +967,7 @@ struct gem { int hw_running; int opened; struct semaphore pm_sem; - struct tq_struct pm_task; + struct work_struct pm_task; struct timer_list pm_timer; struct gem_init_block *init_block; @@ -999,7 +999,7 @@ struct gem { struct timer_list link_timer; int timer_ticks; int wake_on_lan; - struct tq_struct reset_task; + struct work_struct reset_task; volatile int reset_task_pending; /* Diagnostic counters and state. */ diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index beddfceb5e1d..0521aee7e66c 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c @@ -174,7 +174,7 @@ #include <linux/etherdevice.h> #include <linux/delay.h> #include <linux/spinlock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/mii.h> #include "tlan.h" @@ -600,10 +600,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, /* This will be used when we get an adapter error from * within our irq handler */ - INIT_LIST_HEAD(&priv->tlan_tqueue.list); - priv->tlan_tqueue.sync = 0; - priv->tlan_tqueue.routine = (void *)(void*)TLan_tx_timeout; - priv->tlan_tqueue.data = dev; + INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev); spin_lock_init(&priv->lock); @@ -1708,7 +1705,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) TLan_ReadAndClearStats( dev, TLAN_RECORD ); outl( TLAN_HC_AD_RST, dev->base_addr + TLAN_HOST_CMD ); - schedule_task(&priv->tlan_tqueue); + schedule_work(&priv->tlan_tqueue); netif_wake_queue(dev); ack = 0; diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h index 24431f0a9a46..b3c0e4a67a34 100644 --- a/drivers/net/tlan.h +++ b/drivers/net/tlan.h @@ -208,7 +208,7 @@ typedef struct tlan_private_tag { spinlock_t lock; u8 link; u8 is_eisa; - struct tq_struct tlan_tqueue; + struct work_struct tlan_tqueue; u8 neg_be_verbose; } TLanPrivateInfo; diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c index 2bd5d955552c..2dfa52eafa92 100644 --- a/drivers/net/wan/lmc/lmc_proto.c +++ b/drivers/net/wan/lmc/lmc_proto.c @@ -44,7 +44,7 @@ #include <linux/skbuff.h> #include <net/syncppp.h> #include <linux/inet.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/proc_fs.h> #include "lmc_ver.h" diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index a2cfea933ca2..684797d2890c 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c @@ -106,8 +106,8 @@ typedef struct _st_cpc_tty_area { pc300dev_t* pc300dev; /* ptr. to info struct in PC300 driver */ unsigned char name[20]; /* interf. name + "-tty" */ struct tty_struct *tty; - struct tq_struct tty_tx_task_queue; /* tx task - tx interrupt */ - struct tq_struct tty_rx_task_queue; /* rx task - rx interrupt */ + struct work_struct tty_tx_work; /* tx work - tx interrupt */ + struct work_struct tty_rx_work; /* rx work - rx interrupt */ } st_cpc_tty_area; /* TTY data structures */ @@ -134,8 +134,8 @@ static int cpc_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); static void cpc_tty_flush_buffer(struct tty_struct *tty); static void cpc_tty_hangup(struct tty_struct *tty); -static void cpc_tty_rx_task(void *data); -static void cpc_tty_tx_task(void *data); +static void cpc_tty_rx_work(void *data); +static void cpc_tty_tx_work(void *data); static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); static void cpc_tty_dtr_off(pc300dev_t *pc300dev); @@ -288,12 +288,9 @@ void cpc_tty_init(pc300dev_t *pc300dev) cpc_tty->num_open= 0; cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; cpc_tty->pc300dev = pc300dev; - - cpc_tty->tty_tx_task_queue.routine = cpc_tty_tx_task; - cpc_tty->tty_tx_task_queue.data = (void *)cpc_tty; - - cpc_tty->tty_rx_task_queue.routine = cpc_tty_rx_task; - cpc_tty->tty_rx_task_queue.data = (void *) port; + + INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty); + INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port); cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = 0; @@ -706,13 +703,13 @@ static void cpc_tty_hangup(struct tty_struct *tty) } /* - * PC300 TTY RX task routine - * This routine treats RX task + * PC300 TTY RX work routine + * This routine treats RX work * o verify read buffer * o call the line disc. read * o free memory */ -static void cpc_tty_rx_task(void * data) +static void cpc_tty_rx_work(void * data) { int port, i, j; st_cpc_tty_area *cpc_tty; @@ -745,7 +742,7 @@ static void cpc_tty_rx_task(void * data) } /* - * PC300 TTY RX task routine + * PC300 TTY RX work routine * * This routine treats RX interrupt. * o read all frames in card @@ -912,25 +909,25 @@ void cpc_tty_receive(pc300dev_t *pc300dev) cpc_tty->buf_rx.last->next = new; cpc_tty->buf_rx.last = new; } - schedule_task(&(cpc_tty->tty_rx_task_queue)); + schedule_work(&(cpc_tty->tty_rx_work)); stats->rx_packets++; } } } /* - * PC300 TTY TX task routine + * PC300 TTY TX work routine * * This routine treats TX interrupt. * o if need call line discipline wakeup * o call wake_up_interruptible */ -static void cpc_tty_tx_task(void *data) +static void cpc_tty_tx_work(void *data) { st_cpc_tty_area *cpc_tty = (st_cpc_tty_area *) data; struct tty_struct *tty; - CPC_TTY_DBG("%s: cpc_tty_tx_task init\n",cpc_tty->name); + CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); if ((tty = cpc_tty->tty) == 0) { CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); @@ -1124,7 +1121,7 @@ void cpc_tty_trigger_poll(pc300dev_t *pc300dev) if (!cpc_tty) { return; } - schedule_task(&(cpc_tty->tty_tx_task_queue)); + schedule_work(&(cpc_tty->tty_tx_work)); } /* diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c index 1797b6df2c1e..37ebe5c32377 100644 --- a/drivers/net/wan/sdla_chdlc.c +++ b/drivers/net/wan/sdla_chdlc.c @@ -163,10 +163,10 @@ typedef struct chdlc_private_area unsigned char interface_down; - /* Polling task queue. Each interface - * has its own task queue, which is used + /* Polling work queue entry. Each interface + * has its own work queue entry, which is used * to defer events from the interrupt */ - struct tq_struct poll_task; + struct work_struct poll_work; struct timer_list poll_delay_timer; u8 gateway; @@ -262,8 +262,8 @@ static void timer_intr(sdla_t *); #if defined(LINUX_2_1) || defined(LINUX_2_4) /* Bottom half handlers */ - static void chdlc_bh (netdevice_t *); - static int chdlc_bh_cleanup (netdevice_t *); + static void chdlc_work (netdevice_t *); + static int chdlc_work_cleanup (netdevice_t *); static int bh_enqueue (netdevice_t *, struct sk_buff *); #endif @@ -930,13 +930,8 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf) dev->init = &if_init; dev->priv = chdlc_priv_area; - /* Initialize the polling task routine */ -#ifndef LINUX_2_4 - chdlc_priv_area->poll_task.next = NULL; -#endif - chdlc_priv_area->poll_task.sync=0; - chdlc_priv_area->poll_task.routine = (void*)(void*)chdlc_poll; - chdlc_priv_area->poll_task.data = dev; + /* Initialize the polling work routine */ + INIT_WORK(&chdlc_priv_area->poll_work, (void*)(void*)chdlc_poll, dev); /* Initialize the polling delay timer */ init_timer(&chdlc_priv_area->poll_delay_timer); @@ -1052,15 +1047,11 @@ static int if_open (netdevice_t* dev) return -EBUSY; #if defined(LINUX_2_1) || defined(LINUX_2_4) - /* Initialize the task queue */ + /* Initialize the work queue entry */ chdlc_priv_area->tq_working=0; -#ifndef LINUX_2_4 - chdlc_priv_area->common.wanpipe_task.next = NULL; -#endif - chdlc_priv_area->common.wanpipe_task.sync = 0; - chdlc_priv_area->common.wanpipe_task.routine = (void *)(void *)chdlc_bh; - chdlc_priv_area->common.wanpipe_task.data = dev; + INIT_WORK(&chdlc_priv_area->common.wanpipe_work, + (void *)(void *)chdlc_work, dev); /* Allocate and initialize BH circular buffer */ /* Add 1 to MAX_BH_BUFF so we don't have test with (MAX_BH_BUFF-1) */ @@ -1863,7 +1854,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb) * PREPROCESSOR STATEMENT ABOVE, UNLESS YOU KNOW WHAT YOU ARE * DOING */ -static void chdlc_bh (netdevice_t * dev) +static void chdlc_work (netdevice_t * dev) { chdlc_private_area_t* chan = dev->priv; sdla_t *card = chan->card; @@ -1883,7 +1874,7 @@ static void chdlc_bh (netdevice_t * dev) if (chan->common.sk == NULL || chan->common.func == NULL){ ++card->wandev.stats.rx_dropped; wan_dev_kfree_skb(skb, FREE_READ); - chdlc_bh_cleanup(dev); + chdlc_work_cleanup(dev); continue; } @@ -1893,10 +1884,10 @@ static void chdlc_bh (netdevice_t * dev) atomic_set(&chan->common.receive_block,1); return; }else{ - chdlc_bh_cleanup(dev); + chdlc_work_cleanup(dev); } }else{ - chdlc_bh_cleanup(dev); + chdlc_work_cleanup(dev); } } clear_bit(0, &chan->tq_working); @@ -1904,7 +1895,7 @@ static void chdlc_bh (netdevice_t * dev) return; } -static int chdlc_bh_cleanup (netdevice_t *dev) +static int chdlc_work_cleanup (netdevice_t *dev) { chdlc_private_area_t* chan = dev->priv; @@ -2214,10 +2205,8 @@ static void rx_intr (sdla_t* card) bh_enqueue(dev, skb); - if (!test_and_set_bit(0,&chdlc_priv_area->tq_working)){ - wanpipe_queue_tq(&chdlc_priv_area->common.wanpipe_task); - wanpipe_mark_bh(); - } + if (!test_and_set_bit(0,&chdlc_priv_area->tq_working)) + wanpipe_queue_work(&chdlc_priv_area->common.wanpipe_work); #endif }else{ /* FIXME: we should check to see if the received packet is a @@ -3776,7 +3765,7 @@ static void chdlc_poll (netdevice_t *dev) * trigger_chdlc_poll * * Description: - * Add a chdlc_poll() task into a tq_scheduler bh handler + * Add a chdlc_poll() work entry into the keventd work queue * for a specific dlci/interface. This will kick * the fr_poll() routine at a later time. * @@ -3804,12 +3793,7 @@ static void trigger_chdlc_poll (netdevice_t *dev) if (test_bit(PERI_CRIT,&card->wandev.critical)){ return; } -#ifdef LINUX_2_4 - schedule_task(&chdlc_priv_area->poll_task); -#else - queue_task(&chdlc_priv_area->poll_task, &tq_scheduler); -#endif - return; + schedule_work(&chdlc_priv_area->poll_work); } @@ -3856,14 +3840,10 @@ static void wanpipe_tty_trigger_tx_irq(sdla_t *card) static void wanpipe_tty_trigger_poll(sdla_t *card) { -#ifdef LINUX_2_4 - schedule_task(&card->tty_task_queue); -#else - queue_task(&card->tty_task_queue, &tq_scheduler); -#endif + schedule_work(&card->tty_work); } -static void tty_poll_task (void* data) +static void tty_poll_work (void* data) { sdla_t *card = (sdla_t*)data; struct tty_struct *tty; @@ -4736,8 +4716,7 @@ int wanpipe_tty_init(sdla_t *card) state->icount.overrun = state->icount.brk = 0; state->irq = card->wandev.irq; - card->tty_task_queue.routine = tty_poll_task; - card->tty_task_queue.data = (void*)card; + INIT_WORK(&card->tty_work, tty_poll_work, (void*)card); return 0; } diff --git a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c index 3628ee4b7264..27f263e99765 100644 --- a/drivers/net/wan/sdla_ppp.c +++ b/drivers/net/wan/sdla_ppp.c @@ -220,10 +220,10 @@ typedef struct ppp_private_area unsigned long router_up_time; - /* Polling task queue. Each interface - * has its own task queue, which is used + /* Polling work queue entry. Each interface + * has its own work queue entry, which is used * to defer events from the interrupt */ - struct tq_struct poll_task; + struct work_struct poll_work; struct timer_list poll_delay_timer; u8 gateway; @@ -631,13 +631,8 @@ static int new_if(wan_device_t *wandev, netdevice_t *dev, wanif_conf_t *conf) dev->priv = ppp_priv_area; dev->mtu = min_t(unsigned int, dev->mtu, card->wandev.mtu); - /* Initialize the polling task routine */ -#ifndef LINUX_2_4 - ppp_priv_area->poll_task.next = NULL; -#endif - ppp_priv_area->poll_task.sync=0; - ppp_priv_area->poll_task.routine = (void*)(void*)ppp_poll; - ppp_priv_area->poll_task.data = dev; + /* Initialize the polling work routine */ + INIT_WORK(&ppp_priv_area->poll_work, (void*)(void*)ppp_poll, dev); /* Initialize the polling delay timer */ init_timer(&ppp_priv_area->poll_delay_timer); @@ -3667,11 +3662,7 @@ static void trigger_ppp_poll (netdevice_t *dev) return; } -#ifdef LINUX_2_4 - schedule_task(&ppp_priv_area->poll_task); -#else - queue_task(&ppp_priv_area->poll_task, &tq_scheduler); -#endif + schedule_work(&ppp_priv_area->poll_work); } return; } diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index ff39b528e64b..f991a6db13d4 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -32,7 +32,7 @@ #include <linux/timer.h> #include <linux/interrupt.h> #include <linux/in.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/io.h> #include <asm/system.h> #include <asm/bitops.h> @@ -999,17 +999,17 @@ struct airo_info { tdsRssiEntry *rssi; struct semaphore sem; struct task_struct *task; - struct tq_struct promisc_task; + struct work_struct promisc_task; struct { struct sk_buff *skb; int fid; - struct tq_struct task; + struct work_struct task; } xmit, xmit11; struct net_device *wifidev; #ifdef WIRELESS_EXT struct iw_statistics wstats; // wireless stats unsigned long scan_timestamp; /* Time started to scan */ - struct tq_struct event_task; + struct work_struct event_task; #ifdef WIRELESS_SPY int spy_number; u_char spy_address[IW_MAX_SPY][ETH_ALEN]; @@ -1019,7 +1019,7 @@ struct airo_info { /* MIC stuff */ mic_module mod[2]; mic_statistics micstats; - struct tq_struct mic_task; + struct work_struct mic_task; }; static inline int bap_read(struct airo_info *ai, u16 *pu16Dst, int bytelen, @@ -1318,7 +1318,7 @@ static void airo_do_xmit(struct net_device *dev) { netif_stop_queue(dev); priv->xmit.task.routine = (void (*)(void *))airo_do_xmit; priv->xmit.task.data = (void *)dev; - schedule_task(&priv->xmit.task); + schedule_work(&priv->xmit.task); return; } status = transmit_802_3_packet (priv, fids[fid], skb->data); @@ -1380,7 +1380,7 @@ static void airo_do_xmit11(struct net_device *dev) { netif_stop_queue(dev); priv->xmit11.task.routine = (void (*)(void *))airo_do_xmit11; priv->xmit11.task.data = (void *)dev; - schedule_task(&priv->xmit11.task); + schedule_work(&priv->xmit11.task); return; } status = transmit_802_11_packet (priv, fids[fid], skb->data); @@ -1466,7 +1466,7 @@ static void airo_end_promisc(struct airo_info *ai) { } else { ai->promisc_task.routine = (void (*)(void *))airo_end_promisc; ai->promisc_task.data = (void *)ai; - schedule_task(&ai->promisc_task); + schedule_work(&ai->promisc_task); } } @@ -1482,7 +1482,7 @@ static void airo_set_promisc(struct airo_info *ai) { } else { ai->promisc_task.routine = (void (*)(void *))airo_set_promisc; ai->promisc_task.data = (void *)ai; - schedule_task(&ai->promisc_task); + schedule_work(&ai->promisc_task); } } @@ -1550,7 +1550,7 @@ static void del_airo_dev( struct net_device *dev ); void stop_airo_card( struct net_device *dev, int freeres ) { struct airo_info *ai = dev->priv; - flush_scheduled_tasks(); + flush_scheduled_work(); if (ai->flash) kfree(ai->flash); if (ai->rssi) @@ -1814,7 +1814,7 @@ static void airo_send_event(struct net_device *dev) { } else { ai->event_task.routine = (void (*)(void *))airo_send_event; ai->event_task.data = (void *)dev; - schedule_task(&ai->event_task); + schedule_work(&ai->event_task); } } #endif @@ -1833,7 +1833,7 @@ static void airo_read_mic(struct airo_info *ai) { } else { ai->mic_task.routine = (void (*)(void *))airo_read_mic; ai->mic_task.data = (void *)ai; - schedule_task(&ai->mic_task); + schedule_work(&ai->mic_task); } } diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 22b17bbfc240..b6b85908e64c 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -323,7 +323,7 @@ * the card from hard sleep. * * v0.13beta1 -> v0.13 - 27 Sep 2002 - David Gibson - * o Re-introduced full resets (via schedule_task()) on Tx + * o Re-introduced full resets (via schedule_work()) on Tx * timeout. * * v0.13 -> v0.13a - 30 Sep 2002 - David Gibson @@ -378,7 +378,7 @@ #include <linux/if_arp.h> #include <linux/etherdevice.h> #include <linux/wireless.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include "hermes.h" #include "hermes_rid.h" @@ -889,7 +889,7 @@ static int orinoco_reconfigure(struct orinoco_private *priv) } /* This must be called from user context, without locks held - use - * schedule_task() */ + * schedule_work() */ static void orinoco_reset(struct net_device *dev) { struct orinoco_private *priv = dev->priv; @@ -2317,7 +2317,7 @@ orinoco_tx_timeout(struct net_device *dev) stats->tx_errors++; - schedule_task(&priv->timeout_task); + schedule_work(&priv->timeout_task); } static int @@ -3708,7 +3708,7 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name); - schedule_task(&priv->timeout_task); + schedule_work(&priv->timeout_task); break; case SIOCIWFIRSTPRIV + 0x2: /* set_port3 */ @@ -4241,7 +4241,7 @@ struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct or priv->hw_unavailable = 1; /* orinoco_init() must clear this * before anything else touches the * hardware */ - INIT_TQUEUE(&priv->timeout_task, (void (*)(void *))orinoco_reset, dev); + INIT_WORK(&priv->timeout_task, (void (*)(void *))orinoco_reset, dev); return dev; diff --git a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h index 5b0333de0eac..8317270a46da 100644 --- a/drivers/net/wireless/orinoco.h +++ b/drivers/net/wireless/orinoco.h @@ -11,7 +11,7 @@ #include <linux/spinlock.h> #include <linux/netdevice.h> #include <linux/wireless.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include "hermes.h" /* To enable debug messages */ @@ -42,7 +42,7 @@ struct orinoco_private { /* Synchronisation stuff */ spinlock_t lock; int hw_unavailable; - struct tq_struct timeout_task; + struct work_struct timeout_task; int open; diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index f42f3998f297..4ce6048dceba 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c @@ -37,7 +37,7 @@ #include <linux/vmalloc.h> #include <asm/errno.h> #include <linux/irq.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/io.h> #include <asm/hd64465.h> @@ -791,7 +791,7 @@ static int hs_irq_demux(int irq, void *dev) /* * Interrupt handling routine. * - * This uses the schedule_task() technique to cause reportable events + * This uses the schedule_work() technique to cause reportable events * such as card insertion and removal to be handled in keventd's * process context. */ @@ -816,9 +816,7 @@ static void hs_events_bh(void *dummy) } } -static struct tq_struct hs_events_task = { - routine: hs_events_bh -}; +static DECLARE_WORK(hs_events_task, hs_events_bh, NULL); static void hs_interrupt(int irq, void *dev, struct pt_regs *regs) { @@ -885,7 +883,7 @@ static void hs_interrupt(int irq, void *dev, struct pt_regs *regs) sp->pending_events |= events; spin_unlock(&hs_pending_event_lock); - schedule_task(&hs_events_task); + schedule_work(&hs_events_task); } } diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c index f321806c431c..28f30334a398 100644 --- a/drivers/pcmcia/i82092.c +++ b/drivers/pcmcia/i82092.c @@ -14,7 +14,7 @@ #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <pcmcia/cs_types.h> #include <pcmcia/ss.h> @@ -315,9 +315,7 @@ static void i82092aa_bh(void *dummy) } -static struct tq_struct i82092aa_task = { - routine: i82092aa_bh -}; +static DECLARE_WORK(i82092aa_task, i82092aa_bh, NULL); static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs) @@ -367,7 +365,7 @@ static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs) if (events) { sockets[i].pending_events |= events; - schedule_task(&i82092aa_task); + schedule_work(&i82092aa_task); } active |= events; } diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 5e25020fb705..30120d235501 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -46,7 +46,7 @@ #include <linux/ioport.h> #include <linux/delay.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/bitops.h> @@ -931,9 +931,7 @@ static void pcic_bh(void *dummy) } } -static struct tq_struct pcic_task = { - routine: pcic_bh -}; +static DECLARE_WORK(pcic_task, pcic_bh, NULL); static unsigned long last_detect_jiffies; @@ -990,7 +988,7 @@ static void pcic_interrupt(int irq, void *dev, spin_lock(&pending_event_lock); pending_events[i] |= events; spin_unlock(&pending_event_lock); - schedule_task(&pcic_task); + schedule_work(&pcic_task); } active |= events; } diff --git a/drivers/pcmcia/pci_socket.c b/drivers/pcmcia/pci_socket.c index 5a4b78312391..e6297d28f83d 100644 --- a/drivers/pcmcia/pci_socket.c +++ b/drivers/pcmcia/pci_socket.c @@ -20,7 +20,7 @@ #include <linux/init.h> #include <linux/pci.h> #include <linux/sched.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <pcmcia/ss.h> diff --git a/drivers/pcmcia/pci_socket.h b/drivers/pcmcia/pci_socket.h index 50bc5702f4b1..77df35546d8a 100644 --- a/drivers/pcmcia/pci_socket.h +++ b/drivers/pcmcia/pci_socket.h @@ -21,7 +21,7 @@ typedef struct pci_socket { spinlock_t event_lock; unsigned int events; struct socket_info_t *pcmcia_socket; - struct tq_struct tq_task; + struct work_struct tq_task; struct timer_list poll_timer; /* A few words of private data for the low-level driver.. */ diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 47f364fbc97b..a31365bb73fe 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -41,7 +41,7 @@ #include <linux/delay.h> #include <linux/ioport.h> #include <linux/kernel.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/timer.h> #include <linux/mm.h> #include <linux/notifier.h> @@ -80,7 +80,7 @@ static struct sa1100_pcmcia_socket sa1100_pcmcia_socket[SA1100_PCMCIA_MAX_SOCK]; static struct pcmcia_low_level *pcmcia_low_level; static struct timer_list poll_timer; -static struct tq_struct sa1100_pcmcia_task; +static struct work_struct sa1100_pcmcia_task; /* * sa1100_pcmcia_default_mecr_timing @@ -324,9 +324,7 @@ static void sa1100_pcmcia_task_handler(void *data) } while(all_events); } /* sa1100_pcmcia_task_handler() */ -static struct tq_struct sa1100_pcmcia_task = { - routine: sa1100_pcmcia_task_handler -}; +static DECLARE_WORK(sa1100_pcmcia_task, sa1100_pcmcia_task_handler, NULL); /* sa1100_pcmcia_poll_event() @@ -339,7 +337,7 @@ static void sa1100_pcmcia_poll_event(unsigned long dummy) poll_timer.function = sa1100_pcmcia_poll_event; poll_timer.expires = jiffies + SA1100_PCMCIA_POLL_PERIOD; add_timer(&poll_timer); - schedule_task(&sa1100_pcmcia_task); + schedule_work(&sa1100_pcmcia_task); } @@ -355,7 +353,7 @@ static void sa1100_pcmcia_poll_event(unsigned long dummy) static void sa1100_pcmcia_interrupt(int irq, void *dev, struct pt_regs *regs) { DEBUG(3, "%s(): servicing IRQ %d\n", __FUNCTION__, irq); - schedule_task(&sa1100_pcmcia_task); + schedule_work(&sa1100_pcmcia_task); } @@ -1087,7 +1085,7 @@ void sa1100_unregister_pcmcia(struct pcmcia_low_level *ops) ops->shutdown(); - flush_scheduled_tasks(); + flush_scheduled_work(); pcmcia_low_level = NULL; } diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index dea17564815c..b61fc19ee75a 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c @@ -49,7 +49,7 @@ #include <linux/ioport.h> #include <linux/delay.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <pcmcia/version.h> #include <pcmcia/cs_types.h> @@ -550,9 +550,7 @@ static void tcic_bh(void *dummy) } } -static struct tq_struct tcic_task = { - routine: tcic_bh -}; +static DECLARE_WORK(tcic_task, tcic_bh, NULL); static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs) { @@ -596,7 +594,7 @@ static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs) spin_lock(&pending_event_lock); pending_events[i] |= events; spin_unlock(&pending_event_lock); - schedule_task(&tcic_task); + schedule_work(&tcic_task); } } diff --git a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c index 40b20b945488..4ff1a46ef827 100644 --- a/drivers/pcmcia/yenta.c +++ b/drivers/pcmcia/yenta.c @@ -6,7 +6,7 @@ #include <linux/init.h> #include <linux/pci.h> #include <linux/sched.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/module.h> @@ -492,7 +492,7 @@ static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) spin_lock(&socket->event_lock); socket->events |= events; spin_unlock(&socket->event_lock); - schedule_task(&socket->tq_task); + schedule_work(&socket->tq_task); } } @@ -583,7 +583,7 @@ static void yenta_open_bh(void * data) pci_socket_t * socket = (pci_socket_t *) data; /* It's OK to overwrite this now */ - socket->tq_task.routine = yenta_bh; + INIT_WORK(&socket->tq_task, yenta_bh, NULL); if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->name, socket)) { /* No IRQ or request_irq failed. Poll */ @@ -876,11 +876,10 @@ static int yenta_open(pci_socket_t *socket) initialisation later. We can't do this here, because, er, because Linus says so :) */ - socket->tq_task.routine = yenta_open_bh; - socket->tq_task.data = socket; + INIT_WORK(&socket->tq_task, yenta_open_bh, socket); MOD_INC_USE_COUNT; - schedule_task(&socket->tq_task); + schedule_work(&socket->tq_task); return 0; } diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 6718e92b7dd6..8a0f06d36934 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -89,7 +89,7 @@ typedef struct _raw3215_info { int written; /* number of bytes in write requests */ devstat_t devstat; /* device status structure for do_IO */ struct tty_struct *tty; /* pointer to tty structure if present */ - struct tq_struct tqueue; /* task queue to bottom half */ + struct work_struct tqueue; /* task queue to bottom half */ raw3215_req *queued_read; /* pointer to queued read requests */ raw3215_req *queued_write; /* pointer to queued write requests */ wait_queue_head_t empty_wait; /* wait queue for flushing */ @@ -379,10 +379,8 @@ static inline void raw3215_sched_bh(raw3215_info *raw) raw->flags |= RAW3215_BH_PENDING; INIT_LIST_HEAD(&raw->tqueue.list); raw->tqueue.sync = 0; - raw->tqueue.routine = raw3215_softint; - raw->tqueue.data = raw; - queue_task(&raw->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&raw->tqueue, raw3215_softint, raw); + schedule_work(&raw->tqueue); } /* @@ -867,8 +865,7 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp) kfree(raw); return -ENOMEM; } - raw->tqueue.routine = raw3215_softint; - raw->tqueue.data = raw; + INIT_WORK(&raw->tqueue, raw3215_softint, raw); init_waitqueue_head(&raw->empty_wait); raw3215[line] = raw; } @@ -1097,8 +1094,7 @@ void __init con3215_init(void) /* Find the first console */ raw->irq = raw3215_find_dev(0); raw->flags |= RAW3215_FIXED; - raw->tqueue.routine = raw3215_softint; - raw->tqueue.data = raw; + INIT_WORK(&raw->tqueue, raw3215_softint, raw); init_waitqueue_head(&raw->empty_wait); /* Request the console irq */ diff --git a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c index 8486d77a4d8c..29d5270ba76f 100644 --- a/drivers/s390/char/tubfs.c +++ b/drivers/s390/char/tubfs.c @@ -265,10 +265,8 @@ fs3270_sched_bh(tub_t *tubp) if (tubp->flags & TUB_BHPENDING) return; tubp->flags |= TUB_BHPENDING; - tubp->tqueue.routine = fs3270_bh; - tubp->tqueue.data = tubp; - queue_task(&tubp->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&tubp->tqueue, fs3270_bh, tubp); + schedule_work(&tubp->tqueue); } /* diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 7f353ce582d9..e463e3683b0e 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1893,7 +1893,7 @@ static void done(struct Scsi_Host *shpnt, int error) printk(KERN_ERR "aha152x: done() called outside of command\n"); } -static struct tq_struct aha152x_tq; +static struct work_struct aha152x_tq; /* * Run service completions on the card with interrupts enabled. @@ -1940,9 +1940,8 @@ static void intr(int irqno, void *dev_id, struct pt_regs *regs) /* Poke the BH handler */ HOSTDATA(shpnt)->service++; - aha152x_tq.routine = (void *) run; - queue_task(&aha152x_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&aha152x_tq, (void *) run, NULL); + schedule_work(&aha152x_tq); } /* diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 9658a5889495..537e3a6f448f 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -640,13 +640,11 @@ __inline__ void NCR5380_print_phase(struct Scsi_Host *instance) { }; * interrupt or bottom half. */ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> static volatile int main_running = 0; -static struct tq_struct NCR5380_tqueue = { - routine: (void (*)(void*))NCR5380_main /* must have (void *) arg... */ -}; +static DECLARE_WORK(NCR5380_tqueue, (void (*)(void*))NCR5380_main, NULL); static __inline__ void queue_main(void) { @@ -655,8 +653,7 @@ static __inline__ void queue_main(void) queue it on the 'immediate' task queue, to be processed immediately after the current interrupt processing has finished. */ - queue_task(&NCR5380_tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&NCR5380_tqueue); } /* else: nothing to do: the running NCR5380_main() will pick up any newly queued command. */ diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 0ba5d66f26b1..3362a5b81af8 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -36,7 +36,7 @@ typedef struct { int mode; /* Transfer mode */ int host; /* Host number (for proc) */ Scsi_Cmnd *cur_cmd; /* Current queued command */ - struct tq_struct imm_tq; /* Polling interrupt stuff */ + struct work_struct imm_tq; /* Polling interrupt stuff */ unsigned long jstart; /* Jiffies at start */ unsigned failed:1; /* Failure flag */ unsigned dp:1; /* Data phase present */ @@ -51,7 +51,6 @@ typedef struct { mode: IMM_AUTODETECT, \ host: -1, \ cur_cmd: NULL, \ - imm_tq: { routine: imm_interrupt }, \ jstart: 0, \ failed: 0, \ dp: 0, \ @@ -896,9 +895,8 @@ static void imm_interrupt(void *data) return; } if (imm_engine(tmp, cmd)) { - tmp->imm_tq.data = (void *) tmp; - tmp->imm_tq.sync = 0; - queue_task(&tmp->imm_tq, &tq_timer); + INIT_WORK(&tmp->imm_tq, imm_interrupt, (void *)tmp); + schedule_delayed_work(&tmp->imm_tq, 1); return; } /* Command must of completed hence it is safe to let go... */ @@ -1103,10 +1101,8 @@ int imm_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) imm_pb_claim(host_no); - imm_hosts[host_no].imm_tq.data = imm_hosts + host_no; - imm_hosts[host_no].imm_tq.sync = 0; - queue_task(&imm_hosts[host_no].imm_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + INIT_WORK(&imm_hosts[host_no].imm_tq, imm_interrupt, imm_hosts + host_no); + schedule_work(&imm_hosts[host_no].imm_tq); return 0; } diff --git a/drivers/scsi/mac_NCR5380.c b/drivers/scsi/mac_NCR5380.c index c8b26df1a70e..521338547345 100644 --- a/drivers/scsi/mac_NCR5380.c +++ b/drivers/scsi/mac_NCR5380.c @@ -657,13 +657,11 @@ __inline__ void NCR5380_print_phase(struct Scsi_Host *instance) { }; * interrupt or bottom half. */ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> static volatile int main_running = 0; -static struct tq_struct NCR5380_tqueue = { - routine: (void (*)(void*))NCR5380_main /* must have (void *) arg... */ -}; +static DECLARE_WORK(NCR5380_tqueue, (void (*)(void*))NCR5380_main, NULL); static __inline__ void queue_main(void) { @@ -672,8 +670,7 @@ static __inline__ void queue_main(void) queue it on the 'immediate' task queue, to be processed immediately after the current interrupt processing has finished. */ - queue_task(&NCR5380_tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&NCR5380_tqueue); } /* else: nothing to do: the running NCR5380_main() will pick up any newly queued command. */ diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 7d2bf583126f..26c25f76a22e 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -491,7 +491,7 @@ #include <linux/proc_fs.h> #include <linux/blk.h> #include <linux/wait.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/mm.h> #include <asm/pgtable.h> diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c index a7c1a5ef93d2..cef821562879 100644 --- a/drivers/scsi/oktagon_esp.c +++ b/drivers/scsi/oktagon_esp.c @@ -40,7 +40,7 @@ #include <asm/amigahw.h> #ifdef USE_BOTTOM_HALF -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> #endif @@ -77,9 +77,7 @@ static void dma_commit(void *opaque); long oktag_to_io(long *paddr, long *addr, long len); long oktag_from_io(long *addr, long *paddr, long len); -static struct tq_struct tq_fake_dma = { - routine: dma_commit, -}; +static DECLARE_WORK(tq_fake_dma, dma_commit, NULL); #define DMA_MAXTRANSFER 0x8000 @@ -515,9 +513,7 @@ static void dma_irq_exit(struct NCR_ESP *esp) #ifdef USE_BOTTOM_HALF if(dma_on) { - tq_fake_dma.sync = 0; - queue_task(&tq_fake_dma,&tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&tq_fake_dma); } #else while(len && !dma_irq_p(esp)) diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index 72c50e01b438..7693aaf6a826 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -29,7 +29,7 @@ typedef struct { int mode; /* Transfer mode */ int host; /* Host number (for proc) */ Scsi_Cmnd *cur_cmd; /* Current queued command */ - struct tq_struct ppa_tq; /* Polling interrupt stuff */ + struct work_struct ppa_tq; /* Polling interrupt stuff */ unsigned long jstart; /* Jiffies at start */ unsigned long recon_tmo; /* How many usecs to wait for reconnection (6th bit) */ unsigned int failed:1; /* Failure flag */ @@ -801,7 +801,7 @@ static void ppa_interrupt(void *data) if (ppa_engine(tmp, cmd)) { tmp->ppa_tq.data = (void *) tmp; tmp->ppa_tq.sync = 0; - queue_task(&tmp->ppa_tq, &tq_timer); + schedule_delayed_work(&tmp->ppa_tq, 1); return; } /* Command must of completed hence it is safe to let go... */ @@ -986,8 +986,7 @@ int ppa_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) ppa_hosts[host_no].ppa_tq.data = ppa_hosts + host_no; ppa_hosts[host_no].ppa_tq.sync = 0; - queue_task(&ppa_hosts[host_no].ppa_tq, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&ppa_hosts[host_no].ppa_tq); return 0; } diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 7930540f1bb6..5fbb6c69a01f 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -131,14 +131,14 @@ - Added check of device_id when handling non QLA12160s during detect(). Rev 3.22 Beta January 5, 2001 BN Qlogic - - Changed queue_task() to schedule_task() + - Changed queue_task() to schedule_work() for kernels 2.4.0 and higher. Note: 2.4.0-testxx kernels released prior to the actual 2.4.0 kernel release on January 2001 - will get compile/link errors with schedule_task(). + will get compile/link errors with schedule_work(). Please update your kernel to released 2.4.0 level, or comment lines in this file flagged with 3.22 - to resolve compile/link error of schedule_task(). + to resolve compile/link error of schedule_work(). - Added -DCONFIG_SMP in addition to -D__SMP__ in Makefile for 2.4.0 builds of driver as module. Rev 3.21 Beta January 4, 2001 BN Qlogic @@ -253,7 +253,7 @@ #include <linux/pci.h> #include <linux/proc_fs.h> #include <linux/blk.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/stat.h> #include <linux/slab.h> @@ -1190,9 +1190,9 @@ qla1280_queuecommand(Scsi_Cmnd * cmd, void (*fn) (Scsi_Cmnd *)) &ha->done_q_last); /* 3.22 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) /* 3.22 */ - queue_task(&ha->run_qla_bh, &tq_scheduler); + schedule_work(&ha->run_qla_bh); #else /* 3.22 */ - schedule_task(&ha->run_qla_bh); /* 3.22 */ + schedule_work(&ha->run_qla_bh); /* 3.22 */ #endif /* 3.22 */ return 0; } diff --git a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h index b8b90c170ee2..1139d7d023a7 100644 --- a/drivers/scsi/qla1280.h +++ b/drivers/scsi/qla1280.h @@ -1234,7 +1234,7 @@ struct scsi_qla_host { struct scsi_lu *dev[MAX_EQ]; /* Logical unit queues */ /* bottom half run queue */ - struct tq_struct run_qla_bh; + struct work_struct run_qla_bh; /* Received ISP mailbox data. */ volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index b4d0903a79a9..730074134353 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c @@ -642,16 +642,11 @@ __inline__ void NCR5380_print_phase(struct Scsi_Host *instance) { }; * interrupt or bottom half. */ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/interrupt.h> static volatile int main_running = 0; -static struct tq_struct NCR5380_tqueue = { -// NULL, /* next */ - sync: 0, /* sync */ - routine: (void (*)(void*))NCR5380_main, /* routine, must have (void *) arg... */ - data: NULL /* data */ -}; +static DECLARE_WORK(NCR5380_tqueue, (void (*)(void*))NCR5380_main, NULL); static __inline__ void queue_main(void) { @@ -660,8 +655,7 @@ static __inline__ void queue_main(void) queue it on the 'immediate' task queue, to be processed immediately after the current interrupt processing has finished. */ - queue_task(&NCR5380_tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); + schedule_work(&NCR5380_tqueue); } /* else: nothing to do: the running NCR5380_main() will pick up any newly queued command. */ diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 937398583d11..e33625e4ecb7 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -94,7 +94,7 @@ static void serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *regs) status = *CSR_UARTFLG; while (!(status & 0x10) && max_count--) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) { printk(KERN_WARNING "TTY_DONT_FLIP set\n"); return; diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 2edcd7178f51..446243c8f4b9 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -735,7 +735,7 @@ receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs) do { if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) return; // if TTY_DONT_FLIP is set } diff --git a/drivers/serial/8250_cs.c b/drivers/serial/8250_cs.c index 216612335008..ef3cd4dcfad2 100644 --- a/drivers/serial/8250_cs.c +++ b/drivers/serial/8250_cs.c @@ -42,7 +42,7 @@ #include <linux/tty.h> #include <linux/serial.h> #include <linux/major.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/io.h> #include <asm/system.h> @@ -107,7 +107,7 @@ typedef struct serial_info { int manfid; dev_node_t node[4]; int line[4]; - struct tq_struct remove; + struct work_struct remove; } serial_info_t; static void serial_config(dev_link_t * link); @@ -182,7 +182,7 @@ static void serial_remove(dev_link_t *link) */ if (link->state & DEV_CONFIG) - schedule_task(&info->remove); + schedule_work(&info->remove); } /*====================================================================== @@ -210,7 +210,7 @@ static dev_link_t *serial_attach(void) link = &info->link; link->priv = info; - INIT_TQUEUE(&info->remove, do_serial_release, info); + INIT_WORK(&info->remove, do_serial_release, info); link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 8; @@ -278,7 +278,7 @@ static void serial_detach(dev_link_t * link) /* * Ensure any outstanding scheduled tasks are completed. */ - flush_scheduled_tasks(); + flush_scheduled_work(); /* * Ensure that the ports have been released. diff --git a/drivers/serial/amba.c b/drivers/serial/amba.c index d09707c256cf..1d81b33d7a69 100644 --- a/drivers/serial/amba.c +++ b/drivers/serial/amba.c @@ -152,7 +152,7 @@ ambauart_rx_chars(struct uart_port *port) status = UART_GET_FR(port); while (UART_RX_DATA(status) && max_count--) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) { printk(KERN_WARNING "TTY_DONT_FLIP set\n"); return; diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index b88c56fee41e..7de59824f314 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -138,7 +138,7 @@ static void receive_chars(struct uart_sunsab_port *up, unsigned char ch = buf[i]; if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) return; // if TTY_DONT_FLIP is set } diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 5cae7412aaff..280db241b38c 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -323,7 +323,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs do { if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) return; // if TTY_DONT_FLIP is set } diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 6031aa921067..0df3fcf4e671 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -338,7 +338,7 @@ static void sunzilog_receive_chars(struct uart_sunzilog_port *up, unsigned char ch, r1; if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - tty->flip.tqueue.routine((void *)tty); + tty->flip.work.func((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) return; } diff --git a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c index e4e02db81f75..454eb5026d11 100644 --- a/drivers/usb/class/bluetty.c +++ b/drivers/usb/class/bluetty.c @@ -195,7 +195,7 @@ struct usb_bluetooth { wait_queue_head_t write_wait; - struct tq_struct tqueue; /* task queue for line discipline waking up */ + struct work_struct work; /* work queue entry for line discipline waking up */ unsigned int int_packet_pos; unsigned char int_buffer[EVENT_BUFFER_SIZE]; @@ -1006,7 +1006,7 @@ static void bluetooth_write_bulk_callback (struct urb *urb) } /* wake up our little function to let the tty layer know that something happened */ - schedule_task(&bluetooth->tqueue); + schedule_work(&bluetooth->work); } @@ -1112,8 +1112,7 @@ static int usb_bluetooth_probe (struct usb_interface *intf, bluetooth->magic = USB_BLUETOOTH_MAGIC; bluetooth->dev = dev; bluetooth->minor = minor; - bluetooth->tqueue.routine = bluetooth_softint; - bluetooth->tqueue.data = bluetooth; + INIT_WORK(&bluetooth->work, bluetooth_softint, bluetooth); init_MUTEX(&bluetooth->lock); /* record the interface number for the control out */ diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index a048f123abd2..ef6e279545c5 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -143,7 +143,7 @@ struct acm { struct tty_struct *tty; /* the coresponding tty */ struct urb *ctrlurb, *readurb, *writeurb; /* urbs */ struct acm_line line; /* line coding (bits, stop, parity) */ - struct tq_struct tqueue; /* task queue for line discipline waking up */ + struct work_struct work; /* work queue entry for line discipline waking up */ unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */ unsigned int ctrlout; /* output control lines (DTR, RTS) */ unsigned int writesize; /* max packet size for the output bulk endpoint */ @@ -272,7 +272,7 @@ static void acm_write_bulk(struct urb *urb) if (urb->status) dbg("nonzero write bulk status received: %d", urb->status); - schedule_task(&acm->tqueue); + schedule_work(&acm->work); } static void acm_softint(void *private) @@ -578,8 +578,7 @@ static int acm_probe (struct usb_interface *intf, acm->minor = minor; acm->dev = dev; - acm->tqueue.routine = acm_softint; - acm->tqueue.data = acm; + INIT_WORK(&acm->work, acm_softint, acm); if (!(buf = kmalloc(ctrlsize + readsize + acm->writesize, GFP_KERNEL))) { err("out of memory"); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index faaf25f59db9..1c4cb59a95b4 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -240,7 +240,7 @@ void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe) /* tell keventd to clear state for this TT */ spin_lock_irqsave (&tt->lock, flags); list_add_tail (&clear->clear_list, &tt->clear_list); - schedule_task (&tt->kevent); + schedule_work (&tt->kevent); spin_unlock_irqrestore (&tt->lock, flags); } @@ -337,7 +337,7 @@ static int usb_hub_configure(struct usb_hub *hub, spin_lock_init (&hub->tt.lock); INIT_LIST_HEAD (&hub->tt.clear_list); - INIT_TQUEUE (&hub->tt.kevent, hub_tt_kevent, hub); + INIT_WORK (&hub->tt.kevent, hub_tt_kevent, hub); switch (dev->descriptor.bDeviceProtocol) { case 0: break; @@ -452,7 +452,7 @@ static void hub_disconnect(struct usb_interface *intf) /* assuming we used keventd, it must quiesce too */ if (hub->tt.hub) - flush_scheduled_tasks (); + flush_scheduled_work (); if (hub->urb) { usb_unlink_urb(hub->urb); diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index c7a976e561ac..ae940844302d 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -9,7 +9,7 @@ */ #include <linux/list.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/compiler.h> /* likely()/unlikely() */ /* @@ -158,7 +158,7 @@ struct usb_tt { /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ spinlock_t lock; struct list_head clear_list; /* of usb_tt_clear */ - struct tq_struct kevent; + struct work_struct kevent; }; struct usb_tt_clear { diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index fb09fb3fdde2..45c76c1b8b97 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -112,7 +112,7 @@ #include <linux/etherdevice.h> #include <linux/random.h> #include <linux/ethtool.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/uaccess.h> #include <asm/unaligned.h> @@ -201,7 +201,7 @@ struct usbnet { struct sk_buff_head done; struct tasklet_struct bh; - struct tq_struct kevent; + struct work_struct kevent; unsigned long flags; # define EVENT_TX_HALT 0 # define EVENT_RX_HALT 1 @@ -1278,13 +1278,13 @@ static void defer_bh (struct usbnet *dev, struct sk_buff *skb) /* some work can't be done in tasklets, so we use keventd * - * NOTE: annoying asymmetry: if it's active, schedule_task() fails, + * NOTE: annoying asymmetry: if it's active, schedule_work() fails, * but tasklet_schedule() doesn't. hope the failure is rare. */ static void defer_kevent (struct usbnet *dev, int work) { set_bit (work, &dev->flags); - if (!schedule_task (&dev->kevent)) + if (!schedule_work (&dev->kevent)) err ("%s: kevent %d may have been dropped", dev->net.name, work); else @@ -1965,7 +1965,7 @@ static void usbnet_disconnect (struct usb_interface *intf) mutex_unlock (&usbnet_mutex); // assuming we used keventd, it must quiesce too - flush_scheduled_tasks (); + flush_scheduled_work (); kfree (dev); usb_put_dev (xdev); @@ -2016,7 +2016,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) skb_queue_head_init (&dev->done); dev->bh.func = usbnet_bh; dev->bh.data = (unsigned long) dev; - INIT_TQUEUE (&dev->kevent, kevent, dev); + INIT_WORK (&dev->kevent, kevent, dev); // set up network interface records net = &dev->net; diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index c728a7420d16..5806d3e173b3 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -454,7 +454,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb) } exit: - schedule_task(&port->tqueue); + schedule_work(&port->work); } static int __init cyberjack_init (void) diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 4b991e76067c..d5e6f3ae05d5 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -243,7 +243,7 @@ #include <linux/tty_flip.h> #include <linux/module.h> #include <linux/spinlock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/uaccess.h> #include <linux/usb.h> @@ -437,7 +437,7 @@ struct digi_port { wait_queue_head_t dp_flush_wait; int dp_in_close; /* close in progress */ wait_queue_head_t dp_close_wait; /* wait queue for close */ - struct tq_struct dp_wakeup_task; + struct work_struct dp_wakeup_work; }; @@ -1416,7 +1416,7 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); /* also queue up a wakeup at scheduler time, in case we */ /* lost the race in write_chan(). */ - schedule_task(&priv->dp_wakeup_task); + schedule_work(&priv->dp_wakeup_work); spin_unlock( &priv->dp_port_lock ); @@ -1714,10 +1714,8 @@ dbg( "digi_startup: TOP" ); init_waitqueue_head( &priv->dp_flush_wait ); priv->dp_in_close = 0; init_waitqueue_head( &priv->dp_close_wait ); - INIT_LIST_HEAD(&priv->dp_wakeup_task.list); - priv->dp_wakeup_task.sync = 0; - priv->dp_wakeup_task.routine = (void *)digi_wakeup_write_lock; - priv->dp_wakeup_task.data = (void *)(&serial->port[i]); + INIT_WORK(&priv->dp_wakeup_work, (void *)digi_wakeup_write_lock, + (void *)(&serial->port[i])); /* initialize write wait queue for this port */ init_waitqueue_head( &serial->port[i].write_wait ); diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 8db192f94e94..ac3f11202cae 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -362,7 +362,7 @@ static void empeg_write_bulk_callback (struct urb *urb) return; } - schedule_task(&port->tqueue); + schedule_work(&port->work); } diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8f5e0887f228..2df1a6ca0f66 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -485,7 +485,7 @@ static void ftdi_sio_write_bulk_callback (struct urb *urb) return; } - schedule_task(&port->tqueue); + schedule_work(&port->work); } /* ftdi_sio_write_bulk_callback */ diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 2999a4a7b550..cc0beb63d50c 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -466,7 +466,7 @@ static void ipaq_write_bulk_callback(struct urb *urb) spin_unlock_irqrestore(&write_list_lock, flags); } - schedule_task(&port->tqueue); + schedule_work(&port->work); } static int ipaq_write_room(struct usb_serial_port *port) diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index bda8a7866b4f..307b62a32652 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -426,7 +426,7 @@ static void ir_write_bulk_callback (struct urb *urb) urb->actual_length, urb->transfer_buffer); - schedule_task(&port->tqueue); + schedule_work(&port->work); } static void ir_read_bulk_callback (struct urb *urb) diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 6a052412725c..6de5e21f57cc 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -448,7 +448,7 @@ static void usa2x_outdat_callback(struct urb *urb) dbg ("%s - urb %d", __FUNCTION__, urb == p_priv->out_urbs[1]); if (port->open_count) - schedule_task(&port->tqueue); + schedule_work(&port->work); } static void usa26_inack_callback(struct urb *urb) diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index d99e71214d5f..139fd21a2f39 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -76,7 +76,7 @@ #include <linux/tty_flip.h> #include <linux/module.h> #include <linux/spinlock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/uaccess.h> #include <linux/usb.h> @@ -125,8 +125,8 @@ struct ezusb_hex_record { struct keyspan_pda_private { int tx_room; int tx_throttled; - struct tq_struct wakeup_task; - struct tq_struct unthrottle_task; + struct work_struct wakeup_work; + struct work_struct unthrottle_work; }; @@ -267,7 +267,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb) tty = serial->port[0].tty; priv->tx_throttled = 0; /* queue up a wakeup at scheduler time */ - schedule_task(&priv->wakeup_task); + schedule_work(&priv->wakeup_work); break; default: break; @@ -611,7 +611,7 @@ static int keyspan_pda_write(struct usb_serial_port *port, int from_user, if (request_unthrottle) { priv->tx_throttled = 1; /* block writers */ - schedule_task(&priv->unthrottle_task); + schedule_work(&priv->unthrottle_work); } rc = count; @@ -638,7 +638,7 @@ static void keyspan_pda_write_bulk_callback (struct urb *urb) } /* queue up a wakeup at scheduler time */ - schedule_task(&priv->wakeup_task); + schedule_work(&priv->wakeup_work); } @@ -791,14 +791,11 @@ static int keyspan_pda_startup (struct usb_serial *serial) if (!priv) return (1); /* error */ init_waitqueue_head(&serial->port[0].write_wait); - INIT_LIST_HEAD(&priv->wakeup_task.list); - priv->wakeup_task.sync = 0; - priv->wakeup_task.routine = (void *)keyspan_pda_wakeup_write; - priv->wakeup_task.data = (void *)(&serial->port[0]); - INIT_LIST_HEAD(&priv->unthrottle_task.list); - priv->unthrottle_task.sync = 0; - priv->unthrottle_task.routine = (void *)keyspan_pda_request_unthrottle; - priv->unthrottle_task.data = (void *)(serial); + INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write, + (void *)(&serial->port[0])); + INIT_WORK(&priv->unthrottle_work, + (void *)keyspan_pda_request_unthrottle, + (void *)(serial)); return (0); } diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index 776806b5b2ca..47312691cc43 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -577,7 +577,7 @@ static void klsi_105_write_bulk_callback ( struct urb *urb) } /* from generic_write_bulk_callback */ - schedule_task(&port->tqueue); + schedule_work(&port->work); } /* klsi_105_write_bulk_completion_callback */ diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index d01271a7f06a..6c4424eb8194 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -507,7 +507,7 @@ static void mct_u232_write_bulk_callback (struct urb *urb) } else { /* from generic_write_bulk_callback */ - schedule_task(&port->tqueue); + schedule_work(&port->work); } return; diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index e675964d592b..b4d5fa960435 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -359,7 +359,7 @@ static void omninet_write_bulk_callback (struct urb *urb) return; } - schedule_task(&port->tqueue); + schedule_work(&port->work); // dbg("omninet_write_bulk_callback, tty %0x\n", tty); } diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 3f1a2b50ecf9..a9e4b0568772 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -705,7 +705,7 @@ static void pl2303_write_bulk_callback (struct urb *urb) return; } - schedule_task(&port->tqueue); + schedule_work(&port->work); } diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h index c533630f4d61..38fb8b253cb5 100644 --- a/drivers/usb/serial/usb-serial.h +++ b/drivers/usb/serial/usb-serial.h @@ -87,7 +87,7 @@ * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this * port. * @write_wait: a wait_queue_head_t used by the port. - * @tqueue: task queue for the line discipline waking up. + * @work: work queue entry for the line discipline waking up. * @open_count: number of times this port has been opened. * @sem: struct semaphore used to lock this structure. * @private: place to put any driver specific information that is needed. The @@ -117,7 +117,7 @@ struct usb_serial_port { __u8 bulk_out_endpointAddress; wait_queue_head_t write_wait; - struct tq_struct tqueue; + struct work_struct work; int open_count; struct semaphore sem; void * private; diff --git a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c index 84bfbf783ba9..f06bbad9e14f 100644 --- a/drivers/usb/serial/usbserial.c +++ b/drivers/usb/serial/usbserial.c @@ -1092,7 +1092,7 @@ static void generic_write_bulk_callback (struct urb *urb) usb_serial_port_softint((void *)port); - schedule_task(&port->tqueue); + schedule_work(&port->work); } static void generic_shutdown (struct usb_serial *serial) @@ -1402,8 +1402,7 @@ int usb_serial_probe(struct usb_interface *interface, port->number = i + serial->minor; port->serial = serial; port->magic = USB_SERIAL_PORT_MAGIC; - port->tqueue.routine = usb_serial_port_softint; - port->tqueue.data = port; + INIT_WORK(&port->work, usb_serial_port_softint, port); init_MUTEX (&port->sem); } @@ -1887,7 +1886,7 @@ static void usb_console_write(struct console *co, const char *buf, unsigned coun dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count); if (!port->open_count) { - dbg (__FUNCTION__ " - port not opened"); + dbg ("%s - port not opened", __FUNCTION__); goto exit; } diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 11af1da8bfcc..69ede41337e6 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -460,7 +460,7 @@ static void visor_write_bulk_callback (struct urb *urb) /* free up the transfer buffer, as usb_free_urb() does not do this */ kfree (urb->transfer_buffer); - schedule_task(&port->tqueue); + schedule_work(&port->work); } diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 67c931eed0d2..57ad099241fd 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -918,7 +918,7 @@ static void whiteheat_write_callback(struct urb *urb) usb_serial_port_softint((void *)port); - schedule_task(&port->tqueue); + schedule_work(&port->work); } diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 9a4f71f719e7..bae45783a718 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -117,7 +117,7 @@ struct usb_skel { struct urb * write_urb; /* the urb used to send data */ __u8 bulk_out_endpointAddr; /* the address of the bulk out endpoint */ - struct tq_struct tqueue; /* task queue for line discipline waking up */ + struct work_struct work; /* work queue entry for line discipline waking up */ int open_count; /* number of times this port has been opened */ struct semaphore sem; /* locks this structure */ }; diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 17b1c02cb38a..d8ac3095f2d0 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -767,7 +767,7 @@ sa1100fb_get_machine_info(struct sa1100fb_info *fbi) static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *); static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state); -static inline void sa1100fb_schedule_task(struct sa1100fb_info *fbi, u_int state) +static inline void sa1100fb_schedule_work(struct sa1100fb_info *fbi, u_int state) { unsigned long flags; @@ -787,7 +787,7 @@ static inline void sa1100fb_schedule_task(struct sa1100fb_info *fbi, u_int state if (state != (u_int)-1) { fbi->task_state = state; - schedule_task(&fbi->task); + schedule_work(&fbi->task); } local_irq_restore(flags); } @@ -1140,14 +1140,14 @@ static int sa1100fb_blank(int blank, struct fb_info *info) fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) for (i = 0; i < fbi->palette_size; i++) sa1100fb_setpalettereg(i, 0, 0, 0, 0, info); - sa1100fb_schedule_task(fbi, C_DISABLE); + sa1100fb_schedule_work(fbi, C_DISABLE); break; case VESA_NO_BLANKING: if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) fb_set_cmap(&fbi->fb.cmap, 1, info); - sa1100fb_schedule_task(fbi, C_ENABLE); + sa1100fb_schedule_work(fbi, C_ENABLE); } return 0; } @@ -1285,7 +1285,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ if ((LCCR0 != fbi->reg_lccr0) || (LCCR1 != fbi->reg_lccr1) || (LCCR2 != fbi->reg_lccr2) || (LCCR3 != fbi->reg_lccr3) || (DBAR1 != fbi->dbar1) || (DBAR2 != fbi->dbar2)) - sa1100fb_schedule_task(fbi, C_REENABLE); + sa1100fb_schedule_work(fbi, C_REENABLE); return 0; } @@ -1778,7 +1778,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(void) fbi->fb.disp->inverse = inf->cmap_inverse; init_waitqueue_head(&fbi->ctrlr_wait); - INIT_TQUEUE(&fbi->task, sa1100fb_task, fbi); + INIT_WORK(&fbi->task, sa1100fb_task, fbi); init_MUTEX(&fbi->ctrlr_sem); return fbi; diff --git a/drivers/video/sa1100fb.h b/drivers/video/sa1100fb.h index 9b3b4a402a51..f0891b4fd45b 100644 --- a/drivers/video/sa1100fb.h +++ b/drivers/video/sa1100fb.h @@ -101,7 +101,7 @@ struct sa1100fb_info { volatile u_char task_state; struct semaphore ctrlr_sem; wait_queue_head_t ctrlr_wait; - struct tq_struct task; + struct work_struct task; #ifdef CONFIG_PM struct pm_dev *pm; |
