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

Commit 0727c907 authored by Prateek Shrivastava's avatar Prateek Shrivastava Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: BUG_ON when FW sends sys error



Removing BUG_ON when smmu page fault occurs and
BUG_ON when firmware sends sys error with
error code 17.

CRs-Fixed: 2173174
Change-Id: I9253138285f709414fc844192648c28dfb6786bf
Signed-off-by: default avatarPrateek Shrivastava <pshrivas@codeaurora.org>
parent 40dd625b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -39,6 +39,9 @@ static enum vidc_status hfi_map_err_status(u32 hfi_err)
	case HFI_ERR_SYS_FATAL:
		vidc_err = VIDC_ERR_HW_FATAL;
		break;
	case HFI_ERR_SYS_NOC_ERROR:
		vidc_err = VIDC_ERR_NOC_ERROR;
		break;
	case HFI_ERR_SYS_VERSION_MISMATCH:
	case HFI_ERR_SYS_INVALID_PARAMETER:
	case HFI_ERR_SYS_SESSION_ID_OUT_OF_RANGE:
@@ -316,11 +319,14 @@ static int hfi_process_evt_release_buffer_ref(u32 device_id,
	return 0;
}

static int hfi_process_sys_error(u32 device_id, struct msm_vidc_cb_info *info)
static int hfi_process_sys_error(u32 device_id,
	struct hfi_msg_event_notify_packet *pkt,
	struct msm_vidc_cb_info *info)
{
	struct msm_vidc_cb_cmd_done cmd_done = {0};

	cmd_done.device_id = device_id;
	cmd_done.status = hfi_map_err_status(pkt->event_data1);

	info->response_type = HAL_SYS_ERROR;
	info->response.cmd = cmd_done;
@@ -373,7 +379,7 @@ static int hfi_process_event_notify(u32 device_id,
	case HFI_EVENT_SYS_ERROR:
		dprintk(VIDC_ERR, "HFI_EVENT_SYS_ERROR: %d, %#x\n",
			pkt->event_data1, pkt->event_data2);
		return hfi_process_sys_error(device_id, info);
		return hfi_process_sys_error(device_id, pkt, info);
	case HFI_EVENT_SESSION_ERROR:
		dprintk(VIDC_INFO, "HFI_EVENT_SESSION_ERROR[%#x]\n",
				pkt->session_id);
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2207,6 +2207,10 @@ static void handle_sys_error(enum hal_command_response cmd, void *data)
	}
	/* handle the hw error before core released to get full debug info */
	msm_vidc_handle_hw_error(core);
	if (response->status == VIDC_ERR_NOC_ERROR) {
		dprintk(VIDC_WARN, "Got NOC error");
		MSM_VIDC_ERROR(true);
	}
	dprintk(VIDC_DBG, "Calling core_release\n");
	rc = call_hfi_op(hdev, core_release, hdev->hfi_device_data);
	if (rc) {
+5 −4
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -992,10 +992,11 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,

	if (core->smmu_fault_handled) {
		if (core->resources.non_fatal_pagefaults) {
			msm_vidc_noc_error_info(core);
			MSM_VIDC_ERROR(true);
			dprintk(VIDC_ERR,
					"%s: non-fatal pagefault address: %lx\n",
					__func__, iova);
			return 0;
		}
		return -ENOSYS;
	}

	dprintk(VIDC_ERR, "%s - faulting address: %lx\n", __func__, iova);
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -88,6 +88,7 @@ enum vidc_status {
	VIDC_ERR_TIMEOUT,
	VIDC_ERR_CMDQFULL,
	VIDC_ERR_START_CODE_NOT_FOUND,
	VIDC_ERR_NOC_ERROR,
	VIDC_ERR_CLIENT_PRESENT = 0x90000001,
	VIDC_ERR_CLIENT_FATAL,
	VIDC_ERR_CMD_QUEUE_FULL,
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -45,7 +45,7 @@
#define HFI_ERR_SYS_SESSION_IN_USE			(HFI_COMMON_BASE + 0x7)
#define HFI_ERR_SYS_SESSION_ID_OUT_OF_RANGE	(HFI_COMMON_BASE + 0x8)
#define HFI_ERR_SYS_UNSUPPORTED_DOMAIN		(HFI_COMMON_BASE + 0x9)

#define HFI_ERR_SYS_NOC_ERROR			(HFI_COMMON_BASE + 0x11)
#define HFI_ERR_SESSION_FATAL			(HFI_COMMON_BASE + 0x1001)
#define HFI_ERR_SESSION_INVALID_PARAMETER	(HFI_COMMON_BASE + 0x1002)
#define HFI_ERR_SESSION_BAD_POINTER		(HFI_COMMON_BASE + 0x1003)