From patchwork Thu Feb 18 07:10:19 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: 80214 X-Patchwork-Delegate: tony@atomide.com 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 o1I7AVux025872 for ; Thu, 18 Feb 2010 07:10:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752522Ab0BRHKa (ORCPT ); Thu, 18 Feb 2010 02:10:30 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:39190 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751867Ab0BRHKa convert rfc822-to-8bit (ORCPT ); Thu, 18 Feb 2010 02:10:30 -0500 Received: from dlep33.itg.ti.com ([157.170.170.112]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1I7ALeL014943 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 01:10:21 -0600 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o1I7ALTx008203; Thu, 18 Feb 2010 01:10:21 -0600 (CST) Received: from dlee75.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o1I7ALIV006896; Thu, 18 Feb 2010 01:10:21 -0600 (CST) Received: from dlee06.ent.ti.com ([157.170.170.11]) by dlee75.ent.ti.com ([157.170.170.72]) with mapi; Thu, 18 Feb 2010 01:10:20 -0600 From: "Guzman Lugo, Fernando" To: "linux-omap@vger.kernel.org" CC: "linux-arm-kernel@lists.infradead.org" , Hiroshi DOYU Date: Thu, 18 Feb 2010 01:10:19 -0600 Subject: [PATCH v2 5/5] Mailbox: disable mailbox interrupt when request queue Thread-Topic: [PATCH v2 5/5] Mailbox: disable mailbox interrupt when request queue Thread-Index: AcqwaW4HLf+Dlb7KR+Oe2fdhoaowQQ== Message-ID: <496565EC904933469F292DDA3F1663E602CA2B9B2F@dlee06.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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]); Thu, 18 Feb 2010 07:10:31 +0000 (UTC) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 8ecb837..8d86b0b 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -30,6 +30,7 @@ static struct omap_mbox *mboxes; static DEFINE_RWLOCK(mboxes_lock); +static bool rq_full; static int mbox_configured; static DEFINE_MUTEX(mbox_configured_lock); @@ -139,6 +140,10 @@ 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) { + omap_mbox_enable_irq(mbox, IRQ_RX); + rq_full = false; + } spin_unlock_irqrestore(q->queue_lock, flags); if (!rq) break; @@ -176,8 +181,11 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox) while (!mbox_fifo_empty(mbox)) { rq = blk_get_request(q, WRITE, GFP_ATOMIC); - if (unlikely(!rq)) + if (unlikely(!rq)) { + omap_mbox_disable_irq(mbox, IRQ_RX); + rq_full = true; goto nomem; + } msg = mbox_fifo_read(mbox);