msm: eva: Workaround of EVA ssr failure in DSP UCs
After EVA SSR and shutdown DSP driver, remove all DSP sessions. Change-Id: I23cbd2ab3d5ec8c03ec0f4059be287c28ddb0f9a Signed-off-by: George Shen <quic_sqiao@quicinc.com>
This commit is contained in:
@@ -1296,6 +1296,10 @@ static void __set_queue_hdr_defaults(struct cvp_hfi_queue_header *q_hdr)
|
|||||||
q_hdr->qhdr_write_idx = 0x0;
|
q_hdr->qhdr_write_idx = 0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*Unused, keep for reference
|
||||||
|
*/
|
||||||
|
/*
|
||||||
static void __interface_dsp_queues_release(struct iris_hfi_device *device)
|
static void __interface_dsp_queues_release(struct iris_hfi_device *device)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -1320,6 +1324,7 @@ static void __interface_dsp_queues_release(struct iris_hfi_device *device)
|
|||||||
device->dsp_iface_q_table.align_virtual_addr = NULL;
|
device->dsp_iface_q_table.align_virtual_addr = NULL;
|
||||||
device->dsp_iface_q_table.align_device_addr = 0;
|
device->dsp_iface_q_table.align_device_addr = 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
static int __interface_dsp_queues_init(struct iris_hfi_device *dev)
|
static int __interface_dsp_queues_init(struct iris_hfi_device *dev)
|
||||||
{
|
{
|
||||||
@@ -1338,6 +1343,11 @@ static int __interface_dsp_queues_init(struct iris_hfi_device *dev)
|
|||||||
q_size = ALIGN(QUEUE_SIZE, SZ_1M);
|
q_size = ALIGN(QUEUE_SIZE, SZ_1M);
|
||||||
mem_data = &dev->dsp_iface_q_table.mem_data;
|
mem_data = &dev->dsp_iface_q_table.mem_data;
|
||||||
|
|
||||||
|
if (mem_data->kvaddr) {
|
||||||
|
memset((void *)mem_data->kvaddr, 0, q_size);
|
||||||
|
cvp_dsp_init_hfi_queue_hdr(dev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/* Allocate dsp queues from CDSP device memory */
|
/* Allocate dsp queues from CDSP device memory */
|
||||||
kvaddr = dma_alloc_coherent(dev->res->mem_cdsp.dev, q_size,
|
kvaddr = dma_alloc_coherent(dev->res->mem_cdsp.dev, q_size,
|
||||||
&dma_handle, GFP_KERNEL);
|
&dma_handle, GFP_KERNEL);
|
||||||
@@ -1454,7 +1464,6 @@ static void __interface_queues_release(struct iris_hfi_device *device)
|
|||||||
device->mem_addr.align_virtual_addr = NULL;
|
device->mem_addr.align_virtual_addr = NULL;
|
||||||
device->mem_addr.align_device_addr = 0;
|
device->mem_addr.align_device_addr = 0;
|
||||||
#endif
|
#endif
|
||||||
__interface_dsp_queues_release(device);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __get_qdss_iommu_virtual_addr(struct iris_hfi_device *dev,
|
static int __get_qdss_iommu_virtual_addr(struct iris_hfi_device *dev,
|
||||||
|
@@ -260,10 +260,6 @@ static int delete_dsp_session(struct msm_cvp_inst *inst,
|
|||||||
|
|
||||||
mutex_unlock(&buf_list->lock);
|
mutex_unlock(&buf_list->lock);
|
||||||
|
|
||||||
rc = msm_cvp_session_delete(inst);
|
|
||||||
if (rc)
|
|
||||||
dprintk(CVP_ERR, "Warning: send Delete Session failed\n");
|
|
||||||
|
|
||||||
task = inst->task;
|
task = inst->task;
|
||||||
|
|
||||||
spin_lock(&inst->core->resources.pm_qos.lock);
|
spin_lock(&inst->core->resources.pm_qos.lock);
|
||||||
@@ -496,6 +492,47 @@ exit:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cvp_remove_dsp_process_sess(
|
||||||
|
struct cvp_dsp_fastrpc_driver_entry *frpc_node)
|
||||||
|
{
|
||||||
|
struct msm_cvp_inst *inst = NULL;
|
||||||
|
struct list_head *s = NULL, *next_s = NULL;
|
||||||
|
|
||||||
|
s = &frpc_node->dsp_sessions.list;
|
||||||
|
list_for_each_safe(s, next_s, &frpc_node->dsp_sessions.list) {
|
||||||
|
inst = list_entry(s, struct msm_cvp_inst, dsp_list);
|
||||||
|
delete_dsp_session(inst, frpc_node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cvp_remove_dsp_sessions(void)
|
||||||
|
{
|
||||||
|
struct cvp_dsp_apps *me = &gfa_cv;
|
||||||
|
struct cvp_dsp_fastrpc_driver_entry *frpc_node = NULL;
|
||||||
|
struct list_head *ptr = NULL, *next = NULL;
|
||||||
|
|
||||||
|
dprintk(CVP_WARN, "%s: EVA SSR triggered, clean cdsp eva sessions\n",
|
||||||
|
__func__);
|
||||||
|
|
||||||
|
ptr = &me->fastrpc_driver_list.list;
|
||||||
|
mutex_lock(&me->fastrpc_driver_list.lock);
|
||||||
|
list_for_each_safe(ptr, next, &me->fastrpc_driver_list.list) {
|
||||||
|
frpc_node = list_entry(ptr,
|
||||||
|
struct cvp_dsp_fastrpc_driver_entry, list);
|
||||||
|
if (frpc_node) {
|
||||||
|
cvp_remove_dsp_process_sess(frpc_node);
|
||||||
|
list_del(&frpc_node->list);
|
||||||
|
__fastrpc_driver_unregister(&frpc_node->cvp_fastrpc_driver);
|
||||||
|
mutex_lock(&me->driver_name_lock);
|
||||||
|
eva_fastrpc_driver_release_name(frpc_node);
|
||||||
|
mutex_unlock(&me->driver_name_lock);
|
||||||
|
kfree(frpc_node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mutex_unlock(&me->fastrpc_driver_list.lock);
|
||||||
|
dprintk(CVP_WARN, "%s: EVA SSR handled for CDSP\n", __func__);
|
||||||
|
}
|
||||||
|
|
||||||
int cvp_dsp_shutdown(uint32_t session_flag)
|
int cvp_dsp_shutdown(uint32_t session_flag)
|
||||||
{
|
{
|
||||||
struct cvp_dsp_apps *me = &gfa_cv;
|
struct cvp_dsp_apps *me = &gfa_cv;
|
||||||
@@ -769,6 +806,11 @@ static int __reinit_dsp(void)
|
|||||||
rc = cvp_dsp_shutdown(flag);
|
rc = cvp_dsp_shutdown(flag);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
/*
|
||||||
|
* Workaround to force delete DSP session resources
|
||||||
|
* To be removed after DSP optimization ready
|
||||||
|
*/
|
||||||
|
cvp_remove_dsp_sessions();
|
||||||
|
|
||||||
/* Resend HFI queue */
|
/* Resend HFI queue */
|
||||||
mutex_lock(&me->tx_lock);
|
mutex_lock(&me->tx_lock);
|
||||||
@@ -1435,13 +1477,6 @@ static void __dsp_cvp_sess_delete(struct cvp_dsp_cmd_msg *cmd)
|
|||||||
goto dsp_fail_delete;
|
goto dsp_fail_delete;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = msm_cvp_session_delete(inst);
|
|
||||||
if (rc) {
|
|
||||||
dprintk(CVP_ERR, "Warning: send Delete Session failed\n");
|
|
||||||
cmd->ret = -1;
|
|
||||||
goto dsp_fail_delete;
|
|
||||||
}
|
|
||||||
|
|
||||||
task = inst->task;
|
task = inst->task;
|
||||||
|
|
||||||
spin_lock(&inst->core->resources.pm_qos.lock);
|
spin_lock(&inst->core->resources.pm_qos.lock);
|
||||||
|
Reference in New Issue
Block a user