From d8ddb5c0c99b3dfd88ab5a7d2ed784d8b78cc3d4 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 19 Jul 2024 19:05:01 +0000 Subject: [PATCH] Revert "ANDROID: scsi: ufs: allow overriding the blk_crypto_profile" This reverts the changes from ANDROID-scsi-ufs-allow-overriding-the-blk_crypto_profile.patch. Equivalent functionality was upstreamed in v6.11. Bug: 162257402 Change-Id: I642e4c5bd01023c61f1177faaabcc57f474527f0 Signed-off-by: Eric Biggers --- drivers/ufs/core/ufshcd-crypto.c | 10 +++------- include/ufs/ufshcd.h | 16 ---------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/ufs/core/ufshcd-crypto.c b/drivers/ufs/core/ufshcd-crypto.c index 14d06c381d3b..f4cc54d82281 100644 --- a/drivers/ufs/core/ufshcd-crypto.c +++ b/drivers/ufs/core/ufshcd-crypto.c @@ -159,9 +159,6 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba) int err = 0; enum blk_crypto_mode_num blk_mode_num; - if (hba->android_quirks & UFSHCD_ANDROID_QUIRK_CUSTOM_CRYPTO_PROFILE) - return 0; - /* * Don't use crypto if either the hardware doesn't advertise the * standard crypto capability bit *or* if the vendor specific driver @@ -232,10 +229,9 @@ void ufshcd_init_crypto(struct ufs_hba *hba) if (!(hba->caps & UFSHCD_CAP_CRYPTO)) return; - /* Clear all keyslots */ - for (slot = 0; slot < hba->crypto_profile.num_slots; slot++) - hba->crypto_profile.ll_ops.keyslot_evict(&hba->crypto_profile, - NULL, slot); + /* 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); } void ufshcd_crypto_register(struct ufs_hba *hba, struct request_queue *q) diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 6021f2cf5c25..0a6d5fcd97af 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -645,20 +645,6 @@ enum ufshcd_quirks { UFSHCD_QUIRK_MCQ_BROKEN_RTC = 1 << 21, }; -enum ufshcd_android_quirks { - - /* - * IMPORTANT: set this in hba->android_quirks, not hba->quirks! - * - * This quirk needs to be enabled if the host controller supports inline - * encryption, but it needs to initialize the crypto capabilities in a - * nonstandard way and/or it needs to override blk_crypto_ll_ops. If - * enabled, the standard code won't initialize the blk_crypto_profile; - * ufs_hba_variant_ops::init() must do it instead. - */ - UFSHCD_ANDROID_QUIRK_CUSTOM_CRYPTO_PROFILE = 1 << 0, -}; - enum ufshcd_caps { /* Allow dynamic clk gating */ UFSHCD_CAP_CLK_GATING = 1 << 0, @@ -987,8 +973,6 @@ struct ufs_hba { unsigned int quirks; /* Deviations from standard UFSHCI spec. */ - unsigned int android_quirks; /* for UFSHCD_ANDROID_QUIRK_* flags */ - /* Device deviations from standard UFS device spec. */ unsigned int dev_quirks;