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

Commit 5c4431b6 authored by Alexander Kolesnikov's avatar Alexander Kolesnikov Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Fix a deadlock in power-up sequence of the I2C-TZ relay



Invoke msm_camera_tz_unlock() before calling the
msm_camera_tz_unload_ta() to avoid a deadlock.

CRs-Fixed: 2040684
Change-Id: I1765e47abba5e84ef4c90f3346fb326dc6f84671
Signed-off-by: default avatarAlexander Kolesnikov <akolesni@codeaurora.org>
parent 5404e350
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016, 2017 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
@@ -520,14 +520,16 @@ int32_t msm_camera_tz_i2c_power_up(
				msm_camera_tz_get_ta_handle(),
				sensor_id,
				&sensor_secure);
			if (!rc && sensor_secure)
			if (!rc && sensor_secure) {
				/* Sensor validated by TA*/
				sensor_info[sensor_id].ready++;
				msm_camera_tz_unlock();
			}
			else {
				msm_camera_tz_unlock();
				msm_camera_tz_unload_ta();
				rc = -EFAULT;
			}
			msm_camera_tz_unlock();
		}
	} else
		rc = -EFAULT;