[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFpXh0vZrK6PU2V+y92Q_+y6Q2+VUEONXiBrqAp_qqp_jA@mail.gmail.com>
Date: Tue, 8 Oct 2024 16:00:39 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Seshu Madhavi Puppala <quic_spuppala@...cinc.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
quic_rampraka@...cinc.com, quic_nitirawa@...cinc.com,
quic_sachgupt@...cinc.com, quic_bhaskarv@...cinc.com,
quic_neersoni@...cinc.com, quic_gaurkash@...cinc.com
Subject: Re: [PATCH RFC v3 1/2] mmc: core: Add vendor hook to control
reprogram keys to Crypto Engine
On Sun, 6 Oct 2024 at 15:55, Seshu Madhavi Puppala
<quic_spuppala@...cinc.com> wrote:
>
> Add mmc_host_ops hook avoid_reprogram_allkeys to control
> reprogramming keys to Inline Crypto Engine by vendor as some
> vendors might not require this feature.
>
> Signed-off-by: Seshu Madhavi Puppala <quic_spuppala@...cinc.com>
> Co-developed-by: Ram Prakash Gupta <quic_rampraka@...cinc.com>
> Signed-off-by: Ram Prakash Gupta <quic_rampraka@...cinc.com>
> ---
> drivers/mmc/core/crypto.c | 8 +++++---
> drivers/mmc/host/sdhci.c | 6 ++++++
> include/linux/mmc/host.h | 7 +++++++
> 3 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/crypto.c b/drivers/mmc/core/crypto.c
> index fec4fbf16a5b..4168f7d135ff 100644
> --- a/drivers/mmc/core/crypto.c
> +++ b/drivers/mmc/core/crypto.c
> @@ -14,9 +14,11 @@
>
> void mmc_crypto_set_initial_state(struct mmc_host *host)
> {
> - /* Reset might clear all keys, so reprogram all the keys. */
> - if (host->caps2 & MMC_CAP2_CRYPTO)
> - blk_crypto_reprogram_all_keys(&host->crypto_profile);
> + if (host->ops->avoid_reprogram_allkeys && !host->ops->avoid_reprogram_allkeys()) {
> + /* Reset might clear all keys, so reprogram all the keys. */
> + if (host->caps2 & MMC_CAP2_CRYPTO)
> + blk_crypto_reprogram_all_keys(&host->crypto_profile);
Don't you even need to call this once, during the first initialization
of the card?
> + }
> }
>
[...]
Kind regards
Uffe
Powered by blists - more mailing lists