mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
ANDROID: scsi: ufs: add UFSHCD_QUIRK_NO_KEYSLOTS
Add UFSHCD_QUIRK_NO_KEYSLOTS which tells ufshcd-core that the host controller supports encryption, but it uses a nonstandard mechanism where the standard crypto registers aren't used and there is no concept of keyslots. ufs_hba_variant_ops::init() is expected to initialize ufs_hba::ksm as a passthrough keyslot manager. This is needed for FMP support. Bug: 166139333 Bug: 162257402 Change-Id: Ieb77b3713b2624490dad4f86d44ef16461dd8ce7 Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
parent
617dda8838
commit
73372c9835
|
|
@ -119,6 +119,9 @@ bool ufshcd_crypto_enable(struct ufs_hba *hba)
|
|||
if (!(hba->caps & UFSHCD_CAP_CRYPTO))
|
||||
return false;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_NO_KEYSLOTS)
|
||||
return false;
|
||||
|
||||
/* Reset might clear all keys, so reprogram all the keys. */
|
||||
blk_ksm_reprogram_all_keys(&hba->ksm);
|
||||
return true;
|
||||
|
|
@ -157,6 +160,9 @@ 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_NO_KEYSLOTS)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Don't use crypto if either the hardware doesn't advertise the
|
||||
* standard crypto capability bit *or* if the vendor specific driver
|
||||
|
|
@ -228,6 +234,9 @@ void ufshcd_init_crypto(struct ufs_hba *hba)
|
|||
if (!(hba->caps & UFSHCD_CAP_CRYPTO))
|
||||
return;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_NO_KEYSLOTS)
|
||||
return;
|
||||
|
||||
/* Clear all keyslots - the number of keyslots is (CFGC + 1) */
|
||||
for (slot = 0; slot < hba->crypto_capabilities.config_count + 1; slot++)
|
||||
ufshcd_clear_keyslot(hba, slot);
|
||||
|
|
|
|||
|
|
@ -530,6 +530,15 @@ enum ufshcd_quirks {
|
|||
* auto-hibernate capability but it doesn't work.
|
||||
*/
|
||||
UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11,
|
||||
|
||||
/*
|
||||
* This quirk needs to be enabled if the host controller supports inline
|
||||
* encryption, but it uses a nonstandard mechanism where the standard
|
||||
* crypto registers aren't used and there is no concept of keyslots.
|
||||
* ufs_hba_variant_ops::init() is expected to initialize ufs_hba::ksm as
|
||||
* a passthrough keyslot manager.
|
||||
*/
|
||||
UFSHCD_QUIRK_NO_KEYSLOTS = 1 << 12,
|
||||
};
|
||||
|
||||
enum ufshcd_caps {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user