[PATCH v5 2/4] mmc: sdhci-msm: Reprogram crypto keys during host hardware initialization

From: Neeraj Soni

Date: Thu Jul 30 2026 - 10:26:27 EST


Host looses the Inline Crypto Engine (ICE) keys during hardware reset.
Re-program the keys while intializing ICE to ensure that ICE is available
in the same state as before the hardware reset.

Also set MMC_CAP2_CRYPTO_NO_REPROG to indicate that re-program of ICE keys
is not needed during MMC runtime suspend/resume.

Signed-off-by: Seshu Madhavi Puppala <quic_spuppala@xxxxxxxxxxx>
Co-developed-by: Ram Prakash Gupta <quic_rampraka@xxxxxxxxxxx>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@xxxxxxxxxxx>
Co-developed-by: Sarthak Garg <quic_sartgarg@xxxxxxxxxxx>
Signed-off-by: Sarthak Garg <quic_sartgarg@xxxxxxxxxxx>
Signed-off-by: Debraj Mukhopadhyay <quic_dmukhopa@xxxxxxxxxxx>
Signed-off-by: Neeraj Soni <neeraj.soni@xxxxxxxxxxxxxxxx>
---
drivers/mmc/host/sdhci-msm.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 4aff965f0e2e..7d71dc6f388d 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1958,7 +1958,10 @@ static int sdhci_msm_ice_init(struct sdhci_msm_host *msm_host,
cap.sdus_mask * 512;
}

+ blk_crypto_reprogram_all_keys(&mmc->crypto_profile);
+
mmc->caps2 |= MMC_CAP2_CRYPTO;
+ mmc->caps2 |= MMC_CAP2_CRYPTO_NO_REPROG;
return 0;
}

--
2.34.1