summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorAndrey Markovytch <andreym@codeaurora.org>2016-04-14 16:02:53 +0300
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-03 15:48:01 -0700
commitab2b3d7aba7ad06c2dc227cbe605d3b6a776808a (patch)
treeea2919bb7b9eec50241eb1a76e30064937dcb489 /security
parent3dec6d1c5e6be9d1ad22dfd5fe73c0d21730d446 (diff)
PFK: ice: change to non-atomic scm calls
These scm calls may take a long time to complete on TZ side, switch to non-atomic calls. Change-Id: If98ef69e2474f1c50670c2605afe9769a4e0fb39 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Diffstat (limited to 'security')
-rw-r--r--security/pfe/pfk_ice.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/security/pfe/pfk_ice.c b/security/pfe/pfk_ice.c
index 9d4961aa8330..2f09d8801a96 100644
--- a/security/pfe/pfk_ice.c
+++ b/security/pfe/pfk_ice.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-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
@@ -103,8 +103,16 @@ int qti_pfk_ice_set_key(uint32_t index, uint8_t *key, uint8_t *salt)
desc.args[3] = virt_to_phys(tzbuf_salt);
desc.args[4] = tzbuflen_salt;
+ ret = qcom_ice_setup_ice_hw("ufs", true);
+ if (ret) {
+ pr_err("%s: could not enable clocks: 0x%x\n", __func__, ret);
+ return ret;
+ }
+
+ ret = scm_call2(smc_id, &desc);
+
+ qcom_ice_setup_ice_hw("ufs", false);
- ret = scm_call2_atomic(smc_id, &desc);
pr_debug(" %s , ret = %d\n", __func__, ret);
if (ret) {
pr_err("%s: Error: 0x%x\n", __func__, ret);
@@ -112,7 +120,7 @@ int qti_pfk_ice_set_key(uint32_t index, uint8_t *key, uint8_t *salt)
smc_id = TZ_ES_INVALIDATE_ICE_KEY_ID;
desc.arginfo = TZ_ES_INVALIDATE_ICE_KEY_PARAM_ID;
desc.args[0] = index;
- scm_call2_atomic(smc_id, &desc);
+ scm_call2(smc_id, &desc);
}
return ret;
@@ -136,10 +144,12 @@ int qti_pfk_ice_invalidate_key(uint32_t index)
desc.args[0] = index;
ret = qcom_ice_setup_ice_hw("ufs", true);
- if (ret)
+ if (ret) {
pr_err("%s: could not enable clocks: 0x%x\n", __func__, ret);
+ return ret;
+ }
- ret = scm_call2_atomic(smc_id, &desc);
+ ret = scm_call2(smc_id, &desc);
qcom_ice_setup_ice_hw("ufs", false);