From: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Jie Gan <jie.gan@oss.qualcomm.com>,
ulf.hansson@linaro.org, adrian.hunter@intel.com,
quic_dmukhopa@quicinc.com, quic_rampraka@quicinc.com,
quic_nitirawa@quicinc.com, quic_sachgupt@quicinc.com,
quic_bhaskarv@quicinc.com, quic_gaurkash@quicinc.com,
quic_sartgarg@quicinc.com, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH RESEND v4] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume
Date: Tue, 28 Jul 2026 11:31:45 +0530 [thread overview]
Message-ID: <43722458-a767-ec08-bb14-e26c219fd70a@oss.qualcomm.com> (raw)
In-Reply-To: <20260723230104.GA662946@google.com>
On 7/24/2026 4:31 AM, Eric Biggers wrote:
> On Fri, May 29, 2026 at 04:05:52PM +0530, Neeraj Soni wrote:
>> Yes for cold boot this is true and Crypto reprogram is not needed. This patch addreses the use cases like
>> runtime suspend resume, deep sleep / Quick boot (DS/QB) and suspend to disk (aka hibernation) use cases
>> where the runtime context is preserved either in dynamic memory (DS/QB) or in secondry memory (hibernation).
>> This is tested internally on SAR1250P chipset for hibernation and DS/QB.
>
> But sdhci_msm_gcc_reset() is called only from the driver probe function
> (sdhci_msm_probe()), before MMC_CAP2_CRYPTO is set. So Jie's comment is
> correct: the new key reprogramming path is dead code. And as per the
> following comment, key reprogramming is still needed in some cases
> (https://lore.kernel.org/linux-mmc/42797330-868a-bfcd-e0bb-b5f0dd3eeb16@oss.qualcomm.com/).
> So doesn't this patch break the sdhci-msm driver?
>
Yes, re-programming is needed only when the host is reset while the device
either resumes from a known previous state (like in hibernation) or is
already operating in a known state. I understood the concern regarding
MMC_CAP2_CRYPTO and will move the reprogramming to sdhci_msm_ice_init().
This was also suggested by Ulf here (https://lore.kernel.org/linux-mmc/CAPx+jO8rUwYV6q1-RrA4aZ9XnomSf82fgf8Jh2fUC0fE03RFPw@mail.gmail.com/).
Will post V5 to fix this.
> I'm also skeptical of the following change, which seems unrelated to the
> rest of the patch:
>
>> -#ifdef CONFIG_MMC_CRYPTO
>> #define MMC_CAP2_CRYPTO (1 << 27) /* Host supports inline encryption */
>> -#else
>> -#define MMC_CAP2_CRYPTO 0
>> -#endif
>
> Because of that, mtk-sd sets MMC_CAP2_CRYPTO even when
> CONFIG_MMC_CRYPTO=n. That makes CQHCI_CRYPTO_GENERAL_ENABLE be used
> even when CONFIG_MMC_CRYPTO=n.
>
Yes this is unrelated but it was cleaned up while cleaning similar change
for MMC_CAP2_CRYPTO_NO_REPROG here (https://lore.kernel.org/linux-mmc/cead2d86-bac8-2d4f-1a7d-c9b90dc05a7c@oss.qualcomm.com/)
Konrad had similar suggestion here https://lore.kernel.org/linux-mmc/a569a2c3-2fb2-4a40-8d54-898e7c36f4b3@oss.qualcomm.com/)
I will fix the mtk-sd driver in V5.
> - Eric
>
Regards,
Neeraj
prev parent reply other threads:[~2026-07-28 6:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 9:26 [PATCH RESEND v4] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume Neeraj Soni
2026-05-29 10:19 ` Jie Gan
2026-05-29 10:35 ` Neeraj Soni
2026-07-23 23:01 ` Eric Biggers
2026-07-28 6:01 ` Neeraj Soni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43722458-a767-ec08-bb14-e26c219fd70a@oss.qualcomm.com \
--to=neeraj.soni@oss.qualcomm.com \
--cc=adrian.hunter@intel.com \
--cc=ebiggers@kernel.org \
--cc=jie.gan@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=quic_bhaskarv@quicinc.com \
--cc=quic_dmukhopa@quicinc.com \
--cc=quic_gaurkash@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=quic_rampraka@quicinc.com \
--cc=quic_sachgupt@quicinc.com \
--cc=quic_sartgarg@quicinc.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).