Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ff81a29 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Print noc error information after pagefault



When pagefault occurs and smmu driver does resume
terminate on the fault transaction then noc error
registers will be updated. Enable non fatal attribute
on venus context banks so that smmu driver will resume
terminate the fault transaction. Video driver does
nothing in pagefault handler for the first time and
smmu driver resume terminates the transaction and hence
noc error registers will be updated with error information.
Video driver will print the noc error information in the
pagefault handler for the second time.

CRs-Fixed: 2054180
Change-Id: I1b594ac3b7f2da1c3b47b06674ce8ac5c03f2c1d
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 05e7d36b
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -2028,6 +2028,7 @@ static void handle_sys_error(enum hal_command_response cmd, void *data)
	}

	dprintk(VIDC_WARN, "SYS_ERROR received for core %pK\n", core);
	msm_vidc_noc_error_info(core);
	call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
	list_for_each_entry(inst, &core->instances, list) {
		dprintk(VIDC_WARN,
@@ -5006,6 +5007,28 @@ enum hal_extradata_id msm_comm_get_hal_extradata_index(
	return ret;
};

int msm_vidc_noc_error_info(struct msm_vidc_core *core)
{
	struct hfi_device *hdev;

	if (!core || !core->device) {
		dprintk(VIDC_WARN, "%s: Invalid parameters: %pK\n",
			__func__, core);
		return -EINVAL;
	}

	if (!core->resources.non_fatal_pagefaults)
		return 0;

	if (!core->smmu_fault_handled)
		return 0;

	hdev = core->device;
	call_hfi_op(hdev, noc_error_info, hdev->hfi_device_data);

	return 0;
}

int msm_vidc_trigger_ssr(struct msm_vidc_core *core,
	enum hal_ssr_trigger_type type)
{
+1 −0
Original line number Diff line number Diff line
@@ -395,6 +395,7 @@ struct msm_vidc_ctrl {
void handle_cmd_response(enum hal_command_response cmd, void *data);
int msm_vidc_trigger_ssr(struct msm_vidc_core *core,
	enum hal_ssr_trigger_type type);
int msm_vidc_noc_error_info(struct msm_vidc_core *core);
int msm_vidc_check_session_supported(struct msm_vidc_inst *inst);
int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst);
void msm_vidc_queue_v4l2_event(struct msm_vidc_inst *inst, int event_type);
+4 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ static struct msm_vidc_common_data sdm845_common_data[] = {
		.key = "qcom,sw-power-collapse",
		.value = 1,
	},
	{
		.key = "qcom,domain-attr-non-fatal-faults",
		.value = 1,
	},
	{
		.key = "qcom,max-secure-instances",
		.value = 5,
+24 −1
Original line number Diff line number Diff line
@@ -785,6 +785,9 @@ int read_platform_resources_from_drv_data(
			"qcom,fw-unload-delay");
	res->msm_vidc_hw_rsp_timeout = find_key_value(platform_data,
			"qcom,hw-resp-timeout");
	res->non_fatal_pagefaults = find_key_value(platform_data,
			"qcom,domain-attr-non-fatal-faults");

	return rc;

}
@@ -980,8 +983,13 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,
		return -EINVAL;
	}

	if (core->smmu_fault_handled)
	if (core->smmu_fault_handled) {
		if (core->resources.non_fatal_pagefaults) {
			msm_vidc_noc_error_info(core);
			MSM_VIDC_ERROR(true);
		}
		return -ENOSYS;
	}

	dprintk(VIDC_ERR, "%s - faulting address: %lx\n", __func__, iova);

@@ -1061,6 +1069,21 @@ static int msm_vidc_populate_context_bank(struct device *dev,
		goto err_setup_cb;
	}

	if (core->resources.non_fatal_pagefaults) {
		int data = 1;

		dprintk(VIDC_DBG, "set non-fatal-faults attribute on %s\n",
				dev_name(dev));
		rc = iommu_domain_set_attr(cb->mapping->domain,
					DOMAIN_ATTR_NON_FATAL_FAULTS, &data);
		if (rc) {
			dprintk(VIDC_WARN,
				"%s: set non fatal attribute failed: %s %d\n",
				__func__, dev_name(dev), rc);
			/* ignore the error */
		}
	}

	iommu_set_fault_handler(cb->mapping->domain,
		msm_vidc_smmu_fault_handler, (void *)core);

+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ struct msm_vidc_platform_resources {
	int msm_vidc_hw_rsp_timeout;
	int msm_vidc_firmware_unload_delay;
	uint32_t msm_vidc_pwr_collapse_delay;
	bool non_fatal_pagefaults;
	struct msm_vidc_codec_data *codec_data;
	int codec_data_count;
};
Loading