Re: [PATCH 11/11] soc: qcom: ice: Add explicit power-domain and clock voting calls for ICE
From: Manivannan Sadhasivam
Date: Fri Feb 20 2026 - 09:45:00 EST
On Fri, Jan 23, 2026 at 12:41:35PM +0530, Harshal Dev wrote:
> Since Qualcomm inline-crypto engine (ICE) is now a dedicated driver
> de-coupled from the QCOM UFS driver, it should explicitly vote for it's
> needed resources during probe, specifically the UFS_PHY_GDSC power-domain
> and the 'core' and 'iface' clocks.
You don't need to vote for a single power domain since genpd will do that for
you before the driver probes.
> Also updated the suspend and resume callbacks to handle votes on these
> resources.
>
> Signed-off-by: Harshal Dev <harshal.dev@xxxxxxxxxxxxxxxx>
Where is the Fixes tag?
> ---
> drivers/soc/qcom/ice.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
> index b203bc685cad..4b50d05ca02a 100644
> --- a/drivers/soc/qcom/ice.c
> +++ b/drivers/soc/qcom/ice.c
> @@ -16,6 +16,8 @@
> #include <linux/of.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <linux/pm.h>
> +#include <linux/pm_runtime.h>
>
> #include <linux/firmware/qcom/qcom_scm.h>
>
> @@ -108,6 +110,7 @@ struct qcom_ice {
> void __iomem *base;
>
> struct clk *core_clk;
> + struct clk *iface_clk;
> bool use_hwkm;
> bool hwkm_init_complete;
> u8 hwkm_version;
> @@ -310,12 +313,20 @@ int qcom_ice_resume(struct qcom_ice *ice)
> struct device *dev = ice->dev;
> int err;
>
> + pm_runtime_get_sync(dev);
This is not needed as the power domain would be enabled at this point.
> err = clk_prepare_enable(ice->core_clk);
> if (err) {
> dev_err(dev, "failed to enable core clock (%d)\n",
> err);
> return err;
> }
> +
> + err = clk_prepare_enable(ice->iface_clk);
> + if (err) {
> + dev_err(dev, "failed to enable iface clock (%d)\n",
> + err);
> + return err;
> + }
Use clk_bulk API to enable all clocks in one go.
> qcom_ice_hwkm_init(ice);
> return qcom_ice_wait_bist_status(ice);
> }
> @@ -323,7 +334,9 @@ EXPORT_SYMBOL_GPL(qcom_ice_resume);
>
> int qcom_ice_suspend(struct qcom_ice *ice)
> {
> + clk_disable_unprepare(ice->iface_clk);
Same here.
> clk_disable_unprepare(ice->core_clk);
> + pm_runtime_put_sync(ice->dev);
Not needed.
> ice->hwkm_init_complete = false;
>
> return 0;
> @@ -584,6 +597,10 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
> if (IS_ERR(engine->core_clk))
> return ERR_CAST(engine->core_clk);
>
> + engine->iface_clk = devm_clk_get_enabled(dev, "iface_clk");
> + if (IS_ERR(engine->iface_clk))
> + return ERR_CAST(engine->iface_clk);
> +
Same here. Use devm_clk_bulk_get_all_enabled().
> if (!qcom_ice_check_supported(engine))
> return ERR_PTR(-EOPNOTSUPP);
>
> @@ -725,6 +742,9 @@ static int qcom_ice_probe(struct platform_device *pdev)
> return PTR_ERR(base);
> }
>
> + devm_pm_runtime_enable(&pdev->dev);
> + pm_runtime_get_sync(&pdev->dev);
If you want to mark & enable the runtime PM status, you should just do:
devm_pm_runtime_set_active_enabled();
But this is not really needed in this patch. You can add it in a separate patch
for the sake of correctness.
- Mani
--
மணிவண்ணன் சதாசிவம்