From patchwork Fri Jun 11 21:17:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guzman Lugo, Fernando" X-Patchwork-Id: 105650 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5BLBFbH013434 for ; Fri, 11 Jun 2010 21:11:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760539Ab0FKVLO (ORCPT ); Fri, 11 Jun 2010 17:11:14 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:41589 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760337Ab0FKVLN (ORCPT ); Fri, 11 Jun 2010 17:11:13 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5BLB87Z014894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 16:11:09 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o5BLB8ZX007195; Fri, 11 Jun 2010 16:11:08 -0500 (CDT) Received: from localhost (x0095840-desktop.am.dhcp.ti.com [128.247.77.44]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o5BLB7P11144; Fri, 11 Jun 2010 16:11:08 -0500 (CDT) From: Fernando Guzman Lugo To: linux-omap@vger.kernel.org Cc: hiroshi.doyu@nokia.com, ohad@wizery.com, Fernando Guzman Lugo Subject: [PATCH] mailbox: change full flag per mailbox queue instead of global Date: Fri, 11 Jun 2010 16:17:59 -0500 Message-Id: <1276291079-14266-1-git-send-email-x0095840@ti.com> X-Mailer: git-send-email 1.6.3.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 11 Jun 2010 21:11:16 +0000 (UTC) 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; }