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

Commit 43291189 authored by Runmin Wang's avatar Runmin Wang
Browse files

soc: qcom: Increase the retry timeout to 2 seconds



Increase the scm retry timeout to 2 seconds and add a warning
message if the call takes longer than 1 second.

CRs-Fixed: 975433
Change-Id: I7719df41e491c9a8c80b8547de14bc8c71bf7c8d
Signed-off-by: default avatarRunmin Wang <runminw@codeaurora.org>
parent 676c9bc2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2016, 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
@@ -43,7 +43,7 @@ static DEFINE_MUTEX(scm_lock);
DEFINE_MUTEX(scm_lmh_lock);

#define SCM_EBUSY_WAIT_MS 30
#define SCM_EBUSY_MAX_RETRY 20
#define SCM_EBUSY_MAX_RETRY 67

#define N_EXT_SCM_ARGS 7
#define FIRST_EXT_ARG_IDX 3
@@ -330,6 +330,8 @@ static int _scm_call_retry(u32 svc_id, u32 cmd_id, const void *cmd_buf,
					resp_buf, resp_len, cmd, len);
		if (ret == SCM_EBUSY)
			msleep(SCM_EBUSY_WAIT_MS);
		if (retry_count == 33)
			pr_warn("scm: secure world has been busy for 1 second!\n");
	} while (ret == SCM_EBUSY && (retry_count++ < SCM_EBUSY_MAX_RETRY));

	if (ret == SCM_EBUSY)
@@ -681,6 +683,8 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)

		if (ret == SCM_V2_EBUSY)
			msleep(SCM_EBUSY_WAIT_MS);
		if (retry_count == 33)
			pr_warn("scm: secure world has been busy for 1 second!\n");
	}  while (ret == SCM_V2_EBUSY && (retry_count++ < SCM_EBUSY_MAX_RETRY));

	if (ret < 0)