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

Commit d32ca4ec authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cvp: convert infinite wait to timeout wait"

parents 22bdc645 cb9b54c3
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018, 2020 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
@@ -250,6 +250,7 @@ int fastcvpd_video_shutdown(uint32_t session_flag)
	int srcVM[DEST_VM_NUM] = {VMID_HLOS, VMID_CDSP_Q6};
	int destVM[SRC_VM_NUM] = {VMID_HLOS};
	int destVMperm[SRC_VM_NUM] = { PERM_READ | PERM_WRITE | PERM_EXEC };
	unsigned long ret;

	local_cmd_msg.cmd_msg_type = FASTCVPD_VIDEO_SHUTDOWN;
	err = fastcvpd_send_cmd
@@ -258,8 +259,11 @@ int fastcvpd_video_shutdown(uint32_t session_flag)
		pr_err("%s: fastcvpd_send_cmd failed with err=%d\n",
			__func__, err);

	wait_for_completion(&work);

	ret = wait_for_completion_timeout(&work, msecs_to_jiffies(1000));
	if (!ret) {
		pr_err("%s: wait timeout", __func__);
		return -EBUSY;
	}
	mutex_lock(&me->smd_mutex);
	me->video_shutdown = STATUS_SSR;
	local_cmd_msg.msg_ptr = cmd_msg.msg_ptr;