From: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Neeraj Soni <neeraj.soni@oss.qualcomm.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE
Date: Mon, 8 Dec 2025 12:11:19 +0530 [thread overview]
Message-ID: <aTZzD6ujz0+mZD7j@hu-arakshit-hyd.qualcomm.com> (raw)
In-Reply-To: <c04cd051-b6d0-4d98-ac2d-4fc7ffcb4301@oss.qualcomm.com>
On Fri, Nov 21, 2025 at 02:46:52PM +0100, Konrad Dybcio wrote:
> On 11/21/25 11:36 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 if valid (non-zero) frequencies are obtained from
> > OPP-table. Zero min and max (default values) frequencies depicts
> > clock scaling is disabled.
> >
> > When an ICE-device specific OPP table is available, use the PM OPP
> > framework to manage frequency scaling and maintain proper power-domain
> > constraints. For legacy targets without an ICE-device specific OPP table,
> > fall back to the standard clock framework APIs to set the frequency.
>
> You can still set a frequency through OPP APIs if the table is empty
> (and one is always created even if devm_pm_opp_of_add_table() fails)
>
We observed that when devm_pm_opp_of_add_table() returns -ENODEV (indicating
that no OPP table is defined in the devicetree), subsequent calls to APIs
like dev_pm_opp_set_rate() fail because the device does not have an OPP table
registered. As a result, the clock rate cannot be set using OPP-based helpers.
Here is an dmesg ice driver logs for lemans device without opp-table defined in its devicetree.
sh-5.2# dmesg | grep qcom-ice
[ 7.316366] qcom-ice 87c8000.crypto: dev_pm_opp_set_rate: device's opp table doesn't exist
[ 7.325596] qcom-ice 87c8000.crypto: Failed boosting the ICE clk to TURBO
[ 7.333288] qcom-ice 87c8000.crypto: _find_key: OPP table not found (-19)
[ 7.340968] qcom-ice 87c8000.crypto: Unable to find ICE core clock min freq
[ 7.348832] qcom-ice 87c8000.crypto: _find_key: OPP table not found (-19)
[ 7.356510] qcom-ice 87c8000.crypto: Unable to find ICE core clock max freq
[ 7.364377] qcom-ice 87c8000.crypto: Found QC Inline Crypto Engine (ICE) v3.2.0
[ 7.372594] qcom-ice 87c8000.crypto: QC ICE HWKM (Hardware Key Manager) version = 1
Additionally, on legacy targets where ICE does not exist as a separate device,
the OPP table is managed through the storage subsystem. In such cases, using
OPP APIs directly for ICE would not be appropriate because the OPP table may
also control other clocks, leading to unintended side effects.
> [...]
>
> > /*
> > * Legacy DT binding uses different clk names for each consumer,
> > - * so lets try those first. If none of those are a match, it means
> > - * the we only have one clock and it is part of the dedicated DT node.
> > - * Also, enable the clock before we check what HW version the driver
> > - * supports.
> > + * so lets try those first. Also get its corresponding clock index.
> > + */
>
> I would argue *not* setting the rate on targets utilizing a binding without
> an OPP table for the ICE is probably a smart thing to do, because we may
> brownout the SoC this way
Understand the concern here.
However, our approach is to scale the ICE clock only when the storage subsystem scales
its own clocks. Since the storage driver already manages the associated power domain
and voltage adjustments (even for targets without opp-table for ICE) —which are shared
with ICE—this ensures that any frequency changes occur in a safe context. As a result,
the risk of a SoC brownout condition should be effectively mitigated.
>
> Konrad
next prev parent reply other threads:[~2025-12-08 6:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 10:36 [PATCH v2 0/3] Enable ICE clock scaling Abhinaba Rakshit
2025-11-21 10:36 ` [PATCH v2 1/3] soc: qcom: ice: Add OPP-based clock scaling support for ICE Abhinaba Rakshit
2025-11-21 13:46 ` Konrad Dybcio
2025-12-08 6:41 ` Abhinaba Rakshit [this message]
2025-12-17 13:47 ` Konrad Dybcio
2025-12-11 5:49 ` Abhinaba Rakshit
2025-11-21 10:36 ` [PATCH v2 2/3] ufs: host: Add ICE clock scaling during UFS clock changes Abhinaba Rakshit
2025-11-21 10:36 ` [PATCH v2 3/3] soc: qcom: ice: Set ICE clk to TURBO on probe Abhinaba Rakshit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aTZzD6ujz0+mZD7j@hu-arakshit-hyd.qualcomm.com \
--to=abhinaba.rakshit@oss.qualcomm.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=neeraj.soni@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox