|
@@ -337,6 +337,7 @@ static void cvp_dsp_rpmsg_remove(struct rpmsg_device *rpdev)
|
|
mutex_unlock(&me->tx_lock);
|
|
mutex_unlock(&me->tx_lock);
|
|
|
|
|
|
ptr = &me->fastrpc_driver_list.list;
|
|
ptr = &me->fastrpc_driver_list.list;
|
|
|
|
+ mutex_lock(&me->fastrpc_driver_list.lock);
|
|
list_for_each_safe(ptr, next, &me->fastrpc_driver_list.list) {
|
|
list_for_each_safe(ptr, next, &me->fastrpc_driver_list.list) {
|
|
frpc_node = list_entry(ptr,
|
|
frpc_node = list_entry(ptr,
|
|
struct cvp_dsp_fastrpc_driver_entry, list);
|
|
struct cvp_dsp_fastrpc_driver_entry, list);
|
|
@@ -368,7 +369,7 @@ static void cvp_dsp_rpmsg_remove(struct rpmsg_device *rpdev)
|
|
frpc_node = NULL;
|
|
frpc_node = NULL;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ mutex_unlock(&me->fastrpc_driver_list.lock);
|
|
dprintk(CVP_WARN, "%s: CDSP SSR handled\n", __func__);
|
|
dprintk(CVP_WARN, "%s: CDSP SSR handled\n", __func__);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1023,6 +1024,7 @@ static int eva_fastrpc_driver_register(uint32_t handle)
|
|
struct cvp_dsp_apps *me = &gfa_cv;
|
|
struct cvp_dsp_apps *me = &gfa_cv;
|
|
int rc = 0;
|
|
int rc = 0;
|
|
struct cvp_dsp_fastrpc_driver_entry *frpc_node = NULL;
|
|
struct cvp_dsp_fastrpc_driver_entry *frpc_node = NULL;
|
|
|
|
+ bool skip_deregister = true;
|
|
|
|
|
|
dprintk(CVP_DSP, "%s -> cvp_find_fastrpc_node_with_handle pid 0x%x\n",
|
|
dprintk(CVP_DSP, "%s -> cvp_find_fastrpc_node_with_handle pid 0x%x\n",
|
|
__func__, handle);
|
|
__func__, handle);
|
|
@@ -1067,6 +1069,7 @@ static int eva_fastrpc_driver_register(uint32_t handle)
|
|
if (rc) {
|
|
if (rc) {
|
|
dprintk(CVP_ERR, "%s fastrpc driver reg fail err %d\n",
|
|
dprintk(CVP_ERR, "%s fastrpc driver reg fail err %d\n",
|
|
__func__, rc);
|
|
__func__, rc);
|
|
|
|
+ skip_deregister = true;
|
|
goto fail_fastrpc_driver_register;
|
|
goto fail_fastrpc_driver_register;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1076,7 +1079,8 @@ static int eva_fastrpc_driver_register(uint32_t handle)
|
|
msecs_to_jiffies(CVP_DSP_RESPONSE_TIMEOUT))) {
|
|
msecs_to_jiffies(CVP_DSP_RESPONSE_TIMEOUT))) {
|
|
dprintk(CVP_ERR, "%s fastrpc driver_register timeout\n",
|
|
dprintk(CVP_ERR, "%s fastrpc driver_register timeout\n",
|
|
__func__);
|
|
__func__);
|
|
- goto fail_fastrpc_driver_timeout;
|
|
|
|
|
|
+ skip_deregister = false;
|
|
|
|
+ goto fail_fastrpc_driver_register;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
dprintk(CVP_DSP, "%s fastrpc probe hndl %pK pid 0x%x\n",
|
|
dprintk(CVP_DSP, "%s fastrpc probe hndl %pK pid 0x%x\n",
|
|
@@ -1085,14 +1089,15 @@ static int eva_fastrpc_driver_register(uint32_t handle)
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
-fail_fastrpc_driver_timeout:
|
|
|
|
- __fastrpc_driver_unregister(&frpc_node->cvp_fastrpc_driver);
|
|
|
|
fail_fastrpc_driver_register:
|
|
fail_fastrpc_driver_register:
|
|
/* remove list if this is the last session */
|
|
/* remove list if this is the last session */
|
|
mutex_lock(&me->fastrpc_driver_list.lock);
|
|
mutex_lock(&me->fastrpc_driver_list.lock);
|
|
list_del(&frpc_node->list);
|
|
list_del(&frpc_node->list);
|
|
mutex_unlock(&me->fastrpc_driver_list.lock);
|
|
mutex_unlock(&me->fastrpc_driver_list.lock);
|
|
|
|
|
|
|
|
+ if (!skip_deregister)
|
|
|
|
+ __fastrpc_driver_unregister(&frpc_node->cvp_fastrpc_driver);
|
|
|
|
+
|
|
mutex_lock(&me->driver_name_lock);
|
|
mutex_lock(&me->driver_name_lock);
|
|
eva_fastrpc_driver_release_name(frpc_node);
|
|
eva_fastrpc_driver_release_name(frpc_node);
|
|
mutex_unlock(&me->driver_name_lock);
|
|
mutex_unlock(&me->driver_name_lock);
|