ANDROID: scsi: ufs: UFS init should not require inline crypto

UFS initialization should carry on even if inline crypto support is
absent, instead of just erroring out.

Bug: 137270441
Change-Id: I4a508640f803dc8aaff1033b5e1d5c229a0b03de
Signed-off-by: Satya Tangirala <satyat@google.com>
This commit is contained in:
Satya Tangirala 2019-11-07 21:16:46 -08:00 committed by Alistair Delva
parent 484f187320
commit d2e05e75f6

View file

@ -301,8 +301,7 @@ static const struct keyslot_mgmt_ll_ops ufshcd_ksm_ops = {
* ufshcd_hba_init_crypto - Read crypto capabilities, init crypto fields in hba
* @hba: Per adapter instance
*
* Returns 0 on success. Returns -ENODEV if such capabilities don't exist, and
* -ENOMEM upon OOM.
* Return: 0 if crypto was initialized or is not supported, else a -errno value.
*/
int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
const struct keyslot_mgmt_ll_ops *ksm_ops)
@ -313,10 +312,9 @@ int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
/* Default to disabling crypto */
hba->caps &= ~UFSHCD_CAP_CRYPTO;
if (!(hba->capabilities & MASK_CRYPTO_SUPPORT)) {
err = -ENODEV;
/* Return 0 if crypto support isn't present */
if (!(hba->capabilities & MASK_CRYPTO_SUPPORT))
goto out;
}
/*
* Crypto Capabilities should never be 0, because the
@ -372,7 +370,6 @@ out_free_crypto_cfgs:
out_free_cfg_mem:
devm_kfree(hba->dev, hba->crypto_cap_array);
out:
// TODO: print error?
/* Indicate that init failed by setting crypto_capabilities to 0 */
hba->crypto_capabilities.reg_val = 0;
return err;