summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/mailbox.c
diff options
context:
space:
mode:
authorFernando Guzman Lugo <x0095840@ti.com>2010-11-29 20:24:11 +0000
committerHari Kanigeri <h-kanigeri2@ti.com>2010-12-02 05:43:15 -0600
commitd2295042b783c2b17d93cd5ab786bbfd4f2f5c90 (patch)
tree9213446903c5a541a8b82bee48af273c3f30a88f /arch/arm/plat-omap/mailbox.c
parente8a7e48bb248a1196484d3f8afa53bded2b24e71 (diff)
OMAP: mailbox: change full flag per mailbox queue instead of global
The variable rq_full flag is a global variable, so if there are multiple mailbox users there will be conflicts. Now there is a full flag per mailbox queue. Reported-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com> Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Acked-by: Hiroshi Doyu <hiroshi.doyu@nokia.com>
Diffstat (limited to 'arch/arm/plat-omap/mailbox.c')
-rw-r--r--arch/arm/plat-omap/mailbox.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index d2fafb892f7f..48e161c642a5 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -33,7 +33,6 @@
static struct workqueue_struct *mboxd;
static struct omap_mbox **mboxes;
-static bool rq_full;
static int mbox_configured;
static DEFINE_MUTEX(mbox_configured_lock);
@@ -148,6 +147,12 @@ static void mbox_rx_work(struct work_struct *work)
if (mq->callback)
mq->callback((void *)msg);
+ spin_lock_irq(&mq->lock);
+ if (mq->full) {
+ mq->full = false;
+ omap_mbox_enable_irq(mq->mbox, IRQ_RX);
+ }
+ spin_unlock_irq(&mq->lock);
}
}
@@ -170,7 +175,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
while (!mbox_fifo_empty(mbox)) {
if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
omap_mbox_disable_irq(mbox, IRQ_RX);
- rq_full = true;
+ mq->full = true;
goto nomem;
}