.../bindings/crypto/qcom,inline-crypto-engine.yaml | 29 ++++++ drivers/soc/qcom/ice.c | 112 +++++++++++++++++++++ drivers/ufs/host/ufs-qcom.c | 17 ++++ include/soc/qcom/ice.h | 5 + 4 files changed, 163 insertions(+)
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 v4:
- Enable multiple frequency scaling based OPP-entries as suggested in v3 patchset.
- Include bindings change: https://lore.kernel.org/all/20260123-add-operating-points-v2-property-for-qcom-ice-bindings-v1-1-2155f7aacc28@oss.qualcomm.com/.
- Link to v3: https://lore.kernel.org/r/20260123-enable-ufs-ice-clock-scaling-v3-0-d0d8532abd98@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 (4):
dt-bindings: crypto: ice: add operating-points-v2 property for QCOM ICE
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
.../bindings/crypto/qcom,inline-crypto-engine.yaml | 29 ++++++
drivers/soc/qcom/ice.c | 112 +++++++++++++++++++++
drivers/ufs/host/ufs-qcom.c | 17 ++++
include/soc/qcom/ice.h | 5 +
4 files changed, 163 insertions(+)
---
base-commit: fe4d0dea039f2befb93f27569593ec209843b0f5
change-id: 20251120-enable-ufs-ice-clock-scaling-b063caf3e6f9
Best regards,
--
Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
On 1/28/26 9:46 AM, 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. You skipped that bit, so I had to do a little digging.. This paragraph sounds scary on the surface, as leaving a TURBO vote hanging would absolutely wreck the power/thermal profile of a running device, however sdhci-msm's autosuspend functions quiesce the ICE by calling qcom_ice_suspend() I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function and a mirrored restore in _resume Konrad
On Thu, Jan 29, 2026 at 01:17:51PM +0100, Konrad Dybcio wrote: > On 1/28/26 9:46 AM, 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. > > You skipped that bit, so I had to do a little digging.. > > This paragraph sounds scary on the surface, as leaving a TURBO vote hanging > would absolutely wreck the power/thermal profile of a running device, > however sdhci-msm's autosuspend functions quiesce the ICE by calling > qcom_ice_suspend() > > I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function > and a mirrored restore in _resume Thanks for pointing this out, its an important piece which is missed. We can use dev_pm_opp_set_rate(dev, 0/min_freq) in _suspend and restore the suspended frequency in the _resume. Something similar which is used by sdhci-msm.
On 2/2/26 7:36 AM, Abhinaba Rakshit wrote: > On Thu, Jan 29, 2026 at 01:17:51PM +0100, Konrad Dybcio wrote: >> On 1/28/26 9:46 AM, 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. >> >> You skipped that bit, so I had to do a little digging.. >> >> This paragraph sounds scary on the surface, as leaving a TURBO vote hanging >> would absolutely wreck the power/thermal profile of a running device, >> however sdhci-msm's autosuspend functions quiesce the ICE by calling >> qcom_ice_suspend() >> >> I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function >> and a mirrored restore in _resume > > Thanks for pointing this out, its an important piece which is missed. > We can use dev_pm_opp_set_rate(dev, 0/min_freq) in _suspend and restore the FWIW dev_pm_opp_set_rate(0) will drop the rpmh vote altogether and NOT disable the clock or change its rate dev_pm_opp_set_rate(min_freq) will *lower* the rpmh vote and DO set_rate (the clock is also left on) Konrad > suspended frequency in the _resume. Something similar which is used by sdhci-msm.
On Mon, Feb 02, 2026 at 04:01:38PM +0100, Konrad Dybcio wrote: > On 2/2/26 7:36 AM, Abhinaba Rakshit wrote: > > On Thu, Jan 29, 2026 at 01:17:51PM +0100, Konrad Dybcio wrote: > >> On 1/28/26 9:46 AM, 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. > >> > >> You skipped that bit, so I had to do a little digging.. > >> > >> This paragraph sounds scary on the surface, as leaving a TURBO vote hanging > >> would absolutely wreck the power/thermal profile of a running device, > >> however sdhci-msm's autosuspend functions quiesce the ICE by calling > >> qcom_ice_suspend() > >> > >> I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function > >> and a mirrored restore in _resume > > > > Thanks for pointing this out, its an important piece which is missed. > > We can use dev_pm_opp_set_rate(dev, 0/min_freq) in _suspend and restore the > > FWIW > > dev_pm_opp_set_rate(0) will drop the rpmh vote altogether and NOT > disable the clock or change its rate > > dev_pm_opp_set_rate(min_freq) will *lower* the rpmh vote and DO > set_rate (the clock is also left on) > > Konrad > Thanks for the info. I guess, dev_pm_opp_set_rate(dev, 0) seems more ideal as this is API is for full quiesce mode and the clocks are anyway gated in the suspend call (clk_disable_unprepare). Abhinaba Rakshit
On 2/6/26 1:03 PM, Abhinaba Rakshit wrote: > On Mon, Feb 02, 2026 at 04:01:38PM +0100, Konrad Dybcio wrote: >> On 2/2/26 7:36 AM, Abhinaba Rakshit wrote: >>> On Thu, Jan 29, 2026 at 01:17:51PM +0100, Konrad Dybcio wrote: >>>> On 1/28/26 9:46 AM, 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. >>>> >>>> You skipped that bit, so I had to do a little digging.. >>>> >>>> This paragraph sounds scary on the surface, as leaving a TURBO vote hanging >>>> would absolutely wreck the power/thermal profile of a running device, >>>> however sdhci-msm's autosuspend functions quiesce the ICE by calling >>>> qcom_ice_suspend() >>>> >>>> I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function >>>> and a mirrored restore in _resume >>> >>> Thanks for pointing this out, its an important piece which is missed. >>> We can use dev_pm_opp_set_rate(dev, 0/min_freq) in _suspend and restore the >> >> FWIW >> >> dev_pm_opp_set_rate(0) will drop the rpmh vote altogether and NOT >> disable the clock or change its rate >> >> dev_pm_opp_set_rate(min_freq) will *lower* the rpmh vote and DO >> set_rate (the clock is also left on) >> >> Konrad >> > > Thanks for the info. > I guess, dev_pm_opp_set_rate(dev, 0) seems more ideal as this is > API is for full quiesce mode and the clocks are anyway gated in > the suspend call (clk_disable_unprepare). Yeah, please make sure to call dev_pm_opp_set_rate(0) *after* you disable the clock though, to make sure we don't brownout Konrad
On Fri, Feb 06, 2026 at 01:14:28PM +0100, Konrad Dybcio wrote: > On 2/6/26 1:03 PM, Abhinaba Rakshit wrote: > > On Mon, Feb 02, 2026 at 04:01:38PM +0100, Konrad Dybcio wrote: > >> On 2/2/26 7:36 AM, Abhinaba Rakshit wrote: > >>> On Thu, Jan 29, 2026 at 01:17:51PM +0100, Konrad Dybcio wrote: > >>>> On 1/28/26 9:46 AM, 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. > >>>> > >>>> You skipped that bit, so I had to do a little digging.. > >>>> > >>>> This paragraph sounds scary on the surface, as leaving a TURBO vote hanging > >>>> would absolutely wreck the power/thermal profile of a running device, > >>>> however sdhci-msm's autosuspend functions quiesce the ICE by calling > >>>> qcom_ice_suspend() > >>>> > >>>> I think you're missing a dev_pm_opp_set(dev, NULL) or so in that function > >>>> and a mirrored restore in _resume > >>> > >>> Thanks for pointing this out, its an important piece which is missed. > >>> We can use dev_pm_opp_set_rate(dev, 0/min_freq) in _suspend and restore the > >> > >> FWIW > >> > >> dev_pm_opp_set_rate(0) will drop the rpmh vote altogether and NOT > >> disable the clock or change its rate > >> > >> dev_pm_opp_set_rate(min_freq) will *lower* the rpmh vote and DO > >> set_rate (the clock is also left on) > >> > >> Konrad > >> > > > > Thanks for the info. > > I guess, dev_pm_opp_set_rate(dev, 0) seems more ideal as this is > > API is for full quiesce mode and the clocks are anyway gated in > > the suspend call (clk_disable_unprepare). > > Yeah, please make sure to call dev_pm_opp_set_rate(0) *after* you > disable the clock though, to make sure we don't brownout Sure, that makes sense. Abhinaba Rakshit
© 2016 - 2026 Red Hat, Inc.