Re: [PATCH v5 2/4] soc: qcom: ice: Add OPP-based clock scaling support for ICE
From: Abhinaba Rakshit
Date: Fri Feb 13 2026 - 02:34:02 EST
On Thu, Feb 12, 2026 at 12:30:00PM +0100, Konrad Dybcio wrote:
> On 2/11/26 10:47 AM, 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 based on the target frequency provided and if a valid
> > OPP-table is registered. Use flags (if provided) to decide on
> > the rounding of the clock freq against OPP-table. Incase no flags
> > are provided use default behaviour (CEIL incase of scale_up and FLOOR
> > incase of ~scale_up). 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.
> >
> > Also, ensure to drop the votes in suspend to prevent power/thermal
> > retention. Subsequently restore the frequency in resume from
> > core_clk_freq which stores the last ICE core clock operating frequency.
> >
> > Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@xxxxxxxxxxxxxxxx>
> > ---
>
> [...]
>
> > + switch (flags) {
>
> Are you going to use these flags? Currently they're dead code
[...]
> > + break;
> > + case ICE_CLOCK_ROUND_FLOOR:
> > + opp = dev_pm_opp_find_freq_floor_indexed(ice->dev, &ice_freq, 0);
> > + break;
> > + default:
> > + if (scale_up)
> > + opp = dev_pm_opp_find_freq_ceil_indexed(ice->dev, &ice_freq, 0);
> > + else
> > + opp = dev_pm_opp_find_freq_floor_indexed(ice->dev, &ice_freq, 0);
>
> Is this distinction necessary?
Just giving it a second thought.
Well right, these are not necessary, infact we can completly remove the scele_up
from the export API and make use of the rounding flags eventually.
The ufs driver can pass the right flag, based on the check against scale_up variable.
Ack, will update this in next patchset.
Abhinaba Rakshit