Re: [PATCH v2 2/2] ufs: ufs-qcom: Enable ICE before enabling crypto support
From: Eric Biggers
Date: Fri Nov 13 2026 - 01:01:19 EST
On Thu, Nov 12, 2026 at 06:48:18PM +0530, Kuldeep Singh wrote:
> ufs-qcom currently exposes UFS crypto profile and sets UFSHCD_CAP_CRYPTO
> before enabling ICE. This leaves a window where blk-crypto can issue
> keyslot programming calls before ufs-qcom has explicitly enabled ICE.
Please be more specific about what actually goes wrong, and why. During
probe, the crypto profile hasn't actually been registered with the block
layer yet. So the above seems inaccurate. Likewise in the MMC patch.
> static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
> {
> @@ -188,6 +190,12 @@ static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
>
> host->ice = ice;
>
> + err = qcom_ice_enable(host->ice);
Use the 'ice' local variable.
> @@ -636,12 +645,15 @@ static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba,
> * is initialized.
> */
> err = ufs_qcom_enable_lane_clks(host);
> + if (err)
> + return err;
> +
> + err = ufs_qcom_ice_enable(host);
> break;
> case POST_CHANGE:
> /* check if UFS PHY moved from DISABLED to HIBERN8 */
> err = ufs_qcom_check_hibern8(hba);
> ufs_qcom_enable_hw_clk_gating(hba);
> - ufs_qcom_ice_enable(host);
> ufs_qcom_config_ice_allocator(host);
> break;
Needs an explanation for why ufs_qcom_config_ice_allocator() and
ufs_qcom_ice_enable() need to be called at different times.
- Eric