[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241101031539.13285-5-quic_spuppala@quicinc.com>
Date: Fri, 1 Nov 2024 08:45:37 +0530
From: Seshu Madhavi Puppala <quic_spuppala@...cinc.com>
To: Adrian Hunter <adrian.hunter@...el.com>,
Asutosh Das <quic_asutoshd@...cinc.com>,
Ulf Hansson <ulf.hansson@...aro.org>
Cc: Ritesh Harjani <ritesh.list@...il.com>, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
quic_gaurkash@...cinc.com, quic_neersoni@...cinc.com,
quic_spuppala@...cinc.com
Subject: [PATCH RFC 4/6] mmc: host: wrapped keys support in mmc qcom
Use the wrapped keys quirk when hwkm is supported/used.
Whether to use HWKM or not would be decided during an ICE
probe, and based on this information, MMC can decide to use
wrapped keys or standard keys.
Also, propagate the appropriate key size to the ICE driver
when wrapped keys are used.
Signed-off-by: Seshu Madhavi Puppala <quic_spuppala@...cinc.com>
---
drivers/mmc/host/sdhci-msm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 0f2ce93f85cc..f031a4dbc719 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1834,6 +1834,9 @@ static int sdhci_msm_ice_init(struct sdhci_msm_host *msm_host,
msm_host->ice = ice;
mmc->caps2 |= MMC_CAP2_CRYPTO;
+ if (qcom_ice_hwkm_supported(msm_host->ice))
+ cq_host->quirks |= CQHCI_QUIRK_USES_WRAPPED_CRYPTO_KEYS;
+
return 0;
}
@@ -1880,7 +1883,11 @@ static int sdhci_msm_program_key(struct cqhci_host *cq_host,
cap.key_size != CQHCI_CRYPTO_KEY_SIZE_256)
return -EINVAL;
- ice_key_size = QCOM_ICE_CRYPTO_KEY_SIZE_256;
+ if (bkey->crypto_cfg.key_type == BLK_CRYPTO_KEY_TYPE_HW_WRAPPED)
+ ice_key_size = QCOM_ICE_CRYPTO_KEY_SIZE_WRAPPED;
+ else
+ ice_key_size = QCOM_ICE_CRYPTO_KEY_SIZE_256;
+
if (cfg->config_enable & CQHCI_CRYPTO_CONFIGURATION_ENABLE)
return qcom_ice_program_key(msm_host->ice,
QCOM_ICE_CRYPTO_ALG_AES_XTS,
--
2.17.1
Powered by blists - more mailing lists