Skip to contentSkip to conversation

DSPBRIDGE: Remove conditional check from the InputMsg function

PATCH In review Omar Ramirez Luna 3 participants 4 messages Jan 27, 2010 – Feb 1, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DSPBRIDGE: Remove conditional check from the InputMsg function

From: Shivananda Hebbar <[email protected]>

This patch removes the conditional check which can result in message skip.

---
 drivers/dsp/bridge/wmd/io_sm.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/io_sm.c +1 -4
index 39b37a6..b2092a2 100644
@@ -1328,7 +1328,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 	fInputEmpty = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				 bufEmpty);
 	uMsgs = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, size);
-	if (fInputEmpty || uMsgs >= hMsgMgr->uMaxMsgs)
+	if (fInputEmpty)
 		goto func_end;
 
 	pMsgInput = pIOMgr->pMsgInput;
@@ -1356,9 +1356,6 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 		 * input locations have been set up. If all nodes were
 		 * cleaned up, hMsgMgr->uMaxMsgs should be 0.
 		 */
-		if (hMsgQueue && uMsgs > hMsgMgr->uMaxMsgs)
-			goto func_end;
-
 		while (hMsgQueue != NULL) {
 			if (msg.dwId == hMsgQueue->dwId) {
 				/* Found it */
Signature · 1 line
1.6.2.4
#1 lore raw

Hi Shivananda,

Quoted 25 lines · ext Omar Ramirez Luna

From: Shivananda Hebbar <[email protected]>

This patch removes the conditional check which can result in message skip.

---
 drivers/dsp/bridge/wmd/io_sm.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/io_sm.c +1 -1
index 39b37a6..b2092a2 100644
@@ -1328,7 +1328,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 	fInputEmpty = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				 bufEmpty);
 	uMsgs = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, size);
-	if (fInputEmpty || uMsgs >= hMsgMgr->uMaxMsgs)
+	if (fInputEmpty)
 		goto func_end;
 
 	pMsgInput = pIOMgr->pMsgInput;

drivers/dsp/bridge/wmd/io_sm.c static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr) · line 1361

Quoted 9 lines
drivers/dsp/bridge/wmd/io_sm.c +0 -3
@@ -1356,9 +1356,6 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 		 * input locations have been set up. If all nodes were
 		 * cleaned up, hMsgMgr->uMaxMsgs should be 0.
 		 */
-		if (hMsgQueue && uMsgs > hMsgMgr->uMaxMsgs)
-			goto func_end;
-
 		while (hMsgQueue != NULL) {
 			if (msg.dwId == hMsgQueue->dwId) {
 				/* Found it */

Forgive me for the stupid question, but now since uMsgs >= hMsgMgr->uMaxMsgs condition is removed, what is the side effect of that? At least I am not able to understand how it affects the logic just by seeing your patch. I guess if you can modify the patch description to reflect the logic behind this then it will be nice :)

Cheers,
Ameya.

#2 lore raw
Quoted 8 lines

-----Original Message-----
From: Ameya Palande [mailto:[email protected]]
Sent: Wednesday, January 27, 2010 3:44 AM
To: Ramirez Luna, Omar
Cc: linux-omap; Doyu Hiroshi (Nokia-D/Helsinki); Contreras Felipe (Nokia-> >D/Helsinki); Menon, Nishanth; Hebbar, Shivananda
Subject: Re: [PATCH] DSPBRIDGE: Remove conditional check from the InputMsg >function

Hi Shivananda,

Quoted 35 lines · ext Omar Ramirez Luna

From: Shivananda Hebbar <[email protected]>

This patch removes the conditional check which can result in message skip.

---
 drivers/dsp/bridge/wmd/io_sm.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/io_sm.c +1 -4
index 39b37a6..b2092a2 100644
@@ -1328,7 +1328,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 	fInputEmpty = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				 bufEmpty);
 	uMsgs = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, size);
