summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorPradeep Venkatasubbarao <pradeepv@ti.com>2011-11-18 20:25:39 +0530
committerPradeep Venkatasubbarao <pradeepv@ti.com>2011-11-18 20:25:39 +0530
commit23f31fbc7f6165002655b7bb324ce71076d03705 (patch)
treeafa56f63586b448180162ab4c35cc77935189596 /domx
parent52506c529528f396dde36e6f1976e494207963cf (diff)
downloadhardware_ti_omap4-23f31fbc7f6165002655b7bb324ce71076d03705.zip
hardware_ti_omap4-23f31fbc7f6165002655b7bb324ce71076d03705.tar.gz
hardware_ti_omap4-23f31fbc7f6165002655b7bb324ce71076d03705.tar.bz2
Enable Secure-component call into Misc driver
Change-Id: If2cb2f7744967df6632dd097bd5a9576cf4f9718 Signed-off-by: Sarthak Aggarwal <sarthak@ti.com> Conflicts: domx/omx_proxy_common.h
Diffstat (limited to 'domx')
-rwxr-xr-xdomx/omx_proxy_common.h1
-rwxr-xr-xdomx/omx_rpc/src/omx_rpc.c22
2 files changed, 18 insertions, 5 deletions
diff --git a/domx/omx_proxy_common.h b/domx/omx_proxy_common.h
index 9bd50f4..3d146a0 100755
--- a/domx/omx_proxy_common.h
+++ b/domx/omx_proxy_common.h
@@ -238,6 +238,7 @@ extern "C"
#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
DebugFrame_Dump debugframeInfo;
#endif
+ int secure_misc_drv_fd;
} PROXY_COMPONENT_PRIVATE;
diff --git a/domx/omx_rpc/src/omx_rpc.c b/domx/omx_rpc/src/omx_rpc.c
index 4e5dacf..0743491 100755
--- a/domx/omx_rpc/src/omx_rpc.c
+++ b/domx/omx_rpc/src/omx_rpc.c
@@ -72,7 +72,7 @@
#define RPC_MSGPIPE_SIZE (4)
#define RPC_MSG_SIZE_FOR_PIPE (sizeof(OMX_PTR))
-
+#define MAX_ATTEMPTS 15
#define RPC_getPacket(nPacketSize, pPacket) do { \
pPacket = TIMM_OSAL_Malloc(nPacketSize, TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT); \
@@ -108,7 +108,7 @@ RPC_OMX_ERRORTYPE RPC_InstanceInit(OMX_STRING cComponentName,
OMX_S32 status = 0;
struct omx_conn_req sReq = { .name = "OMX" };
TIMM_OSAL_ERRORTYPE eError = TIMM_OSAL_ERR_NONE;
- OMX_U32 i = 0;
+ OMX_U32 i = 0, nAttempts = 0;
*(RPC_OMX_CONTEXT **) phRPCCtx = NULL;
@@ -126,9 +126,21 @@ RPC_OMX_ERRORTYPE RPC_InstanceInit(OMX_STRING cComponentName,
/*Assuming that open maintains an internal count for multi instance */
DOMX_DEBUG("Calling open on the device");
- pRPCCtx->fd_omx = open("/dev/rpmsg-omx1", O_RDWR);
- RPC_assert(pRPCCtx->fd_omx >= 0, RPC_OMX_ErrorInsufficientResources,
- "Can't open device");
+ while (1)
+ {
+ pRPCCtx->fd_omx = open("/dev/rpmsg-omx1", O_RDWR);
+ if(pRPCCtx->fd_omx >= 0 || errno != ENOENT || nAttempts == MAX_ATTEMPTS)
+ break;
+ DOMX_DEBUG("errno from open= %d, REATTEMPTING OPEN!!!!",errno);
+ nAttempts++;
+ usleep(1000000);
+ }
+ if(pRPCCtx->fd_omx < 0)
+ {
+ DOMX_ERROR("Can't open device, errorno from open = %d",errno);
+ eError = RPC_OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
DOMX_DEBUG("Open was successful, pRPCCtx->fd_omx = %d",
pRPCCtx->fd_omx);
//AD