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

Commit 9d734a03 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PFK: ice: change to non-atomic scm calls"

parents 1c1ab50f 5518ecdb
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
/* 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);