diff mbox

DSPBRIDGE: Fix to avoid possible recursive locking

Message ID 1265763677-7012-1-git-send-email-deepak.chitriki@ti.com (mailing list archive)
State Not Applicable
Delegated to:
Headers show

Commit Message

Deepak Chitriki Feb. 10, 2010, 1:01 a.m. UTC
None
diff mbox

Patch

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 */