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

Commit 1593b5ac authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: ignore processing responses in invalid state"

parents 20732e78 6f3dae59
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line 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
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -1652,7 +1652,7 @@ static int __iface_cmdq_write_relaxed(struct venus_hfi_device *device,
	__strict_check(device);
	__strict_check(device);


	if (!__core_in_valid_state(device)) {
	if (!__core_in_valid_state(device)) {
		dprintk(VIDC_DBG, "%s - fw not in init state\n", __func__);
		dprintk(VIDC_ERR, "%s - fw not in init state\n", __func__);
		result = -EINVAL;
		result = -EINVAL;
		goto err_q_null;
		goto err_q_null;
	}
	}
@@ -3378,8 +3378,6 @@ static void __process_sys_error(struct venus_hfi_device *device)
{
{
	struct hfi_sfr_struct *vsfr = NULL;
	struct hfi_sfr_struct *vsfr = NULL;


	__set_state(device, VENUS_STATE_DEINIT);

	/* Once SYS_ERROR received from HW, it is safe to halt the AXI.
	/* Once SYS_ERROR received from HW, it is safe to halt the AXI.
	 * With SYS_ERROR, Venus FW may have crashed and HW might be
	 * With SYS_ERROR, Venus FW may have crashed and HW might be
	 * active and causing unnecessary transactions. Hence it is
	 * active and causing unnecessary transactions. Hence it is
@@ -3626,6 +3624,10 @@ static int __response_handler(struct venus_hfi_device *device)
					"Too many packets in message queue to handle at once, deferring read\n");
					"Too many packets in message queue to handle at once, deferring read\n");
			break;
			break;
		}
		}

		/* do not read packets after sys error packet */
		if (info->response_type == HAL_SYS_ERROR)
			break;
	}
	}


	if (requeue_pm_work && device->res->sw_power_collapsible) {
	if (requeue_pm_work && device->res->sw_power_collapsible) {
@@ -3688,6 +3690,12 @@ err_no_work:
		i < num_responses; ++i) {
		i < num_responses; ++i) {
		struct msm_vidc_cb_info *r = &device->response_pkt[i];
		struct msm_vidc_cb_info *r = &device->response_pkt[i];


		if (!__core_in_valid_state(device)) {
			dprintk(VIDC_ERR,
				"Ignore responses from %d to %d as device is in invalid state",
				(i + 1), num_responses);
			break;
		}
		device->callback(r->response_type, &r->response);
		device->callback(r->response_type, &r->response);
	}
	}