Skip to contentSkip to conversation

scsi: ufs: exynos: Don't resume FMP when crypto support disabled

PATCH Applied Eric Biggers 3 participants 3 messages Jul 21, 2024 – Jul 23, 2024

Subsystems (4)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 scsi: ufs: exynos: Don't resume FMP when crypto support disabled

From: Eric Biggers <[email protected]>

If exynos_ufs_fmp_init() did not enable FMP support, then exynos_ufs_fmp_resume() should not execute the FMP-related SMC calls.

Fixes c96499fcb403 ("scsi: ufs: exynos: Add support for Flash Memory Protector (FMP)")
---
 drivers/ufs/host/ufs-exynos.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ufs/host/ufs-exynos.c +3 -0
index 16ad3528d80b..9ec318ef52bf 100644
@@ -1291,10 +1291,13 @@ static void exynos_ufs_fmp_init(struct ufs_hba *hba, struct exynos_ufs *ufs)
 
 static void exynos_ufs_fmp_resume(struct ufs_hba *hba)
 {
 	struct arm_smccc_res res;
 
+	if (!(hba->caps & UFSHCD_CAP_CRYPTO))
+		return;
+
 	arm_smccc_smc(SMC_CMD_FMP_SECURITY, 0, SMU_EMBEDDED, CFG_DESCTYPE_3,
 		      0, 0, 0, 0, &res);
 	if (res.a0)
 		dev_err(hba->dev,
 			"SMC_CMD_FMP_SECURITY failed on resume: %ld\n", res.a0);

base-commit: 2c9b3512402ed192d1f43f4531fb5da947e72bd0

Signature · 1 line
2.45.2
#2 lore raw
In reply to Eric Biggers

Eric,

Quoted 2 lines

If exynos_ufs_fmp_init() did not enable FMP support, then exynos_ufs_fmp_resume() should not execute the FMP-related SMC calls.

Applied to 6.11/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering