From: Seshu Madhavi Puppala <quic_spuppala@quicinc.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, Eric Biggers <ebiggers@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>, <quic_rampraka@quicinc.com>,
<quic_nitirawa@quicinc.com>, <quic_sachgupt@quicinc.com>,
<quic_bhaskarv@quicinc.com>, <quic_neersoni@quicinc.com>,
<quic_gaurkash@quicinc.com>
Subject: Re: [PATCH RFC 0/2] Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume
Date: Thu, 21 Nov 2024 10:46:47 +0530 [thread overview]
Message-ID: <c41839b9-36b1-431e-9031-4e57f62b50c2@quicinc.com> (raw)
In-Reply-To: <CAPDyKFo5EijkL5Y+MZ0=ZWyGdLfDdSdqTOC0eMsTVY00KP+RAA@mail.gmail.com>
On 10/25/2024 2:12 PM, Ulf Hansson wrote:
> On Fri, 25 Oct 2024 at 04:56, Eric Biggers <ebiggers@kernel.org> wrote:
>>
>> On Fri, Oct 25, 2024 at 01:07:18AM +0200, Ulf Hansson wrote:
>>> On Wed, 23 Oct 2024 at 23:31, Eric Biggers <ebiggers@kernel.org> wrote:
>>>>
>>>> On Sun, Oct 06, 2024 at 07:25:28PM +0530, Seshu Madhavi Puppala wrote:
>>>>> Crypto reprogram all keys is called for each MMC runtime
>>>>> suspend/resume in current upstream design.
>>>>
>>>> Is that correct? I thought that similar to what is done for UFS, the key
>>>> reprogramming happens only after the MMC controller is reset. I thought that is
>>>> different from a runtime suspend.
>>>
>>> Looks like Seshu is not really worried about the host's runtime
>>> suspend, but the card's runtime suspend.
>>>
>>> Perhaps there are some out of tree code involved here that makes use
>>> of MMC_CAP_AGGRESSIVE_PM, which is what allows the card to be runtime
>>> suspended?
>>>
>>>>
>>>> If it's in fact triggering more often, maybe that is what needs to be fixed?
>>>
>>> We could extend the runtime PM autosusend timeout for the card, if
>>> that makes sense.
>>>
This change aims to address host side feature by not tying it up to card
side flag/feature.
>>> Kind regards
>>> Uffe
>>
>> The keyslots are being reprogrammed from mmc_set_initial_state(), which is
>> documented as:
>>
>> /*
>> * Set initial state after a power cycle or a hw_reset.
>> */
>> void mmc_set_initial_state(struct mmc_host *host)
>>
>> It's called by: mmc_power_up(), mmc_power_off(), _mmc_hw_reset(), and
>> mmc_sdio_sw_reset().
>>
>> Can that mean a power cycle of the card, not a power cycle of the host
>> controller?
>
> Yes, that's correct.
>
> Well, indirectly the host is likely to be power cycled too, but not necessarily.
>
>> The keyslots are part of the host controller, so that may explain
>> the problem. The keyslots should be reprogrammed only when the host controller
>> is reset, as that is when they are lost. (And it should not be skipped entirely
>> as this patchset does, as a host controller reset is possible.)
>>
This will be update via a separate patch by invoking reprogram_all_keys
API from sdhci_msm_gcc_reset() API
https://github.com/torvalds/linux/blob/master/drivers/mmc/host/sdhci-msm.c#L2363
Thanks,
Seshu
>> I am not an expert in MMC or in the details of how Qualcomm ICE is wired up to
>> the system, so I might have this wrong. But let me know if it sounds right.
>
> It sounds reasonable to me, but I also don't know the HW well enough
> to be able to tell.
>
> Looks like we need some more input from Seshu and the QC folkz to
> understand better.
>
> Kind regards
> Uffe
next prev parent reply other threads:[~2024-11-21 5:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-06 13:55 [PATCH RFC 0/2] Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume Seshu Madhavi Puppala
2024-10-06 13:55 ` [PATCH RFC v3 1/2] mmc: core: Add vendor hook to control reprogram keys to Crypto Engine Seshu Madhavi Puppala
2024-10-08 14:00 ` Ulf Hansson
2024-10-19 4:55 ` Seshu Madhavi Puppala
2024-10-22 12:27 ` Ulf Hansson
2024-10-23 8:59 ` Adrian Hunter
2024-10-23 21:28 ` Eric Biggers
2024-10-24 22:47 ` Ulf Hansson
2024-11-21 5:16 ` Seshu Madhavi Puppala
2024-10-06 13:55 ` [PATCH RFC v3 2/2] mmc: host: sdhci-msm: Avoid reprogram keys for QCOM socs Seshu Madhavi Puppala
2024-10-23 21:31 ` [PATCH RFC 0/2] Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume Eric Biggers
2024-10-24 23:07 ` Ulf Hansson
2024-10-25 2:56 ` Eric Biggers
2024-10-25 8:42 ` Ulf Hansson
2024-11-21 5:16 ` Seshu Madhavi Puppala [this message]
2024-11-21 11:03 ` Ulf Hansson
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=c41839b9-36b1-431e-9031-4e57f62b50c2@quicinc.com \
--to=quic_spuppala@quicinc.com \
--cc=adrian.hunter@intel.com \
--cc=ebiggers@kernel.org \
--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_gaurkash@quicinc.com \
--cc=quic_neersoni@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=quic_rampraka@quicinc.com \
--cc=quic_sachgupt@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