Commit 4a975df3 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390 update: tasklets

Switch from work queues to tasklets in the 3215 and 3270 drivers.
parent 636efd6a
...@@ -89,7 +89,7 @@ typedef struct _raw3215_info { ...@@ -89,7 +89,7 @@ typedef struct _raw3215_info {
int written; /* number of bytes in write requests */ int written; /* number of bytes in write requests */
devstat_t devstat; /* device status structure for do_IO */ devstat_t devstat; /* device status structure for do_IO */
struct tty_struct *tty; /* pointer to tty structure if present */ struct tty_struct *tty; /* pointer to tty structure if present */
struct work_struct tqueue; /* task queue to bottom half */ struct tasklet_struct tasklet;
raw3215_req *queued_read; /* pointer to queued read requests */ raw3215_req *queued_read; /* pointer to queued read requests */
raw3215_req *queued_write; /* pointer to queued write requests */ raw3215_req *queued_write; /* pointer to queued write requests */
wait_queue_head_t empty_wait; /* wait queue for flushing */ wait_queue_head_t empty_wait; /* wait queue for flushing */
...@@ -351,7 +351,7 @@ static void raw3215_tasklet(void *data) ...@@ -351,7 +351,7 @@ static void raw3215_tasklet(void *data)
s390irq_spin_lock_irqsave(raw->irq, flags); s390irq_spin_lock_irqsave(raw->irq, flags);
raw3215_mk_write_req(raw); raw3215_mk_write_req(raw);
raw3215_try_io(raw); raw3215_try_io(raw);
raw->flags &= ~RAW3215_BH_PENDING; raw->flags &= ~RAW3215_BH_PENDING;
s390irq_spin_unlock_irqrestore(raw->irq, flags); s390irq_spin_unlock_irqrestore(raw->irq, flags);
/* Check for pending message from raw3215_irq */ /* Check for pending message from raw3215_irq */
if (raw->message != NULL) { if (raw->message != NULL) {
...@@ -369,16 +369,13 @@ static void raw3215_tasklet(void *data) ...@@ -369,16 +369,13 @@ static void raw3215_tasklet(void *data)
} }
/* /*
* Function to safely add raw3215_softint to tq_immediate.
* The s390irq spinlock must be held.
*/ */
static inline void raw3215_sched_bh(raw3215_info *raw) static inline void raw3215_sched_tasklet(raw3215_info *raw)
{ {
if (raw->flags & RAW3215_BH_PENDING) if (raw->flags & RAW3215_BH_PENDING)
return; /* already pending */ return; /* already pending */
raw->flags |= RAW3215_BH_PENDING; raw->flags |= RAW3215_BH_PENDING;
INIT_WORK(&raw->tqueue, raw3215_softint, raw); tasklet_hi_schedule(&raw->tasklet);
schedule_work(&raw->tqueue);
} }
/* /*
...@@ -421,7 +418,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs) ...@@ -421,7 +418,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs)
"(dev %i, dev sts 0x%2x, sch sts 0x%2x)"; "(dev %i, dev sts 0x%2x, sch sts 0x%2x)";
raw->msg_dstat = dstat; raw->msg_dstat = dstat;
raw->msg_cstat = cstat; raw->msg_cstat = cstat;
raw3215_sched_bh(raw); raw3215_sched_tasklet(raw);
} }
} }
if (dstat & 0x01) { /* we got a unit exception */ if (dstat & 0x01) { /* we got a unit exception */
...@@ -438,7 +435,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs) ...@@ -438,7 +435,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs)
raw3215_mk_read_req(raw); raw3215_mk_read_req(raw);
if (MACHINE_IS_P390) if (MACHINE_IS_P390)
memset(raw->inbuf, 0, RAW3215_INBUF_SIZE); memset(raw->inbuf, 0, RAW3215_INBUF_SIZE);
raw3215_sched_bh(raw); raw3215_sched_tasklet(raw);
break; break;
case 0x08: case 0x08:
case 0x0C: case 0x0C:
...@@ -512,7 +509,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs) ...@@ -512,7 +509,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs)
raw->queued_read == NULL) { raw->queued_read == NULL) {
wake_up_interruptible(&raw->empty_wait); wake_up_interruptible(&raw->empty_wait);
} }
raw3215_sched_bh(raw); raw3215_sched_tasklet(raw);
break; break;
default: default:
/* Strange interrupt, I'll do my best to clean up */ /* Strange interrupt, I'll do my best to clean up */
...@@ -532,7 +529,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs) ...@@ -532,7 +529,7 @@ static void raw3215_irq(int irq, void *int_parm, struct pt_regs *regs)
"(dev %i, dev sts 0x%2x, sch sts 0x%2x)"; "(dev %i, dev sts 0x%2x, sch sts 0x%2x)";
raw->msg_dstat = dstat; raw->msg_dstat = dstat;
raw->msg_cstat = cstat; raw->msg_cstat = cstat;
raw3215_sched_bh(raw); raw3215_sched_tasklet(raw);
} }
return; return;
} }
...@@ -868,7 +865,6 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp) ...@@ -868,7 +865,6 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp)
kfree(raw); kfree(raw);
return -ENOMEM; return -ENOMEM;
} }
INIT_WORK(&raw->tqueue, raw3215_softint, raw);
init_waitqueue_head(&raw->empty_wait); init_waitqueue_head(&raw->empty_wait);
raw3215[line] = raw; raw3215[line] = raw;
} }
...@@ -1110,7 +1106,9 @@ void __init con3215_init(void) ...@@ -1110,7 +1106,9 @@ void __init con3215_init(void)
/* Find the first console */ /* Find the first console */
raw->irq = irq; raw->irq = irq;
raw->flags |= RAW3215_FIXED; raw->flags |= RAW3215_FIXED;
INIT_WORK(&raw->tqueue, raw3215_softint, raw); tasklet_init(&raw->tasklet,
(void (*)(unsigned long)) raw3215_tasklet,
(unsigned long) raw);
init_waitqueue_head(&raw->empty_wait); init_waitqueue_head(&raw->empty_wait);
/* Request the console irq */ /* Request the console irq */
......
...@@ -226,7 +226,7 @@ fs3270_io(tub_t *tubp, ccw1_t *ccwp) ...@@ -226,7 +226,7 @@ fs3270_io(tub_t *tubp, ccw1_t *ccwp)
} }
/* /*
* fs3270_bh(tubp) -- Perform back-half processing * fs3270_tasklet(tubp) -- Perform back-half processing
*/ */
static void static void
fs3270_tasklet(unsigned long data) fs3270_tasklet(unsigned long data)
...@@ -256,17 +256,18 @@ fs3270_tasklet(unsigned long data) ...@@ -256,17 +256,18 @@ fs3270_tasklet(unsigned long data)
} }
/* /*
* fs3270_sched_bh(tubp) -- Schedule the back half * fs3270_sched_tasklet(tubp) -- Schedule the back half
* Irq lock must be held on entry and remains held on exit. * Irq lock must be held on entry and remains held on exit.
*/ */
static void static void
fs3270_sched_bh(tub_t *tubp) fs3270_sched_tasklet(tub_t *tubp)
{ {
if (tubp->flags & TUB_BHPENDING) if (tubp->flags & TUB_BHPENDING)
return; return;
tubp->flags |= TUB_BHPENDING; tubp->flags |= TUB_BHPENDING;
INIT_WORK(&tubp->tqueue, fs3270_bh, tubp); tasklet_init(&tubp->tasklet, fs3270_tasklet,
schedule_work(&tubp->tqueue); (unsigned long) tubp);
tasklet_schedule(&tubp->tasklet);
} }
/* /*
...@@ -316,7 +317,7 @@ fs3270_int(tub_t *tubp, devstat_t *dsp) ...@@ -316,7 +317,7 @@ fs3270_int(tub_t *tubp, devstat_t *dsp)
tubp->flags &= ~TUB_WORKING; tubp->flags &= ~TUB_WORKING;
if ((tubp->flags & TUB_WORKING) == 0) if ((tubp->flags & TUB_WORKING) == 0)
fs3270_sched_bh(tubp); fs3270_sched_tasklet(tubp);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment