summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorVidhoon Viswanathan <vidhoon@ti.com>2012-05-02 04:59:13 -0700
committerBrijesh Nekkare <b-nekkare@ti.com>2012-06-20 12:54:32 +0530
commit854a8fb23aee9f53cf2107883e7f8b2b00f23945 (patch)
tree731668ce48b0a9612a48aef04ccda61e64485472 /domx
parent0fd4a3e04b0fc58f851f952a39333a29a714fe8b (diff)
downloadhardware_ti_omap4-854a8fb23aee9f53cf2107883e7f8b2b00f23945.zip
hardware_ti_omap4-854a8fb23aee9f53cf2107883e7f8b2b00f23945.tar.gz
hardware_ti_omap4-854a8fb23aee9f53cf2107883e7f8b2b00f23945.tar.bz2
[DOMX]: Fix error handling in RPC_sendPacket_sync
Ducati faulty state is determined by the following inference condition: if(status<0 && errno==ENXIO) { //ducati in faulty state } After write call, errno was checked in wrong manner. Also, write call returns number of bytes written. This patch checks errno in case of write call failure and detects faulty state of ducati. And it uses status == nPacketSize as a tighter condition to validate write call success. Change-Id: I2062e128c4754b0faef2c33ca9465129105ade0c Signed-off-by: Vidhoon Viswanathan <vidhoon@ti.com>
Diffstat (limited to 'domx')
-rwxr-xr-xdomx/omx_rpc/src/omx_rpc_stub.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/domx/omx_rpc/src/omx_rpc_stub.c b/domx/omx_rpc/src/omx_rpc_stub.c
index e650361..0c28ba1 100755
--- a/domx/omx_rpc/src/omx_rpc_stub.c
+++ b/domx/omx_rpc/src/omx_rpc_stub.c
@@ -100,9 +100,13 @@
status = write(hCtx->fd_omx, pPacket, nPacketSize); \
RPC_freePacket(pPacket); \
pPacket = NULL; \
- if(status < 0 ) DOMX_ERROR("DOMX Write failed 0x%x %d",status,status); \
- RPC_assert(status >= 0 && errno != ENXIO, RPC_OMX_ErrorHardware, "Write failed due ducati in faulty state"); \
- RPC_assert(status >= 0, RPC_OMX_ErrorUndefined, "Write failed"); \
+ if(status < 0 && errno == ENXIO) { \
+ RPC_assert(0, RPC_OMX_ErrorHardware, "Write failed - Ducati in faulty state"); \
+ } \
+ if(status != (signed)nPacketSize) { \
+ DOMX_ERROR("Write failed returning status = 0x%x",status); \
+ RPC_assert(0, RPC_OMX_ErrorUndefined, "Write failed"); \
+ } \
eError = TIMM_OSAL_ReadFromPipe(hCtx->pMsgPipe[nFxnIdx], &pRetPacket, \
RPC_MSG_SIZE_FOR_PIPE, (TIMM_OSAL_U32 *)(&nSize), TIMM_OSAL_SUSPEND); \
RPC_assert(eError == TIMM_OSAL_ERR_NONE, eError, \