aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Guzman Lugo <x0095840@ti.com>2010-11-29 15:24:11 -0500
committerHari Kanigeri <h-kanigeri2@ti.com>2010-12-02 06:43:15 -0500
commitd2295042b783c2b17d93cd5ab786bbfd4f2f5c90 (patch)
tree9213446903c5a541a8b82bee48af273c3f30a88f
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>
-rw-r--r--arch/arm/plat-omap/include/plat/mailbox.h1
-rw-r--r--arch/arm/plat-omap/mailbox.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index 997656552109..13f2ef3ea0ff 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -48,6 +48,7 @@ struct omap_mbox_queue {
48 struct tasklet_struct tasklet; 48 struct tasklet_struct tasklet;
49 int (*callback)(void *); 49 int (*callback)(void *);
50 struct omap_mbox *mbox; 50 struct omap_mbox *mbox;
51 bool full;
51}; 52};
52 53
53struct omap_mbox { 54struct omap_mbox {
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 @@
33 33
34static struct workqueue_struct *mboxd; 34static struct workqueue_struct *mboxd;
35static struct omap_mbox **mboxes; 35static struct omap_mbox **mboxes;
36static bool rq_full;
37 36
38static int mbox_configured; 37static int mbox_configured;
39static DEFINE_MUTEX(mbox_configured_lock); 38static DEFINE_MUTEX(mbox_configured_lock);
@@ -148,6 +147,12 @@ static void mbox_rx_work(struct work_struct *work)
148 147
149 if (mq->callback) 148 if (mq->callback)
150 mq->callback((void *)msg); 149 mq->callback((void *)msg);
150 spin_lock_irq(&mq->lock);
151 if (mq->full) {
152 mq->full = false;
153 omap_mbox_enable_irq(mq->mbox, IRQ_RX);
154 }
155 spin_unlock_irq(&mq->lock);
151 } 156 }
152} 157}
153 158
@@ -170,7 +175,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
170 while (!mbox_fifo_empty(mbox)) { 175 while (!mbox_fifo_empty(mbox)) {
171 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) { 176 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
172 omap_mbox_disable_irq(mbox, IRQ_RX); 177 omap_mbox_disable_irq(mbox, IRQ_RX);
173 rq_full = true; 178 mq->full = true;
174 goto nomem; 179 goto nomem;
175 } 180 }
176 181