Re: [PATCH v5 2/4] mmc: sdhci-msm: Reprogram crypto keys during host hardware initialization
From: Eric Biggers
Date: Fri Jul 31 2026 - 02:22:20 EST
On Fri, Jul 31, 2026 at 11:37:44AM +0530, Neeraj Soni wrote:
>
>
> On 7/31/2026 12:48 AM, Eric Biggers wrote:
> > On Thu, Jul 30, 2026 at 07:38:20PM +0530, Neeraj Soni wrote:
> >> 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);
> >> +
> >
> > This still does nothing. The crypto profile was just initialized, so no
> > keyslots are in-use and blk_crypto_reprogram_all_keys() does nothing.
> >
> This is needed to address those scenarios where device is running in a
> stable state and only the host hardware goes for a reset, for example,
> to recover from an error state or stall.
Nope. Please check the actual code. This is called only at driver
probe time. Again, the crypto profile was just initialized, and no
keyslots are in-use. It is a no-op. Maybe you intended it to do
something else, but that is not what it actually does.
- Eric