[OMAPZOOM][PATCH 6/6] DSPBRIDGE: Avoid kill task command when dsp crashed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Omar Ramirez Luna <x00omar@xxxxxx>
Date: Wed, 28 Jan 2009 19:11:45 -0600
Subject: [PATCH] DSPBRIDGE: Avoid kill task command when dsp crashed

Node_Terminate will not attempt to send a kill task
message if DSP is already in error state.

Signed-off-by: Omar Ramirez Luna <x00omar@xxxxxx>
---
 drivers/dsp/bridge/rmgr/node.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index 61f5d14..31d8de9 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -2667,6 +2667,7 @@ DSP_STATUS NODE_Terminate(struct NODE_OBJECT *hNode, OUT DSP_STATUS *pStatus)
 	DSP_STATUS status = DSP_SOK;
 	u32 procId, killTimeOut;
 	struct DEH_MGR *hDehMgr;
+	struct DSP_PROCESSORSTATE procStatus;
 
 	DBC_Require(cRefs > 0);
 	DBC_Require(pStatus != NULL);
@@ -2720,6 +2721,20 @@ DSP_STATUS NODE_Terminate(struct NODE_OBJECT *hNode, OUT DSP_STATUS *pStatus)
 		 */
 		GT_1trace(NODE_debugMask, GT_5CLASS,
 			 "NODE_Terminate: env = 0x%x\n", hNode->nodeEnv);
+
+		status = PROC_GetState(pNode->hProcessor, &procStatus,
+					sizeof(struct DSP_PROCESSORSTATE));
+		if (DSP_FAILED(status))
+			goto func_cont;
+		/* If processor is in error state then don't attempt to send
+		 * A kill task command */
+		if (procStatus.iState == PROC_ERROR) {
+			GT_1trace(NODE_debugMask, GT_4CLASS, "NODE_Terminate:"
+				" proc Status 0x%x\n", procStatus.iState);
+			status = DSP_EFAIL;
+			goto func_cont;
+		}
+
 		msg.dwCmd = RMS_EXIT;
 		msg.dwArg1 = hNode->nodeEnv;
 		killmsg.dwCmd = RMS_KILLTASK;
@@ -2771,6 +2786,7 @@ DSP_STATUS NODE_Terminate(struct NODE_OBJECT *hNode, OUT DSP_STATUS *pStatus)
 				status = DSP_SOK;
 		}
 	}
+func_cont:
 	if (DSP_SUCCEEDED(status)) {
 		/* Enter CS before getting exit status, in case node was
 		 * deleted. */
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux