From 8250a5c381cc6714a061a39cfd29d7453e8ad64b Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 4 Jan 2010 19:22:03 +0530 Subject: [PATCH] omap2/3/4: mailbox: use dedicated work queue for handling mailbox rx interrupt 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. The tasklet is still used for transmission of mbox messages. Signed-off-by: Rob Clark Signed-off-by: C A Subramaniam Signed-off-by: Suman Anna Acked-by: Hiroshi DOYU Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/mailbox.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 8e90633e4cb9..4229cec53140 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -28,6 +28,7 @@ #include +static struct workqueue_struct *mboxd; static struct omap_mbox *mboxes; static DEFINE_RWLOCK(mboxes_lock); @@ -188,7 +189,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) @@ -401,12 +402,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); -- 2.39.2