diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index aaa5309db22a..db1b1d9ab048 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -162,7 +162,7 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba) int err = 0; enum blk_crypto_mode_num blk_mode_num; - if (hba->quirks & UFSHCD_QUIRK_BROKEN_CRYPTO_CAPS) + if (hba->quirks & UFSHCD_QUIRK_CUSTOM_KEYSLOT_MANAGER) return 0; /* @@ -238,7 +238,7 @@ void ufshcd_init_crypto(struct ufs_hba *hba) /* Clear all keyslots */ for (slot = 0; slot < hba->ksm.num_slots; slot++) - ufshcd_clear_keyslot(hba, slot); + hba->ksm.ksm_ll_ops.keyslot_evict(&hba->ksm, NULL, slot); } void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba, diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 091bf771bcc4..45510d730309 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -557,11 +557,12 @@ enum ufshcd_quirks { /* * This quirk needs to be enabled if the host controller supports inline - * encryption, but it doesn't use the standard crypto capability - * registers. If enabled, the standard code won't initialize the - * keyslot manager; ufs_hba_variant_ops::init() must do it instead. + * encryption, but it needs to initialize the crypto capabilities in a + * nonstandard way and/or it needs to override blk_ksm_ll_ops. If + * enabled, the standard code won't initialize the blk_keyslot_manager; + * ufs_hba_variant_ops::init() must do it instead. */ - UFSHCD_QUIRK_BROKEN_CRYPTO_CAPS = 1 << 20, + UFSHCD_QUIRK_CUSTOM_KEYSLOT_MANAGER = 1 << 20, /* * This quirk needs to be enabled if the host controller supports inline