mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Debraj Mukhopadhyay <quic_dmukhopa@quicinc.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Eric Biggers <ebiggers@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, kernel@quicinc.com,
	Neeraj Soni <quic_neersoni@quicinc.com>,
	Ram Prakash Gupta <quic_rampraka@quicinc.com>,
	Nitin Rawat <quic_nitirawa@quicinc.com>,
	Sachin Gupta <quic_sachgupt@quicinc.com>,
	Bhaskar Valaboju <quic_bhaskarv@quicinc.com>,
	Gaurav Kashyap <quic_gaurkash@quicinc.com>,
	Sarthak Garg <quic_sartgarg@quicinc.com>
Subject: Re: [PATCH v3] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume
Date: Tue, 6 Jan 2026 11:14:55 +0530	[thread overview]
Message-ID: <e1f689d0-523b-5842-3a6e-10b431d617ce@oss.qualcomm.com> (raw)
In-Reply-To: <CAPDyKFqgo4ewJxPOUmY-GE+CG2XUVGQvEqgTQnvo0MfryMemGw@mail.gmail.com>

Hi,

Apologies on replying so late to the queries.

On 7/18/2025 6:27 PM, Ulf Hansson wrote:
> On Fri, 18 Jul 2025 at 14:05, Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>>
>> On 7/18/25 1:02 PM, Debraj Mukhopadhyay wrote:
>>> 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. Add the flag
>>> MMC_CAP2_CRYPTO_NO_REPROG as part of host->caps2 to control reprogramming
>>> keys to crypto engine for socs which dont require this feature.
>>>
>>> Signed-off-by: Seshu Madhavi Puppala <quic_spuppala@quicinc.com>
>>> Co-developed-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>>> Co-developed-by: Sarthak Garg <quic_sartgarg@quicinc.com>
>>> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
>>> Signed-off-by: Debraj Mukhopadhyay <quic_dmukhopa@quicinc.com>
>>>
>>> ---
>>
>> Let's take a step back - do we need to ever program this more than
>> once on QC? What about other devices (e.g. the generic cqhci-crypto)?
>> Do they also lose the crypto context over a runtime pm cycle?
> 
> I agree!
> 
> I also think it's important to also understand what runtime PM cycle
> we are discussing here. It's a bit blurry for me currently, can we
> please clarify this.
> 
> A runtime PM cycle of the card, means that the eMMC card is
> power-cycled and re-initialized (assuming MMC_CAP_AGGRESSIVE_PM is
> set, which I guess is a downstream patch as the upstream sdhci-msm
> driver doesn't have this bit set, at least not yet). The mmc host is
> probably also runtime PM power-cycled when the card is, but it's
> orthogonal to the runtime PM cycle of the card - that's a really
> important point here, I think.
> 
> As I understand it, the crypto context is not tied to the card, but to
> the mmc host. What happens with the crypto context when the mmc host
> is runtime PM cycled? Is the context preserved? I assume so, or?
Yes the crypto context is tied to the host not to the card. In QC case when 
the host is runtime pm cycled the crypto contexts are preserved hence reprogramming
is not needed.
> 
>>
>> If our hardware is fine with set-it-and-forget-it approach, maybe
>> we could limit this to a small if-condition sdhci-msm.c
> 
> Yes, maybe. Let's see> 
> [...]
> 
> Kind regards
> Uffe
> 
> 

  reply	other threads:[~2026-01-06  5:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 11:02 Debraj Mukhopadhyay
2025-07-18 12:05 ` Konrad Dybcio
2025-07-18 12:57   ` Ulf Hansson
2026-01-06  5:44     ` Neeraj Soni [this message]
2026-01-06  6:49   ` Neeraj Soni
2026-01-08  9:43     ` Konrad Dybcio
2026-01-09  6:36       ` Neeraj Soni

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=e1f689d0-523b-5842-3a6e-10b431d617ce@oss.qualcomm.com \
    --to=neeraj.soni@oss.qualcomm.com \
    --cc=adrian.hunter@intel.com \
    --cc=ebiggers@kernel.org \
    --cc=kernel@quicinc.com \
    --cc=konrad.dybcio@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_neersoni@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

all inboxes | Powered by JetHome®