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

Commit 0e577cd8 authored by Gaurav Kashyap's avatar Gaurav Kashyap
Browse files

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: default avatarGaurav Kashyap <gaurkash@codeaurora.org>
parent bbc7f2d3
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -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;

	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);
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,