@@ -278,7 +278,8 @@ int ufshcd_hba_init_crypto(struct ufs_hba *hba)
hba->caps &= ~UFSHCD_CAP_CRYPTO;
/* Return 0 if crypto support isn't present */
- if (!(hba->capabilities & MASK_CRYPTO_SUPPORT))
+ if (!(hba->capabilities & MASK_CRYPTO_SUPPORT) ||
+ (hba->quirks & UFSHCD_QUIRK_BROKEN_CRYPTO))
goto out;
/*
@@ -650,6 +650,13 @@ struct ufs_hba {
* enabled via HCE register.
*/
#define UFSHCI_QUIRK_BROKEN_HCE 0x400
+
+ /*
+ * This quirk needs to be enabled if the host controller advertises
+ * inline encryption support but it doesn't work correctly.
+ */
+ #define UFSHCD_QUIRK_BROKEN_CRYPTO 0x800
+
unsigned int quirks; /* Deviations from standard UFSHCI spec. */
/* Device deviations from standard UFS device spec. */