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

Commit cb9b54c3 authored by Vikash Garodia's avatar Vikash Garodia
Browse files

msm: cvp: convert infinite wait to timeout wait



CVP driver waits indefinitely for response callback.
This wait is done after acquiring a lock used by
other threads in video driver. As a result, during
device power suspend, the kernel suspend thread, which
is waiting on above lock, waits and leads to hung.

CRs-Fixed: 2603603
Change-Id: If8bdbacb27c71b0df21c217d28e5bc2cf02e3d49
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent 11ae02d0
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;