diff mbox

mailbox: change full flag per mailbox queue instead of global

Message ID 1276291079-14266-1-git-send-email-x0095840@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Guzman Lugo, Fernando June 11, 2010, 9:17 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index 729166b..a6144b8 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -47,6 +47,7 @@  struct omap_mbox_queue {
 	struct tasklet_struct	tasklet;
 	int	(*callback)(void *);
 	struct omap_mbox	*mbox;
+	bool	full;
 };
 
 struct omap_mbox {
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 8d86b0b..a1e274e 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -30,7 +30,6 @@ 
 
 static struct omap_mbox *mboxes;
 static DEFINE_RWLOCK(mboxes_lock);
-static bool rq_full;
 
 static int mbox_configured;
 static DEFINE_MUTEX(mbox_configured_lock);
@@ -140,9 +139,9 @@  static void mbox_rx_work(struct work_struct *work)
 	while (1) {
 		spin_lock_irqsave(q->queue_lock, flags);
 		rq = blk_fetch_request(q);
-		if (rq_full) {
+		if (mbox->rxq->full) {
 			omap_mbox_enable_irq(mbox, IRQ_RX);
-			rq_full = false;
+			mbox->rxq->full = false;
 		}
 		spin_unlock_irqrestore(q->queue_lock, flags);
 		if (!rq)
@@ -183,7 +182,7 @@  static void __mbox_rx_interrupt(struct omap_mbox *mbox)
 		rq = blk_get_request(q, WRITE, GFP_ATOMIC);
 		if (unlikely(!rq)) {
 			omap_mbox_disable_irq(mbox, IRQ_RX);
-			rq_full = true;
+			mbox->rxq->full = true;
 			goto nomem;
 		}