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:
committed by
Alistair Delva
parent
484f187320
commit
d2e05e75f6
@@ -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
|
* ufshcd_hba_init_crypto - Read crypto capabilities, init crypto fields in hba
|
||||||
* @hba: Per adapter instance
|
* @hba: Per adapter instance
|
||||||
*
|
*
|
||||||
* Returns 0 on success. Returns -ENODEV if such capabilities don't exist, and
|
* Return: 0 if crypto was initialized or is not supported, else a -errno value.
|
||||||
* -ENOMEM upon OOM.
|
|
||||||
*/
|
*/
|
||||||
int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
|
int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
|
||||||
const struct keyslot_mgmt_ll_ops *ksm_ops)
|
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 */
|
/* Default to disabling crypto */
|
||||||
hba->caps &= ~UFSHCD_CAP_CRYPTO;
|
hba->caps &= ~UFSHCD_CAP_CRYPTO;
|
||||||
|
|
||||||
if (!(hba->capabilities & MASK_CRYPTO_SUPPORT)) {
|
/* Return 0 if crypto support isn't present */
|
||||||
err = -ENODEV;
|
if (!(hba->capabilities & MASK_CRYPTO_SUPPORT))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Crypto Capabilities should never be 0, because the
|
* Crypto Capabilities should never be 0, because the
|
||||||
@@ -372,7 +370,6 @@ int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
|
|||||||
out_free_cfg_mem:
|
out_free_cfg_mem:
|
||||||
devm_kfree(hba->dev, hba->crypto_cap_array);
|
devm_kfree(hba->dev, hba->crypto_cap_array);
|
||||||
out:
|
out:
|
||||||
// TODO: print error?
|
|
||||||
/* Indicate that init failed by setting crypto_capabilities to 0 */
|
/* Indicate that init failed by setting crypto_capabilities to 0 */
|
||||||
hba->crypto_capabilities.reg_val = 0;
|
hba->crypto_capabilities.reg_val = 0;
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user