Skip to contentSkip to conversation

DSPBRIDGE: Fix to avoid possible recursive locking

PATCH Superseded Deepak Chitriki 2 participants 2 messages Feb 11, 2010

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 DSPBRIDGE: Fix to avoid possible recursive locking

Removed NTFY_Notify() in WMD_MSG_Get() to avoid locking contention as NTFY_Notify() is already invoked in InputMsg().

Cc Ameya Palande <[email protected]>
Cc Omar Ramirez Luna <[email protected]>
Cc Nishanth Menon <[email protected]>

---
Ref:
v0:http://marc.info/?l=linux-omap&m=126584779011493&w=2 v1:http://marc.info/?l=linux-omap&m=126586224627725&w=2 v2:http://marc.info/?l=linux-omap&m=126591341909124&w=2 v3:Comment fixes from v2

 drivers/dsp/bridge/wmd/msg_sm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/msg_sm.c +3 -4
index 7de3705..7414113 100644
@@ -295,9 +295,8 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue,
 				   (struct list_head *)pMsgFrame);
 			if (LST_IsEmpty(hMsgQueue->msgUsedList))
 				SYNC_ResetEvent(hMsgQueue->hSyncEvent);
-			else {
+			else
 				SYNC_SetEvent(hMsgQueue->hSyncEvent);
-			}
 
 			fGotMsg = true;
 		}
@@ -345,9 +344,9 @@ 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)) {
+			if (!LST_IsEmpty(hMsgQueue->msgUsedList))
 				SYNC_SetEvent(hMsgQueue->hSyncEvent);
-			}
+
 			/* Exit critical section */
 			(void)SYNC_LeaveCS(hMsgMgr->hSyncCS);
 		}
Signature · 1 line
1.6.3.3
#1 lore raw

Hi Deepak,

I can't see NTFY_Notify() getting removed in this patch :( It is just removing braces around if and else!

Cheers,
Ameya.
________________________________________
From: ext Deepak Chitriki [[email protected]]
Sent: Thursday, February 11, 2010 9:22 PM
To: linux-omap
Cc: Deepak Chitriki; Palande Ameya (Nokia-D/Helsinki); Omar Ramirez Luna; Nishanth Menon
Subject: [PATCH v3] DSPBRIDGE: Fix to avoid possible recursive locking

Removed NTFY_Notify() in WMD_MSG_Get() to avoid locking contention as NTFY_Notify() is already invoked in InputMsg().

Cc Ameya Palande <[email protected]>
Cc Omar Ramirez Luna <[email protected]>
Cc Nishanth Menon <[email protected]>

---
Ref:
v0:http://marc.info/?l=linux-omap&m=126584779011493&w=2 v1:http://marc.info/?l=linux-omap&m=126586224627725&w=2 v2:http://marc.info/?l=linux-omap&m=126591341909124&w=2 v3:Comment fixes from v2

 drivers/dsp/bridge/wmd/msg_sm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/msg_sm.c +3 -4
index 7de3705..7414113 100644
@@ -295,9 +295,8 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue,
                                   (struct list_head *)pMsgFrame);
                        if (LST_IsEmpty(hMsgQueue->msgUsedList))
                                SYNC_ResetEvent(hMsgQueue->hSyncEvent);
-                       else {
+                       else
                                SYNC_SetEvent(hMsgQueue->hSyncEvent);
-                       }
 
                        fGotMsg = true;
                }
@@ -345,9 +344,9 @@ 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)) {
+                       if (!LST_IsEmpty(hMsgQueue->msgUsedList))
                                SYNC_SetEvent(hMsgQueue->hSyncEvent);
-                       }
+
                        /* Exit critical section */
                        (void)SYNC_LeaveCS(hMsgMgr->hSyncCS);
                }

--
1.6.3.3