[PATCH v7 0/2] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume
From: Neeraj Soni
Date: Tue Aug 11 2026 - 11:24:25 EST
Crypto reprogram all keys is called for each MMC runtime suspend/resume in
current upstream design. If this is implemented as a non-interruptible
call to TEE for security, the cpu core is blocked for execution while this
call executes although the crypto engine already has the keys.
For example, glitches in audio/video streaming applications have been
observed due to this.
Fix this by allowing host driver to control when to re-program the
crypto keys.
---
Changes in v7:
- Register pm ops using pm_sleep_ptr() to allow dead code elimination when
!CONFIG_PM_SLEEP.
- Added sdhci_msm_ice_restore() to restore crypto keys.
Changes in v6:
- Dropped the change, introduced in [PATCH v4] https://lore.kernel.org/linux-mmc/20260116121004.1829223-1-neeraj.soni@xxxxxxxxxxxxxxxx/,
which removed encapsulation of MMC_CAP2_CRYPTO with CONFIG_MMC_CRYPTO.
- Dropped the change to re-program crypto keys in sdhci_msm_ice_init().
- Merged [PATCH v5 2/4] https://lore.kernel.org/linux-mmc/20260730140822.1976635-3-neeraj.soni@xxxxxxxxxxxxxxxx/
and [PATCH v5 3/4] https://lore.kernel.org/linux-mmc/20260730140822.1976635-4-neeraj.soni@xxxxxxxxxxxxxxxx/
into [PATCH v6 2/2].
- Dropped the [PATCH v5 4/4] https://lore.kernel.org/linux-mmc/20260730140822.1976635-5-neeraj.soni@xxxxxxxxxxxxxxxx/.
- Link to v5 https://lore.kernel.org/linux-mmc/20260730140822.1976635-1-neeraj.soni@xxxxxxxxxxxxxxxx/.
Changes in v5:
- Split the v4 patch https://lore.kernel.org/linux-mmc/20260529092612.1749752-1-neeraj.soni@xxxxxxxxxxxxxxxx/
as suggested here https://lore.kernel.org/all/CAPx+jO8rUwYV6q1-RrA4aZ9XnomSf82fgf8Jh2fUC0fE03RFPw@xxxxxxxxxxxxxx/
into 2 logical patches [PATCH v5 1/4] and [PATCH v5 2/4].
- Introduced [PATCH v5 3/4] to specifically restore crypto keys during
hibernation exit.
- Introduced [PATCH v5 4/4] to fix crypto capability usage in mtk-sd as
suggested here https://lore.kernel.org/all/20260723230104.GA662946@xxxxxxxxxx/.
- Dropped "Acked-by:" tag from v4 due to the split and introduction of
new changes.
Neeraj Soni (1):
mmc: Allow host driver to control the re-programming of crypto keys
Ram Prakash Gupta (1):
mmc: sdhci-msm: Use pm ops instead of macro to restore crypto keys
drivers/mmc/core/crypto.c | 2 +-
drivers/mmc/host/sdhci-msm.c | 32 +++++++++++++++++++++++++++++++-
include/linux/mmc/host.h | 1 +
3 files changed, 33 insertions(+), 2 deletions(-)
--
2.34.1