summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2010-01-04 19:22:03 +0530
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2010-01-06 00:36:03 +0530
commit372181d33497eaa4881617af022871265a20e706 (patch)
tree927bf4ff0b12a72f9351d315829cb0b0392b30b3
parent59c9880a675b42d828a8a238012c4ab440e3090f (diff)
SYSLINK: mailbox - use dedicated work queue for handling mailbox interrupts
keventd_wq is a shared work-queue, and should not be used when we need fast deterministic response. Instead mailbox driver should use it's own private work-queue, with it's own thread, to ensure that handling of RX interrupts are not delayed by other drivers. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: C A Subramaniam <subramaniam.ca@ti.com>
-rw-r--r--arch/arm/plat-omap/mailbox.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index caf01da58123..a435ec82dfa0 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -28,6 +28,7 @@
#include <mach/mailbox.h>
+static struct workqueue_struct *mboxd;
static struct omap_mbox *mboxes;
static DEFINE_RWLOCK(mboxes_lock);
@@ -158,6 +159,7 @@ static void mbox_rx_work(struct work_struct *work)
mbox_msg_t msg;
unsigned long flags;
+
while (1) {
spin_lock_irqsave(q->queue_lock, flags);
rq = blk_fetch_request(q);
@@ -170,6 +172,7 @@ static void mbox_rx_work(struct work_struct *work)
blk_end_request_all(rq, 0);
mbox->rxq->callback((void *)msg);
}
+
}
/*
@@ -187,7 +190,7 @@ static void __mbox_tx_interrupt(struct omap_mbox *mbox)
{
omap_mbox_disable_irq(mbox, IRQ_TX);
ack_mbox_irq(mbox, IRQ_TX);
- schedule_work(&mbox->txq->work);
+ queue_work(mboxd, &mbox->txq->work);
}
static void __mbox_rx_interrupt(struct omap_mbox *mbox)
@@ -212,7 +215,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
/* no more messages in the fifo. clear IRQ source. */
ack_mbox_irq(mbox, IRQ_RX);
nomem:
- schedule_work(&mbox->rxq->work);
+ queue_work(mboxd, &mbox->rxq->work);
}
static irqreturn_t mbox_interrupt(int irq, void *p)
@@ -408,12 +411,17 @@ EXPORT_SYMBOL(omap_mbox_unregister);
static int __init omap_mbox_init(void)
{
+ mboxd = create_workqueue("mboxd");
+ if (!mboxd)
+ return -ENOMEM;
+
return 0;
}
module_init(omap_mbox_init);
static void __exit omap_mbox_exit(void)
{
+ destroy_workqueue(mboxd);
}
module_exit(omap_mbox_exit);