aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-01-26 06:12:50 -0500
committerTejun Heo <tj@kernel.org>2011-01-26 06:12:50 -0500
commitc48730056f69db30c075236f4ee2bc9d3f4f9985 (patch)
treebfab5ff0e416b9b17948f18024d2519be7453b55
parentada609ee2ac2e03bd8abb07f9b3e92cd2e650f19 (diff)
arm/omap: use system_wq in mailbox
With cmwq, there's no reason to use a separate workqueue for mailbox. Use the system_wq instead. mbox->rxq->work is sync flushed in omap_mbox_fini() to make sure it's not running on any cpu, which makes sure that no mbox work is running when omap_mbox_exit() is entered. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Hari Kanigeri <hari.kanigeri@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Cc: linux-omap@vger.kernel.org
-rw-r--r--arch/arm/plat-omap/mailbox.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 459b319a9fad..4c9d44c4db48 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -32,7 +32,6 @@
32 32
33#include <plat/mailbox.h> 33#include <plat/mailbox.h>
34 34
35static struct workqueue_struct *mboxd;
36static struct omap_mbox **mboxes; 35static struct omap_mbox **mboxes;
37 36
38static int mbox_configured; 37static int mbox_configured;
@@ -197,7 +196,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
197 /* no more messages in the fifo. clear IRQ source. */ 196 /* no more messages in the fifo. clear IRQ source. */
198 ack_mbox_irq(mbox, IRQ_RX); 197 ack_mbox_irq(mbox, IRQ_RX);
199nomem: 198nomem:
200 queue_work(mboxd, &mbox->rxq->work); 199 schedule_work(&mbox->rxq->work);
201} 200}
202 201
203static irqreturn_t mbox_interrupt(int irq, void *p) 202static irqreturn_t mbox_interrupt(int irq, void *p)
@@ -307,7 +306,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
307 if (!--mbox->use_count) { 306 if (!--mbox->use_count) {
308 free_irq(mbox->irq, mbox); 307 free_irq(mbox->irq, mbox);
309 tasklet_kill(&mbox->txq->tasklet); 308 tasklet_kill(&mbox->txq->tasklet);
310 flush_work(&mbox->rxq->work); 309 flush_work_sync(&mbox->rxq->work);
311 mbox_queue_free(mbox->txq); 310 mbox_queue_free(mbox->txq);
312 mbox_queue_free(mbox->rxq); 311 mbox_queue_free(mbox->rxq);
313 } 312 }
@@ -406,10 +405,6 @@ static int __init omap_mbox_init(void)
406 if (err) 405 if (err)
407 return err; 406 return err;
408 407
409 mboxd = create_workqueue("mboxd");
410 if (!mboxd)
411 return -ENOMEM;
412
413 /* kfifo size sanity check: alignment and minimal size */ 408 /* kfifo size sanity check: alignment and minimal size */
414 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t)); 409 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
415 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, 410 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
@@ -421,7 +416,6 @@ subsys_initcall(omap_mbox_init);
421 416
422static void __exit omap_mbox_exit(void) 417static void __exit omap_mbox_exit(void)
423{ 418{
424 destroy_workqueue(mboxd);
425 class_unregister(&omap_mbox_class); 419 class_unregister(&omap_mbox_class);
426} 420}
427module_exit(omap_mbox_exit); 421module_exit(omap_mbox_exit);