diff options
authorAngela Stegmaier2016-12-09 16:14:09 -0600
committerAngela Stegmaier2017-01-17 14:46:27 -0600
commit5fd7da53b505e1bc80a0c9d116fe31e5cd177d74 (patch)
tree53fc0f5585beb0ad879797e59889ba3f31a8bbab /libdce_android.c
parentc51f144b079836afb868bff44afe7308248a0217 (diff)
libdce[Android]: Add dce_ipc_recover API
In case of remote core recovery due to remote core crash, the rpmsg-dce handle needs to be closed and re-opened since any handles that were open when the crash happened are marked as stale in the driver. This patch adds a new API that the user can call to close the rpmsg-dce handle so that recovery can happen. In case the user receives notification of a remote core crash, it can call the dce_ipc_recover() API to make sure that the rpmsg-dce handle that is opened during dce_buf_lock is closed so that a new one can be opened the next time. Change-Id: I8ebc19e308ffe7431b57c31cfecd469e171777f6 Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Diffstat (limited to 'libdce_android.c')
1 files changed, 8 insertions, 1 deletions
diff --git a/libdce_android.c b/libdce_android.c
index de6a5c8..0c6065a 100644
--- a/libdce_android.c
+++ b/libdce_android.c
@@ -45,6 +45,7 @@
45extern MmRpc_Handle MmRpcHandle[]; 45extern MmRpc_Handle MmRpcHandle[];
46extern pthread_mutex_t ipc_mutex; 46extern pthread_mutex_t ipc_mutex;
47int is_ipc_ready = 0; 47int is_ipc_ready = 0;
48static int dce_buf_count = 0;
48 49
49int dce_buf_lock(int num, size_t *handle) 50int dce_buf_lock(int num, size_t *handle)
50{ 51{
@@ -113,4 +114,10 @@ EXIT:
113 return (eError); 114 return (eError);
114} 115}
115 116
116 117void dce_ipc_recover(void)
119 if (is_ipc_ready) {
120 dce_ipc_deinit(IPU, -1);
121 is_ipc_ready = 0;
122 }