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

Commit d2e05e75 authored by Satya Tangirala's avatar Satya Tangirala Committed by Alistair Delva
Browse files

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: default avatarSatya Tangirala <satyat@google.com>
parent 484f1873
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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 @@ int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba,
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;