video: driver: handle core_init failure in probe sequence

component bind cb is called from last bound subdevice context,
so if core init fails then i.e treated subdevice probe failure
and leading to undefined behaviour in protect_cp_mem() sequence
during fw_load(). So treat core_init failure as non-fatal since
it will be attmepted again during session_open.

Due to async-probe subdevice probe is called in parallel threads
so use core_lock() while populating context-bank entries into
&core->dt->context_banks list.

Change-Id: I45a891dbe589cfd011108365094b543202c0291e
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
这个提交包含在:
Govindaraj Rajagopal
2022-07-25 17:51:06 +05:30
提交者 Gerrit - the friendly Code Review server
父节点 ce4198e97f
当前提交 04ebbb2c2a
修改 3 个文件,包含 15 行新增6 行删除

查看文件

@@ -843,8 +843,6 @@ static int msm_vidc_populate_context_bank(struct device *dev,
}
INIT_LIST_HEAD(&cb->list);
list_add_tail(&cb->list, &core->dt->context_banks);
rc = of_property_read_string(np, "label", &cb->name);
if (rc) {
d_vpr_h("Failed to read cb label from device tree\n");
@@ -874,13 +872,16 @@ static int msm_vidc_populate_context_bank(struct device *dev,
goto err_setup_cb;
}
core_lock(core, __func__);
list_add_tail(&cb->list, &core->dt->context_banks);
core_unlock(core, __func__);
iommu_set_fault_handler(cb->domain,
msm_vidc_smmu_fault_handler, (void *)core);
return 0;
err_setup_cb:
list_del(&cb->list);
return rc;
}

查看文件

@@ -393,12 +393,15 @@ static int msm_vidc_component_bind(struct device *dev)
d_vpr_h("%s(): succssful\n", __func__);
return rc;
return 0;
queues_deinit:
venus_hfi_interface_queues_deinit(core);
component_unbind_all(dev, core);
return rc;
/**
* queues and core can be inited again during session_open.
* So don't declare as probe failure.
*/
return 0;
}
static void msm_vidc_component_unbind(struct device *dev)

查看文件

@@ -2209,6 +2209,11 @@ void venus_hfi_interface_queues_deinit(struct msm_vidc_core *core)
d_vpr_h("%s()\n", __func__);
if (!core->iface_q_table.align_virtual_addr) {
d_vpr_h("%s: queues already deallocated\n", __func__);
return;
}
msm_vidc_memory_unmap(core, &core->iface_q_table.map);
msm_vidc_memory_free(core, &core->iface_q_table.alloc);
msm_vidc_memory_unmap(core, &core->sfr.map);