Skip to content

Commit

Permalink
omap2/3/4: mailbox: use dedicated work queue for handling mailbox rx …
Browse files Browse the repository at this point in the history
…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 <rob@ti.com>
Signed-off-by: C A Subramaniam <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Rob Clark authored and Tony Lindgren committed Feb 23, 2010
1 parent 4499ce4 commit 8250a5c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/arm/plat-omap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <plat/mailbox.h>

static struct workqueue_struct *mboxd;
static struct omap_mbox *mboxes;
static DEFINE_RWLOCK(mboxes_lock);

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 8250a5c

Please sign in to comment.