From patchwork Mon Jun 21 19:36:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Uribe de Leon, Armando" X-Patchwork-Id: 107238 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LJaAUL029925 for ; Mon, 21 Jun 2010 19:36:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758084Ab0FUTgJ (ORCPT ); Mon, 21 Jun 2010 15:36:09 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:35193 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757566Ab0FUTgI convert rfc822-to-8bit (ORCPT ); Mon, 21 Jun 2010 15:36:08 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5LJa31A030353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jun 2010 14:36:03 -0500 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 o5LJa2tP000879; Mon, 21 Jun 2010 14:36:02 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o5LJa2uL004736; Mon, 21 Jun 2010 14:36:02 -0500 (CDT) Received: from dlee04.ent.ti.com ([157.170.170.9]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Mon, 21 Jun 2010 14:36:02 -0500 From: "Uribe de Leon, Armando" To: "linux-omap@vger.kernel.org" CC: "felipe.contreras@nokia.com" , "ameya.palande@nokia.com" , "hiroshi.doyu@nokia.com" Date: Mon, 21 Jun 2010 14:36:02 -0500 Subject: [PATCH] DSPBRIDGE: decrease message pending in case of timeout Thread-Topic: [PATCH] DSPBRIDGE: decrease message pending in case of timeout Thread-Index: AcsRePtizamVBcLlR1SvQ/60a+AQAQ== Message-ID: <67059DBF19D7214F9C66BB0EA91BA90EC32E9FCC@dlee04.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]); Mon, 21 Jun 2010 19:36:10 +0000 (UTC) diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c index b505c5e..d56b46b 100644 --- a/drivers/dsp/bridge/wmd/msg_sm.c +++ b/drivers/dsp/bridge/wmd/msg_sm.c @@ -446,12 +446,16 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, syncs[1] = msg_queue_obj->sync_done; status = sync_wait_on_multiple_events(syncs, 2, utimeout, &index); - if (DSP_FAILED(status)) - goto func_end; /* Enter critical section */ spin_lock_bh(&hmsg_mgr->msg_mgr_lock); + msg_queue_obj->io_msg_pend--; + + if (DSP_FAILED(status)) { + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + goto func_end; + } + if (msg_queue_obj->done) { - msg_queue_obj->io_msg_pend--; /* Exit critical section */ spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); /* Signal that we're not going to access msg_queue_obj @@ -484,7 +488,6 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,