summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2010-01-04 19:22:03 +0530
committerHari Kanigeri <h-kanigeri2@ti.com>2010-03-29 15:17:14 -0600
commitc3d98be0cacf70f8cdc7a4c65ff1c18d172c4071 (patch)
treec0d6bdd32a408b22f6edddd138bde654de3b0e6f /arch
parent31436d84309cba05b73c09c7786ebe2ea833db8b (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. Amended the patch for 2.6.33 migration. The tasklet is used instead of workqueue for transmission of mbox messages. Amended-by: Suman Anna <s-anna@ti.com> Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: C A Subramaniam <subramaniam.ca@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/mailbox.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 3b1ee531d885..573ff76ab8de 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -28,6 +28,7 @@
#include <plat/mailbox.h>
+static struct workqueue_struct *mboxd;
static struct omap_mbox *mboxes;
static DEFINE_RWLOCK(mboxes_lock);
@@ -134,6 +135,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);
@@ -145,6 +147,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_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)
@@ -400,12 +403,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);