Patchwork [1/3] omap: mailbox: enable mailbox irq per instance

login
register
mail settings
Submitter Gutierrez, Juan
Date April 13, 2012, 9:53 p.m.
Message ID <CADVn9RHhA8ywkLaHDqsTWVDaUkY-kM3GqrCa4pVx=17gBrZFSQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/152401/
State New
Headers show

Comments

Gutierrez, Juan - April 13, 2012, 9:53 p.m.
The machine-specific omap2_mbox_startup is called only once
to initialize the whole mbox module. Enabling mbox irq at
startup is only enabling the irq of the very first mailbox
instance created.

The enable_irq function should be called every time a
new mbox instance is created, in the generic platform
mailbox layer.

Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
---
 arch/arm/mach-omap2/mailbox.c |    2 --
 arch/arm/plat-omap/mailbox.c  |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

--
1.7.5.4

Patch

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 415a6f1..f727034 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -83,8 +83,6 @@  static int omap2_mbox_startup(struct omap_mbox *mbox)
       l = mbox_read_reg(MAILBOX_REVISION);
       pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));

-       omap2_mbox_enable_irq(mbox, IRQ_RX);
-
       return 0;
 }

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index ad32621..ebc1ba5 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -282,6 +282,8 @@  static int omap_mbox_startup(struct omap_mbox *mbox)
               }
               mbox->rxq = mq;
               mq->mbox = mbox;
+
+               mbox->ops->enable_irq(mbox, IRQ_RX);
       }
       mutex_unlock(&mbox_configured_lock);
       return 0;
@@ -305,6 +307,7 @@  static void omap_mbox_fini(struct omap_mbox *mbox)
       mutex_lock(&mbox_configured_lock);

       if (!--mbox->use_count) {
+               mbox->ops->disable_irq(mbox, IRQ_RX);
               free_irq(mbox->irq, mbox);
               tasklet_kill(&mbox->txq->tasklet);
               flush_work_sync(&mbox->rxq->work);