* [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
2026-01-23 7:12 [PATCH v3 0/3] Enable ICE clock scaling Abhinaba Rakshit
@ 2026-01-23 7:12 ` Abhinaba Rakshit
2026-01-23 19:21 ` Dmitry Baryshkov
2026-01-23 7:12 ` [PATCH v3 2/3] ufs: host: Add ICE clock scaling during UFS clock changes Abhinaba Rakshit
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-23 7:12 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni
Cc: linux-arm-msm, linux-kernel, linux-scsi, Abhinaba Rakshit
Register optional operation-points-v2 table for ICE device
and aquire its minimum and maximum frequency during ICE
device probe.
Introduce clock scaling API qcom_ice_scale_clk which scale ICE
core clock if valid (non-zero) frequencies are obtained from
OPP-table. Disable clock scaling if OPP-table is not registered.
When an ICE-device specific OPP table is available, use the PM OPP
framework to manage frequency scaling and maintain proper power-domain
constraints.
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
---
drivers/soc/qcom/ice.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
include/soc/qcom/ice.h | 1 +
2 files changed, 64 insertions(+)
diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
index b203bc685cadd21d6f96eb1799963a13db4b2b72..ca6a7df7a6827378af1f013c7e62a835d1b80cc5 100644
--- a/drivers/soc/qcom/ice.c
+++ b/drivers/soc/qcom/ice.c
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/pm_opp.h>
#include <linux/firmware/qcom/qcom_scm.h>
@@ -111,6 +112,9 @@ struct qcom_ice {
bool use_hwkm;
bool hwkm_init_complete;
u8 hwkm_version;
+ unsigned long max_freq;
+ unsigned long min_freq;
+ bool has_opp;
};
static bool qcom_ice_check_supported(struct qcom_ice *ice)
@@ -549,10 +553,29 @@ int qcom_ice_import_key(struct qcom_ice *ice,
}
EXPORT_SYMBOL_GPL(qcom_ice_import_key);
+int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up)
+{
+ int ret = 0;
+
+ if (!ice->has_opp)
+ return ret;
+
+ if (scale_up && ice->max_freq)
+ ret = dev_pm_opp_set_rate(ice->dev, ice->max_freq);
+ else if (!scale_up && ice->min_freq)
+ ret = dev_pm_opp_set_rate(ice->dev, ice->min_freq);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(qcom_ice_scale_clk);
+
static struct qcom_ice *qcom_ice_create(struct device *dev,
void __iomem *base)
{
struct qcom_ice *engine;
+ struct dev_pm_opp *opp;
+ int err;
+ unsigned long rate;
if (!qcom_scm_is_available())
return ERR_PTR(-EPROBE_DEFER);
@@ -584,6 +607,46 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
if (IS_ERR(engine->core_clk))
return ERR_CAST(engine->core_clk);
+ /* Register the OPP table only when ICE is described as a standalone
+ * device node. Older platforms place ICE inside the storage controller
+ * node, so they don't need an OPP table here, as they are handled in
+ * storage controller.
+ */
+ if (of_device_is_compatible(dev->of_node, "qcom,inline-crypto-engine")) {
+ /* OPP table is optional */
+ err = devm_pm_opp_of_add_table(dev);
+ if (err && err != -ENODEV) {
+ dev_err(dev, "Invalid OPP table in Device tree\n");
+ return ERR_PTR(err);
+ }
+ engine->has_opp = (err == 0);
+
+ if (!engine->has_opp)
+ dev_info(dev, "ICE OPP table is not registered\n");
+ }
+
+ if (engine->has_opp) {
+ /* Find the ICE core clock min frequency */
+ rate = 0;
+ opp = dev_pm_opp_find_freq_ceil_indexed(dev, &rate, 0);
+ if (IS_ERR(opp)) {
+ dev_warn(dev, "Unable to find ICE core clock min freq\n");
+ } else {
+ engine->min_freq = rate;
+ dev_pm_opp_put(opp);
+ }
+
+ /* Find the ICE core clock max frequency */
+ rate = ULONG_MAX;
+ opp = dev_pm_opp_find_freq_floor_indexed(dev, &rate, 0);
+ if (IS_ERR(opp)) {
+ dev_warn(dev, "Unable to find ICE core clock max freq\n");
+ } else {
+ engine->max_freq = rate;
+ dev_pm_opp_put(opp);
+ }
+ }
+
if (!qcom_ice_check_supported(engine))
return ERR_PTR(-EOPNOTSUPP);
diff --git a/include/soc/qcom/ice.h b/include/soc/qcom/ice.h
index 4bee553f0a59d86ec6ce20f7c7b4bce28a706415..b701ec9e062f70152f6dea8bf6c4637ab6ef20f1 100644
--- a/include/soc/qcom/ice.h
+++ b/include/soc/qcom/ice.h
@@ -30,5 +30,6 @@ int qcom_ice_import_key(struct qcom_ice *ice,
const u8 *raw_key, size_t raw_key_size,
u8 lt_key[BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]);
struct qcom_ice *devm_of_qcom_ice_get(struct device *dev);
+int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up);
#endif /* __QCOM_ICE_H__ */
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
2026-01-23 7:12 ` [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE Abhinaba Rakshit
@ 2026-01-23 19:21 ` Dmitry Baryshkov
2026-01-26 10:23 ` Konrad Dybcio
2026-01-27 9:38 ` Abhinaba Rakshit
0 siblings, 2 replies; 10+ messages in thread
From: Dmitry Baryshkov @ 2026-01-23 19:21 UTC (permalink / raw)
To: Abhinaba Rakshit
Cc: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni,
linux-arm-msm, linux-kernel, linux-scsi
On Fri, Jan 23, 2026 at 12:42:12PM +0530, Abhinaba Rakshit wrote:
> Register optional operation-points-v2 table for ICE device
> and aquire its minimum and maximum frequency during ICE
> device probe.
>
> Introduce clock scaling API qcom_ice_scale_clk which scale ICE
> core clock if valid (non-zero) frequencies are obtained from
> OPP-table. Disable clock scaling if OPP-table is not registered.
>
> When an ICE-device specific OPP table is available, use the PM OPP
> framework to manage frequency scaling and maintain proper power-domain
> constraints.
>
> Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
> ---
> drivers/soc/qcom/ice.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
> include/soc/qcom/ice.h | 1 +
> 2 files changed, 64 insertions(+)
>
> diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
> index b203bc685cadd21d6f96eb1799963a13db4b2b72..ca6a7df7a6827378af1f013c7e62a835d1b80cc5 100644
> --- a/drivers/soc/qcom/ice.c
> +++ b/drivers/soc/qcom/ice.c
> @@ -16,6 +16,7 @@
> #include <linux/of.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_opp.h>
>
> #include <linux/firmware/qcom/qcom_scm.h>
>
> @@ -111,6 +112,9 @@ struct qcom_ice {
> bool use_hwkm;
> bool hwkm_init_complete;
> u8 hwkm_version;
> + unsigned long max_freq;
> + unsigned long min_freq;
> + bool has_opp;
> };
>
> static bool qcom_ice_check_supported(struct qcom_ice *ice)
> @@ -549,10 +553,29 @@ int qcom_ice_import_key(struct qcom_ice *ice,
> }
> EXPORT_SYMBOL_GPL(qcom_ice_import_key);
>
> +int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up)
> +{
> + int ret = 0;
> +
> + if (!ice->has_opp)
> + return ret;
> +
> + if (scale_up && ice->max_freq)
> + ret = dev_pm_opp_set_rate(ice->dev, ice->max_freq);
> + else if (!scale_up && ice->min_freq)
> + ret = dev_pm_opp_set_rate(ice->dev, ice->min_freq);
Do we expect that there allways will be only two entries in the OPP?
If so, it should be a part of the bindings. If not, please design the
API with more flexibility in mind.
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(qcom_ice_scale_clk);
> +
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
2026-01-23 19:21 ` Dmitry Baryshkov
@ 2026-01-26 10:23 ` Konrad Dybcio
2026-01-27 9:39 ` Abhinaba Rakshit
2026-01-27 9:38 ` Abhinaba Rakshit
1 sibling, 1 reply; 10+ messages in thread
From: Konrad Dybcio @ 2026-01-26 10:23 UTC (permalink / raw)
To: Dmitry Baryshkov, Abhinaba Rakshit
Cc: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni,
linux-arm-msm, linux-kernel, linux-scsi
On 1/23/26 8:21 PM, Dmitry Baryshkov wrote:
> On Fri, Jan 23, 2026 at 12:42:12PM +0530, Abhinaba Rakshit wrote:
>> Register optional operation-points-v2 table for ICE device
>> and aquire its minimum and maximum frequency during ICE
>> device probe.
>>
>> Introduce clock scaling API qcom_ice_scale_clk which scale ICE
>> core clock if valid (non-zero) frequencies are obtained from
>> OPP-table. Disable clock scaling if OPP-table is not registered.
>>
>> When an ICE-device specific OPP table is available, use the PM OPP
>> framework to manage frequency scaling and maintain proper power-domain
>> constraints.
>>
>> Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
>> ---
[...]
>> +int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up)
>> +{
>> + int ret = 0;
>> +
>> + if (!ice->has_opp)
>> + return ret;
>> +
>> + if (scale_up && ice->max_freq)
>> + ret = dev_pm_opp_set_rate(ice->dev, ice->max_freq);
>> + else if (!scale_up && ice->min_freq)
>> + ret = dev_pm_opp_set_rate(ice->dev, ice->min_freq);
>
> Do we expect that there allways will be only two entries in the OPP?
> If so, it should be a part of the bindings. If not, please design the
> API with more flexibility in mind.
hamoa:
LOW_SVS: 100 MHz
SVS: 201.5 MHz
NOM: 403 MHz
Konrad
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
2026-01-26 10:23 ` Konrad Dybcio
@ 2026-01-27 9:39 ` Abhinaba Rakshit
0 siblings, 0 replies; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-27 9:39 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Dmitry Baryshkov, Bjorn Andersson, Konrad Dybcio,
Manivannan Sadhasivam, James E.J. Bottomley, Martin K. Petersen,
Neeraj Soni, linux-arm-msm, linux-kernel, linux-scsi
On Mon, Jan 26, 2026 at 11:23:51AM +0100, Konrad Dybcio wrote:
> On 1/23/26 8:21 PM, Dmitry Baryshkov wrote:
> > On Fri, Jan 23, 2026 at 12:42:12PM +0530, Abhinaba Rakshit wrote:
> >> Register optional operation-points-v2 table for ICE device
> >> and aquire its minimum and maximum frequency during ICE
> >> device probe.
> >>
> >> Introduce clock scaling API qcom_ice_scale_clk which scale ICE
> >> core clock if valid (non-zero) frequencies are obtained from
> >> OPP-table. Disable clock scaling if OPP-table is not registered.
> >>
> >> When an ICE-device specific OPP table is available, use the PM OPP
> >> framework to manage frequency scaling and maintain proper power-domain
> >> constraints.
> >>
> >> Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
> >> ---
>
> [...]
>
> >> +int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up)
> >> +{
> >> + int ret = 0;
> >> +
> >> + if (!ice->has_opp)
> >> + return ret;
> >> +
> >> + if (scale_up && ice->max_freq)
> >> + ret = dev_pm_opp_set_rate(ice->dev, ice->max_freq);
> >> + else if (!scale_up && ice->min_freq)
> >> + ret = dev_pm_opp_set_rate(ice->dev, ice->min_freq);
> >
> > Do we expect that there allways will be only two entries in the OPP?
> > If so, it should be a part of the bindings. If not, please design the
> > API with more flexibility in mind.
>
> hamoa:
>
> LOW_SVS: 100 MHz
> SVS: 201.5 MHz
> NOM: 403 MHz
>
Understood, will update the patch-series with multiple-frequency
clock scaling support.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
2026-01-23 19:21 ` Dmitry Baryshkov
2026-01-26 10:23 ` Konrad Dybcio
@ 2026-01-27 9:38 ` Abhinaba Rakshit
1 sibling, 0 replies; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-27 9:38 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni,
linux-arm-msm, linux-kernel, linux-scsi
On Fri, Jan 23, 2026 at 09:21:40PM +0200, Dmitry Baryshkov wrote:
> On Fri, Jan 23, 2026 at 12:42:12PM +0530, Abhinaba Rakshit wrote:
> > Register optional operation-points-v2 table for ICE device
> > and aquire its minimum and maximum frequency during ICE
> > device probe.
> >
> > Introduce clock scaling API qcom_ice_scale_clk which scale ICE
> > core clock if valid (non-zero) frequencies are obtained from
> > OPP-table. Disable clock scaling if OPP-table is not registered.
> >
> > When an ICE-device specific OPP table is available, use the PM OPP
> > framework to manage frequency scaling and maintain proper power-domain
> > constraints.
> >
> > Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
> > ---
> > drivers/soc/qcom/ice.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > include/soc/qcom/ice.h | 1 +
> > 2 files changed, 64 insertions(+)
> >
> > diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
> > index b203bc685cadd21d6f96eb1799963a13db4b2b72..ca6a7df7a6827378af1f013c7e62a835d1b80cc5 100644
> > --- a/drivers/soc/qcom/ice.c
> > +++ b/drivers/soc/qcom/ice.c
> > @@ -16,6 +16,7 @@
> > #include <linux/of.h>
> > #include <linux/of_platform.h>
> > #include <linux/platform_device.h>
> > +#include <linux/pm_opp.h>
> >
> > #include <linux/firmware/qcom/qcom_scm.h>
> >
> > @@ -111,6 +112,9 @@ struct qcom_ice {
> > bool use_hwkm;
> > bool hwkm_init_complete;
> > u8 hwkm_version;
> > + unsigned long max_freq;
> > + unsigned long min_freq;
> > + bool has_opp;
> > };
> >
> > static bool qcom_ice_check_supported(struct qcom_ice *ice)
> > @@ -549,10 +553,29 @@ int qcom_ice_import_key(struct qcom_ice *ice,
> > }
> > EXPORT_SYMBOL_GPL(qcom_ice_import_key);
> >
> > +int qcom_ice_scale_clk(struct qcom_ice *ice, bool scale_up)
> > +{
> > + int ret = 0;
> > +
> > + if (!ice->has_opp)
> > + return ret;
> > +
> > + if (scale_up && ice->max_freq)
> > + ret = dev_pm_opp_set_rate(ice->dev, ice->max_freq);
> > + else if (!scale_up && ice->min_freq)
> > + ret = dev_pm_opp_set_rate(ice->dev, ice->min_freq);
>
> Do we expect that there allways will be only two entries in the OPP?
> If so, it should be a part of the bindings. If not, please design the
> API with more flexibility in mind.
No.
Thanks for pointing this out. With OPP v2 being used we can indeed,
support multiple frequencies.
Also UFS core using devfreq clock scaling can scale among
multiple-frequencies depending on the load.
Will update the patch-set, with multi-frequency scale support.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 2/3] ufs: host: Add ICE clock scaling during UFS clock changes
2026-01-23 7:12 [PATCH v3 0/3] Enable ICE clock scaling Abhinaba Rakshit
2026-01-23 7:12 ` [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE Abhinaba Rakshit
@ 2026-01-23 7:12 ` Abhinaba Rakshit
2026-01-23 7:12 ` [PATCH v3 3/3] soc: qcom: ice: Set ICE clk to TURBO on probe Abhinaba Rakshit
2026-01-23 19:18 ` [PATCH v3 0/3] Enable ICE clock scaling Dmitry Baryshkov
3 siblings, 0 replies; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-23 7:12 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni
Cc: linux-arm-msm, linux-kernel, linux-scsi, Abhinaba Rakshit
Implement ICE (Inline Crypto Engine) clock scaling in sync with
UFS controller clock scaling. This ensures that the ICE operates at
an appropriate frequency when the UFS clocks are scaled up or down,
improving performance and maintaining stability for crypto operations.
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
---
drivers/ufs/host/ufs-qcom.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 8d119b3223cbdaa3297d2beabced0962a1a847d5..a60b60eb777a674fb4345fd393bde0eab3571a23 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -305,6 +305,14 @@ static int ufs_qcom_ice_prepare_key(struct blk_crypto_profile *profile,
return qcom_ice_prepare_key(host->ice, lt_key, lt_key_size, eph_key);
}
+static int ufs_qcom_ice_scale_clk(struct ufs_qcom_host *host, bool scale_up)
+{
+ if (host->hba->caps & UFSHCD_CAP_CRYPTO)
+ return qcom_ice_scale_clk(host->ice, scale_up);
+
+ return 0;
+}
+
static const struct blk_crypto_ll_ops ufs_qcom_crypto_ops = {
.keyslot_program = ufs_qcom_ice_keyslot_program,
.keyslot_evict = ufs_qcom_ice_keyslot_evict,
@@ -339,6 +347,11 @@ static void ufs_qcom_config_ice_allocator(struct ufs_qcom_host *host)
{
}
+static int ufs_qcom_ice_scale_clk(struct ufs_qcom_host *host, bool scale_up)
+{
+ return 0;
+}
+
#endif
static void ufs_qcom_disable_lane_clks(struct ufs_qcom_host *host)
@@ -1646,6 +1659,8 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, bool scale_up,
else
err = ufs_qcom_clk_scale_down_post_change(hba, target_freq);
+ if (!err)
+ err = ufs_qcom_ice_scale_clk(host, scale_up);
if (err) {
ufshcd_uic_hibern8_exit(hba);
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v3 3/3] soc: qcom: ice: Set ICE clk to TURBO on probe
2026-01-23 7:12 [PATCH v3 0/3] Enable ICE clock scaling Abhinaba Rakshit
2026-01-23 7:12 ` [PATCH v3 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE Abhinaba Rakshit
2026-01-23 7:12 ` [PATCH v3 2/3] ufs: host: Add ICE clock scaling during UFS clock changes Abhinaba Rakshit
@ 2026-01-23 7:12 ` Abhinaba Rakshit
2026-01-23 19:18 ` [PATCH v3 0/3] Enable ICE clock scaling Dmitry Baryshkov
3 siblings, 0 replies; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-23 7:12 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni
Cc: linux-arm-msm, linux-kernel, linux-scsi, Abhinaba Rakshit
MMC controller lacks a clock scaling mechanism, unlike the UFS
controller. By default, the MMC controller is set to TURBO mode
during probe, but the ICE clock remains at XO frequency,
leading to read/write performance degradation on eMMC.
To address this, set the ICE clock to TURBO during probe to
align it with the controller clock. This ensures consistent
performance and avoids mismatches between the controller
and ICE clock frequencies.
For platforms where ICE is represented as a separate device,
use the OPP framework to vote for TURBO mode, maintaining
proper voltage and power domain constraints.
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
---
drivers/soc/qcom/ice.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
index ca6a7df7a6827378af1f013c7e62a835d1b80cc5..84ee5813e2d586e8880849c877182d56ca31fd80 100644
--- a/drivers/soc/qcom/ice.c
+++ b/drivers/soc/qcom/ice.c
@@ -645,6 +645,11 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
engine->max_freq = rate;
dev_pm_opp_put(opp);
}
+
+ /* Vote for maximum clock rate for maximum performance */
+ err = dev_pm_opp_set_rate(dev, INT_MAX);
+ if (err)
+ dev_warn(dev, "Failed boosting the ICE clk to TURBO\n");
}
if (!qcom_ice_check_supported(engine))
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/3] Enable ICE clock scaling
2026-01-23 7:12 [PATCH v3 0/3] Enable ICE clock scaling Abhinaba Rakshit
` (2 preceding siblings ...)
2026-01-23 7:12 ` [PATCH v3 3/3] soc: qcom: ice: Set ICE clk to TURBO on probe Abhinaba Rakshit
@ 2026-01-23 19:18 ` Dmitry Baryshkov
2026-01-27 9:31 ` Abhinaba Rakshit
3 siblings, 1 reply; 10+ messages in thread
From: Dmitry Baryshkov @ 2026-01-23 19:18 UTC (permalink / raw)
To: Abhinaba Rakshit
Cc: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni,
linux-arm-msm, linux-kernel, linux-scsi
On Fri, Jan 23, 2026 at 12:42:11PM +0530, Abhinaba Rakshit wrote:
> Introduce support for dynamic clock scaling of the ICE (Inline Crypto Engine)
> using the OPP framework. During ICE device probe, the driver now attempts to
> parse an optional OPP table from the ICE-specific device tree node to
> determine minimum and maximum supported frequencies for DVFS-aware operations.
> API qcom_ice_scale_clk is exposed by ICE driver and is invoked by UFS host
> controller driver in response to clock scaling requests, ensuring coordination
> between ICE and host controller.
>
> For MMC controllers that do not support clock scaling, the ICE clock frequency
> is kept aligned with the MMC controller’s clock rate (TURBO) to ensure
> consistent operation.
>
> Dynamic clock scaling based on OPP tables enables better power-performance
> trade-offs. By adjusting ICE clock frequencies according to workload and power
> constraints, the system can achieve higher throughput when needed and
> reduce power consumption during idle or low-load conditions.
>
> The OPP table remains optional, absence of the table will not cause
> probe failure. However, in the absence of an OPP table, ICE clocks will
> remain at their default rates, which may limit performance under
> high-load scenarios or prevent performance optimizations during idle periods.
>
> Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
> ---
> Changes in v3:
> - Avoid clock scaling in case of legacy bindings as suggested.
> - Use of_device_is_compatible to distinguish between legacy and non-legacy bindings.
> - Link to v2: https://lore.kernel.org/r/20251121-enable-ufs-ice-clock-scaling-v2-0-66cb72998041@oss.qualcomm.com
>
> Changes in v2:
> - Use OPP-table instead of freq-table-hz for clock scaling.
> - Enable clock scaling for legacy targets as well, by fetching frequencies from storage opp-table.
> - Introduce has_opp variable in qcom_ice structure to keep track, if ICE instance has dedicated OPP-table registered.
> - Combined the changes for patch-series <20251001-set-ice-clock-to-turbo-v1-1-7b802cf61dda@oss.qualcomm.com> as suggested.
> - Link to v1: https://lore.kernel.org/r/20251001-enable-ufs-ice-clock-scaling-v1-0-ec956160b696@oss.qualcomm.com
>
> ---
> Abhinaba Rakshit (3):
DT binding changes should be a part of the same series.
> soc: qcom: ice: Add OPP-based clock scaling support for ICE
> ufs: host: Add ICE clock scaling during UFS clock changes
> soc: qcom: ice: Set ICE clk to TURBO on probe
>
> drivers/soc/qcom/ice.c | 68 +++++++++++++++++++++++++++++++++++++++++++++
> drivers/ufs/host/ufs-qcom.c | 15 ++++++++++
> include/soc/qcom/ice.h | 1 +
> 3 files changed, 84 insertions(+)
> ---
> base-commit: fe4d0dea039f2befb93f27569593ec209843b0f5
> change-id: 20251120-enable-ufs-ice-clock-scaling-b063caf3e6f9
>
> Best regards,
> --
> Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 0/3] Enable ICE clock scaling
2026-01-23 19:18 ` [PATCH v3 0/3] Enable ICE clock scaling Dmitry Baryshkov
@ 2026-01-27 9:31 ` Abhinaba Rakshit
0 siblings, 0 replies; 10+ messages in thread
From: Abhinaba Rakshit @ 2026-01-27 9:31 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Manivannan Sadhasivam,
James E.J. Bottomley, Martin K. Petersen, Neeraj Soni,
linux-arm-msm, linux-kernel, linux-scsi
On Fri, Jan 23, 2026 at 09:18:36PM +0200, Dmitry Baryshkov wrote:
> On Fri, Jan 23, 2026 at 12:42:11PM +0530, Abhinaba Rakshit wrote:
> > Introduce support for dynamic clock scaling of the ICE (Inline Crypto Engine)
> > using the OPP framework. During ICE device probe, the driver now attempts to
> > parse an optional OPP table from the ICE-specific device tree node to
> > determine minimum and maximum supported frequencies for DVFS-aware operations.
> > API qcom_ice_scale_clk is exposed by ICE driver and is invoked by UFS host
> > controller driver in response to clock scaling requests, ensuring coordination
> > between ICE and host controller.
> >
> > For MMC controllers that do not support clock scaling, the ICE clock frequency
> > is kept aligned with the MMC controller’s clock rate (TURBO) to ensure
> > consistent operation.
> >
> > Dynamic clock scaling based on OPP tables enables better power-performance
> > trade-offs. By adjusting ICE clock frequencies according to workload and power
> > constraints, the system can achieve higher throughput when needed and
> > reduce power consumption during idle or low-load conditions.
> >
> > The OPP table remains optional, absence of the table will not cause
> > probe failure. However, in the absence of an OPP table, ICE clocks will
> > remain at their default rates, which may limit performance under
> > high-load scenarios or prevent performance optimizations during idle periods.
> >
> > Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
> > ---
> > Changes in v3:
> > - Avoid clock scaling in case of legacy bindings as suggested.
> > - Use of_device_is_compatible to distinguish between legacy and non-legacy bindings.
> > - Link to v2: https://lore.kernel.org/r/20251121-enable-ufs-ice-clock-scaling-v2-0-66cb72998041@oss.qualcomm.com
> >
> > Changes in v2:
> > - Use OPP-table instead of freq-table-hz for clock scaling.
> > - Enable clock scaling for legacy targets as well, by fetching frequencies from storage opp-table.
> > - Introduce has_opp variable in qcom_ice structure to keep track, if ICE instance has dedicated OPP-table registered.
> > - Combined the changes for patch-series <20251001-set-ice-clock-to-turbo-v1-1-7b802cf61dda@oss.qualcomm.com> as suggested.
> > - Link to v1: https://lore.kernel.org/r/20251001-enable-ufs-ice-clock-scaling-v1-0-ec956160b696@oss.qualcomm.com
> >
> > ---
> > Abhinaba Rakshit (3):
>
> DT binding changes should be a part of the same series.
Sure, will bring the dt-bindings change to this patchseries.
^ permalink raw reply [flat|nested] 10+ messages in thread