mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
scsi: ufshcd-crypto-qti.c: do not resume for key reprogram
When reprogram_all_keys is called from keyslot manager, it is done as part of the ufs resume context. This will cause a hang when keyslot program tries to do a resume again. Avoid doing a resume if keyslot program is called from resume context. Change-Id: I336fd580885d8e26ec9bf3fafe13e30404ba3ac5 Signed-off-by: Gaurav Kashyap <gaurkash@codeaurora.org>
This commit is contained in:
parent
bbc7f2d3ed
commit
0e577cd853
1 changed files with 8 additions and 10 deletions
|
|
@ -55,7 +55,6 @@ void ufshcd_crypto_qti_enable(struct ufs_hba *hba)
|
|||
}
|
||||
|
||||
ufshcd_crypto_enable_spec(hba);
|
||||
|
||||
}
|
||||
|
||||
void ufshcd_crypto_qti_disable(struct ufs_hba *hba)
|
||||
|
|
@ -88,26 +87,25 @@ static int ufshcd_crypto_qti_keyslot_program(struct keyslot_manager *ksm,
|
|||
hba->crypto_cap_array[crypto_alg_id].sdus_mask))
|
||||
return -EINVAL;
|
||||
|
||||
pm_runtime_get_sync(hba->dev);
|
||||
if (!hba->pm_op_in_progress)
|
||||
pm_runtime_get_sync(hba->dev);
|
||||
err = ufshcd_hold(hba, false);
|
||||
if (err) {
|
||||
pr_err("%s: failed to enable clocks, err %d\n", __func__, err);
|
||||
return err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = crypto_qti_keyslot_program(hba->crypto_vops->priv, key, slot,
|
||||
data_unit_mask, crypto_alg_id);
|
||||
if (err) {
|
||||
if (err)
|
||||
pr_err("%s: failed with error %d\n", __func__, err);
|
||||
ufshcd_release(hba);
|
||||
pm_runtime_put_sync(hba->dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
ufshcd_release(hba);
|
||||
pm_runtime_put_sync(hba->dev);
|
||||
out:
|
||||
if (!hba->pm_op_in_progress)
|
||||
pm_runtime_put_sync(hba->dev);
|
||||
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int ufshcd_crypto_qti_keyslot_evict(struct keyslot_manager *ksm,
|
||||
|
|
|
|||
Loading…
Reference in a new issue