From patchwork Wed Feb 10 01:01:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Chitriki X-Patchwork-Id: 78237 X-Patchwork-Delegate: omar.ramirez@ti.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 o1A11cYW005042 for ; Wed, 10 Feb 2010 01:01:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858Ab0BJBBh (ORCPT ); Tue, 9 Feb 2010 20:01:37 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:55284 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754203Ab0BJBBg (ORCPT ); Tue, 9 Feb 2010 20:01:36 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1A11YQW014627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Feb 2010 19:01:34 -0600 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 o1A11YuM006064; Tue, 9 Feb 2010 19:01:34 -0600 (CST) Received: from soldel-laptop (soldel-laptop.am.dhcp.ti.com [128.247.79.63]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o1A11XZ25641; Tue, 9 Feb 2010 19:01:33 -0600 (CST) Received: by soldel-laptop (Postfix, from userid 1000) id 3340A606040; Tue, 9 Feb 2010 19:01:34 -0600 (CST) From: Deepak Chitriki To: linux-omap Cc: Deepak Chitriki , Ameya Palande , Omar Ramirez Luna , Nishanth Menon Subject: [PATCH] DSPBRIDGE: Fix to avoid possible recursive locking Date: Tue, 9 Feb 2010 19:01:17 -0600 Message-Id: <1265763677-7012-1-git-send-email-deepak.chitriki@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]); Wed, 10 Feb 2010 01:01:40 +0000 (UTC) diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c index 50201e5..8faf5ad 100644 --- a/drivers/dsp/bridge/wmd/msg_sm.c +++ b/drivers/dsp/bridge/wmd/msg_sm.c @@ -300,8 +300,10 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue, if (LST_IsEmpty(hMsgQueue->msgUsedList)) SYNC_ResetEvent(hMsgQueue->hSyncEvent); else { + (void)SYNC_LeaveCS(hMsgMgr->hSyncCS); NTFY_Notify(hMsgQueue->hNtfy, DSP_NODEMESSAGEREADY); + (void)SYNC_EnterCS(hMsgMgr->hSyncCS); SYNC_SetEvent(hMsgQueue->hSyncEvent); } @@ -352,8 +354,10 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue, hMsgQueue->refCount--; /* Reset the event if there are still queued messages */ if (!LST_IsEmpty(hMsgQueue->msgUsedList)) { + (void)SYNC_LeaveCS(hMsgMgr->hSyncCS); NTFY_Notify(hMsgQueue->hNtfy, DSP_NODEMESSAGEREADY); + (void)SYNC_EnterCS(hMsgMgr->hSyncCS); SYNC_SetEvent(hMsgQueue->hSyncEvent); } /* Exit critical section */