video: driver: add support to print noc error log registers

Added support to print noc error log registers at below places.

- smmu_fault_handler path
- handle_system_error path.

Change-Id: I9e195bd82a2058f533df8713368e61f57b537b87
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
Govindaraj Rajagopal
2021-03-25 16:03:15 +05:30
vanhempi fb6421e3e9
commit a7bdc410ef
5 muutettua tiedostoa jossa 36 lisäystä ja 4 poistoa

Näytä tiedosto

@@ -387,8 +387,12 @@ static int __noc_error_info_iris2(struct msm_vidc_core *vidc_core)
return -EINVAL;
}
//if (core->res->vpu_ver == VPU_VERSION_IRIS2_1)
// return;
/* check ErrLog registers contain valid info */
if (!__read_register(core, VCODEC_NOC_ERL_MAIN_ERRVLD_LOW)) {
d_vpr_e("%s: VCODEC_NOC_ERL_MAIN_ERRVLD_LOW bit not-set\n", __func__);
/* todo: uncomment below line after validation */
//return 0;
}
val = __read_register(core, VCODEC_NOC_ERL_MAIN_SWID_LOW);
d_vpr_e("VCODEC_NOC_ERL_MAIN_SWID_LOW: %#x\n", val);
@@ -396,8 +400,6 @@ static int __noc_error_info_iris2(struct msm_vidc_core *vidc_core)
d_vpr_e("VCODEC_NOC_ERL_MAIN_SWID_HIGH: %#x\n", val);
val = __read_register(core, VCODEC_NOC_ERL_MAIN_MAINCTL_LOW);
d_vpr_e("VCODEC_NOC_ERL_MAIN_MAINCTL_LOW: %#x\n", val);
val = __read_register(core, VCODEC_NOC_ERL_MAIN_ERRVLD_LOW);
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRVLD_LOW: %#x\n", val);
val = __read_register(core, VCODEC_NOC_ERL_MAIN_ERRCLR_LOW);
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRCLR_LOW: %#x\n", val);
val = __read_register(core, VCODEC_NOC_ERL_MAIN_ERRLOG0_LOW);

Näytä tiedosto

@@ -46,6 +46,7 @@ int venus_hfi_session_open(struct msm_vidc_inst *inst);
int venus_hfi_session_set_codec(struct msm_vidc_inst *inst);
int venus_hfi_core_init(struct msm_vidc_core *core);
int venus_hfi_core_deinit(struct msm_vidc_core *core);
int venus_print_noc_error_info(struct msm_vidc_core *core);
int venus_hfi_suspend(struct msm_vidc_core *core);
int venus_hfi_scale_clocks(struct msm_vidc_inst* inst, u64 freq);
int venus_hfi_scale_buses(struct msm_vidc_inst* inst, u64 bw_ddr, u64 bw_llcc);

Näytä tiedosto

@@ -3410,6 +3410,9 @@ void msm_vidc_smmu_fault_work_handler(struct work_struct *work)
return;
}
/* print noc error log registers */
venus_print_noc_error_info(core);
core_lock(core, __func__);
list_for_each_entry(inst, &core->instances, list)
instances[num_instances++] = inst;

Näytä tiedosto

@@ -2844,6 +2844,31 @@ int venus_hfi_core_deinit(struct msm_vidc_core *core)
return 0;
}
int venus_print_noc_error_info(struct msm_vidc_core *core)
{
if (!core) {
d_vpr_e("%s: Invalid parameters: %pK\n",
__func__, core);
return -EINVAL;
}
if (!core->capabilities[NON_FATAL_FAULTS].value)
return 0;
core_lock(core, __func__);
/* resume venus before accessing noc registers */
if (__resume(core)) {
d_vpr_e("%s: Power on failed\n", __func__);
goto unlock;
}
call_venus_op(core, noc_error_info, core);
unlock:
core_unlock(core, __func__);
return 0;
}
int venus_hfi_suspend(struct msm_vidc_core *core)
{
int rc = 0;

Näytä tiedosto

@@ -315,6 +315,7 @@ static int handle_system_error(struct msm_vidc_core *core,
{
d_vpr_e("%s: system error received\n", __func__);
print_sfr_message(core);
venus_print_noc_error_info(core);
msm_vidc_core_deinit(core, true);
return 0;
}