Loading security/pfe/pfk_ice.c +19 −12 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ int qti_pfk_ice_set_key(uint32_t index, uint8_t *key, uint8_t *salt, int ret; char *tzbuf_key = (char *)ice_key; char *tzbuf_salt = (char *)ice_salt; char *s_type = storage_type; uint32_t smc_id = 0; u32 tzbuflen_key = sizeof(ice_key); Loading Loading @@ -107,27 +108,31 @@ 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((const char *)storage_type, true); ret = qcom_ice_setup_ice_hw((const char *)s_type, true); if (ret) { pr_err("%s: could not enable clocks: 0x%x\n", __func__, ret); return ret; goto out; } ret = scm_call2(smc_id, &desc); ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); pr_debug(" %s , ret = %d\n", __func__, ret); if (ret) { pr_err("%s: Error: 0x%x\n", __func__, ret); if (ret == -EBUSY) { goto out; } else { smc_id = TZ_ES_INVALIDATE_ICE_KEY_ID; desc.arginfo = TZ_ES_INVALIDATE_ICE_KEY_PARAM_ID; desc.args[0] = index; scm_call2(smc_id, &desc); } } ret = qcom_ice_setup_ice_hw((const char *)s_type, false); out: return ret; } Loading Loading @@ -160,11 +165,13 @@ int qti_pfk_ice_invalidate_key(uint32_t index, char *storage_type) ret = scm_call2(smc_id, &desc); ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); pr_debug(" %s , ret = %d\n", __func__, ret); if (ret) if (ret) { pr_err("%s: Error: 0x%x\n", __func__, ret); qcom_ice_setup_ice_hw((const char *)storage_type, false); } else { ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); } return ret; Loading Loading
security/pfe/pfk_ice.c +19 −12 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ int qti_pfk_ice_set_key(uint32_t index, uint8_t *key, uint8_t *salt, int ret; char *tzbuf_key = (char *)ice_key; char *tzbuf_salt = (char *)ice_salt; char *s_type = storage_type; uint32_t smc_id = 0; u32 tzbuflen_key = sizeof(ice_key); Loading Loading @@ -107,27 +108,31 @@ 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((const char *)storage_type, true); ret = qcom_ice_setup_ice_hw((const char *)s_type, true); if (ret) { pr_err("%s: could not enable clocks: 0x%x\n", __func__, ret); return ret; goto out; } ret = scm_call2(smc_id, &desc); ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); pr_debug(" %s , ret = %d\n", __func__, ret); if (ret) { pr_err("%s: Error: 0x%x\n", __func__, ret); if (ret == -EBUSY) { goto out; } else { smc_id = TZ_ES_INVALIDATE_ICE_KEY_ID; desc.arginfo = TZ_ES_INVALIDATE_ICE_KEY_PARAM_ID; desc.args[0] = index; scm_call2(smc_id, &desc); } } ret = qcom_ice_setup_ice_hw((const char *)s_type, false); out: return ret; } Loading Loading @@ -160,11 +165,13 @@ int qti_pfk_ice_invalidate_key(uint32_t index, char *storage_type) ret = scm_call2(smc_id, &desc); ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); pr_debug(" %s , ret = %d\n", __func__, ret); if (ret) if (ret) { pr_err("%s: Error: 0x%x\n", __func__, ret); qcom_ice_setup_ice_hw((const char *)storage_type, false); } else { ret = qcom_ice_setup_ice_hw((const char *)storage_type, false); } return ret; Loading