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

Commit e92e4bf1 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 : report PC_PREP failure as SYS_ERROR"

parents a6109297 ee9d1af1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1887,8 +1887,6 @@ void handle_cmd_response(enum hal_command_response cmd, void *data)
		handle_seq_hdr_done(cmd, data);
		break;
	case HAL_SYS_WATCHDOG_TIMEOUT:
		handle_sys_error(cmd, data);
		break;
	case HAL_SYS_ERROR:
		handle_sys_error(cmd, data);
		break;
+18 −5
Original line number Diff line number Diff line
@@ -3263,6 +3263,15 @@ static int __check_core_registered(struct hal_device_data core,
	return -EINVAL;
}

static void __process_fatal_error(
		struct venus_hfi_device *device)
{
	struct msm_vidc_cb_cmd_done cmd_done = {0};

	cmd_done.device_id = device->device_id;
	device->callback(HAL_SYS_ERROR, &cmd_done);
}

static int __prepare_pc(struct venus_hfi_device *device)
{
	int rc = 0;
@@ -3341,10 +3350,12 @@ static void venus_hfi_pm_handler(struct work_struct *work)
	rc = __prepare_pc(device);
	if (rc) {
		dprintk(VIDC_ERR, "Failed to prepare for PC %d\n", rc);
		goto err_prepare_pc;
		__alloc_set_imem(device);
		mutex_unlock(&device->lock);
		__process_fatal_error(device);
		return;
	}


	if (device->last_packet_type != HFI_CMD_SYS_PC_PREP) {
		dprintk(VIDC_DBG,
			"Last command (%#x) is not PC_PREP cmd\n",
@@ -3392,8 +3403,7 @@ skip_power_off:
	dprintk(VIDC_WARN, "Power off skipped (last pkt %#x, status: %#x)\n",
		device->last_packet_type, ctrl_status);

err_prepare_pc:
	__alloc_imem(device, device->res->imem_size);
	__alloc_set_imem(device);
err_unset_imem:
	mutex_unlock(&device->lock);
	return;
@@ -3512,6 +3522,7 @@ static int __response_handler(struct venus_hfi_device *device)

		dprintk(VIDC_ERR, "Received watchdog timeout\n");
		packets[packet_count++] = info;
		goto exit;
	}

	/* Bleed the msg queue dry of packets */
@@ -3625,6 +3636,7 @@ static int __response_handler(struct venus_hfi_device *device)
		}
	}

exit:
	__flush_debug_queue(device, raw_packet);

	kfree(raw_packet);
@@ -4365,6 +4377,7 @@ static void __unload_fw(struct venus_hfi_device *device)

	flush_workqueue(device->vidc_workq);
	cancel_delayed_work(&venus_hfi_pm_work);
	if (device->state != VENUS_STATE_DEINIT)
		flush_workqueue(device->venus_pm_workq);
	subsystem_put(device->resources.fw.cookie);
	__interface_queues_release(device);