-	if (fInputEmpty || uMsgs >= hMsgMgr->uMaxMsgs)
+	if (fInputEmpty)
 		goto func_end;
 
 	pMsgInput = pIOMgr->pMsgInput;
@@ -1356,9 +1356,6 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 		 * input locations have been set up. If all nodes were
 		 * cleaned up, hMsgMgr->uMaxMsgs should be 0.
 		 */
-		if (hMsgQueue && uMsgs > hMsgMgr->uMaxMsgs)
-			goto func_end;
-
 		while (hMsgQueue != NULL) {
 			if (msg.dwId == hMsgQueue->dwId) {
 				/* Found it */
Quoted 5 lines

Forgive me for the stupid question, but now since uMsgs >= hMsgMgr->uMaxMsgs condition is removed, what is the side effect of that? At least I am not able to understand how it affects the logic just by seeing your patch. I guess if you can modify the patch description to reflect the logic behind this then it will be nice :)

I don't see any side effects with the removal of this conditional check.
Intention of the patch was to remove the redundant check on uMaxMsgs as the DSP side of the bridge code check will ensure that uMsgs can't exceed uMaxMsgs. If you are ok with this explanation, I will update the description and resend it.

And the initial patch description was written with the intention that in case the uMsgs exceeds the uMaxMessages (), then we shouldn't discard it by returning from function but process it.

Regards,
Shivananda

#3 lore raw

Hi Shivananda,

Quoted 55 lines · Shivananda
Quoted 8 lines

-----Original Message-----
From: Ameya Palande [mailto:[email protected]]
Sent: Wednesday, January 27, 2010 3:44 AM
To: Ramirez Luna, Omar
Cc: linux-omap; Doyu Hiroshi (Nokia-D/Helsinki); Contreras Felipe (Nokia-> >D/Helsinki); Menon, Nishanth; Hebbar, Shivananda
Subject: Re: [PATCH] DSPBRIDGE: Remove conditional check from the InputMsg >function

Hi Shivananda,

Quoted 35 lines · ext Omar Ramirez Luna

From: Shivananda Hebbar <[email protected]>

This patch removes the conditional check which can result in message skip.

---
 drivers/dsp/bridge/wmd/io_sm.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/dsp/bridge/wmd/io_sm.c +1 -4
index 39b37a6..b2092a2 100644
@@ -1328,7 +1328,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 	fInputEmpty = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				 bufEmpty);
 	uMsgs = IO_GetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, size);
-	if (fInputEmpty || uMsgs >= hMsgMgr->uMaxMsgs)
+	if (fInputEmpty)
 		goto func_end;
 
 	pMsgInput = pIOMgr->pMsgInput;
@@ -1356,9 +1356,6 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 		 * input locations have been set up. If all nodes were
 		 * cleaned up, hMsgMgr->uMaxMsgs should be 0.
 		 */
-		if (hMsgQueue && uMsgs > hMsgMgr->uMaxMsgs)
-			goto func_end;
-
 		while (hMsgQueue != NULL) {
 			if (msg.dwId == hMsgQueue->dwId) {
 				/* Found it */
Quoted 5 lines

Forgive me for the stupid question, but now since uMsgs >= hMsgMgr->uMaxMsgs condition is removed, what is the side effect of that? At least I am not able to understand how it affects the logic just by seeing your patch. I guess if you can modify the patch description to reflect the logic behind this then it will be nice :)

I don't see any side effects with the removal of this conditional check.
Intention of the patch was to remove the redundant check on uMaxMsgs as the DSP side of the bridge code check will ensure that uMsgs can't exceed uMaxMsgs. If you are ok with this explanation, I will update the description and resend it.

Quoted 5 lines

And the initial patch description was written with the intention that in case the uMsgs exceeds the uMaxMessages (), then we shouldn't discard it by returning from function but process it.

Regards,
Shivananda

Ya! if you can write down the logic in patch description then it will be great!

Cheers,
Ameya.