From: sashiko-bot@kernel.org
To: "Pragnesh Papaniya" <pragnesh.papaniya@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 05/10] PM / devfreq: Add new track_remote flag for governors
Date: Fri, 24 Jul 2026 07:31:30 +0000 [thread overview]
Message-ID: <20260724073131.12F331F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-rfc_v8_scmi_memlat-v1-5-cb732bcff1f4@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Skipping `profile->target()` for `TRACK_REMOTE` bypasses OPP frequency rounding, causing state desynchronization and permanently failing `devfreq_update_status()` on QoS-clamped frequencies.
--
--- Patch [5]: [PATCH RFC 05/10] PM / devfreq: Add new track_remote flag for governors ---
commit 3b4a905187566fcb4b261840b1355a57916fec6b
Author: Sibi Sankar <sibi.sankar@oss.qualcomm.com>
PM / devfreq: Add new track_remote flag for governors
Some devfreq governors need to track frequency changes performed on remote
devices rather than driving the frequency updates themselves. Add a new
DEVFREQ_GOV_FLAG_TRACK_REMOTE governor flag to skip the local target() call
and just keep its transition statistics and notifiers in sync.
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 2f27a239e34a6..71c6ced9e4e1d 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -348,6 +348,26 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,
> unsigned long cur_freq;
> int err = 0;
>
> + /*
> + * When a remote agent (e.g. firmware) owns the frequency, skip the
> + * local profile->target() call. Still emit the PRECHANGE/POSTCHANGE
> + * pair and the trace event so that transition-notifier subscribers
> + * (passive governor, devfreq cooling, etc.) and tracing observe the
> + * frequency change exactly as they would on the normal path.
> + */
> + if (devfreq->governor &&
> + IS_SUPPORTED_FLAG(devfreq->governor->flags, TRACK_REMOTE)) {
> + freqs.old = devfreq->previous_freq;
> + freqs.new = new_freq;
> + devfreq_notify_transition(devfreq, &freqs, DEVFREQ_PRECHANGE);
> +
> + if (trace_devfreq_frequency_enabled() && new_freq != freqs.old)
> + trace_devfreq_frequency(devfreq, new_freq, freqs.old);
> +
> + devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE);
> + goto update_status;
[Severity: High]
Does skipping profile->target() here cause issues with unrounded frequencies?
When a frequency update occurs, devfreq_update_target() can clamp the
requested frequency to a PM QoS limit (e.g., min_freq) that might not be an
exact valid OPP frequency.
By skipping profile->target() (which normally rounds the frequency to a valid
OPP), this unrounded frequency is passed directly to devfreq_update_status()
via the goto.
Inside devfreq_update_status(), devfreq_get_freq_level() requires an exact
match in the freq_table. If the unrounded frequency is not found, it fails
and returns < 0, preventing stats updates and leaving previous_freq as an
invalid OPP.
> + }
> +
> if (devfreq->profile->get_cur_freq)
> devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq);
> else
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-rfc_v8_scmi_memlat-v1-0-cb732bcff1f4@oss.qualcomm.com?part=5
next prev parent reply other threads:[~2026-07-24 7:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 7:18 [PATCH RFC 00/10] firmware: arm_scmi: vendors: Qualcomm Generic Vendor Extensions Pragnesh Papaniya
2026-07-24 7:18 ` [PATCH RFC 01/10] firmware: arm_scmi: Add SCMI QCOM Generic Extension Protocol documentation Pragnesh Papaniya
2026-07-24 7:27 ` sashiko-bot
2026-07-24 9:13 ` Sudeep Holla
2026-07-24 7:18 ` [PATCH RFC 02/10] dt-bindings: firmware: arm,scmi: Add Qualcomm Generic Extension Protocol Pragnesh Papaniya
2026-07-24 7:28 ` sashiko-bot
2026-07-24 7:18 ` [PATCH RFC 03/10] firmware: arm_scmi: vendors: Add QCOM SCMI Generic Extensions Pragnesh Papaniya
2026-07-24 7:30 ` sashiko-bot
2026-07-24 7:18 ` [PATCH RFC 04/10] PM / devfreq: Add new target_freq attribute flag for governors Pragnesh Papaniya
2026-07-24 7:35 ` sashiko-bot
2026-07-24 7:18 ` [PATCH RFC 05/10] PM / devfreq: Add new track_remote " Pragnesh Papaniya
2026-07-24 7:31 ` sashiko-bot [this message]
2026-07-24 7:18 ` [PATCH RFC 06/10] PM / devfreq: Add a governor for tracking remote device frequencies Pragnesh Papaniya
2026-07-24 7:33 ` sashiko-bot
2026-07-24 7:18 ` [PATCH RFC 07/10] PM / devfreq: Introduce the QCOM SCMI Memlat devfreq driver Pragnesh Papaniya
2026-07-24 7:18 ` [PATCH RFC 08/10] arm64: dts: qcom: glymur: Enable LLCC/DDR/DDR_QOS DVFS Pragnesh Papaniya
2026-07-24 7:18 ` [PATCH RFC 09/10] arm64: dts: qcom: hamoa: " Pragnesh Papaniya
2026-07-24 7:18 ` [PATCH RFC 10/10] arm64: dts: qcom: kaanapali: " Pragnesh Papaniya
2026-07-24 8:40 ` [PATCH RFC 00/10] firmware: arm_scmi: vendors: Qualcomm Generic Vendor Extensions Sudeep Holla
2026-07-24 9:02 ` Pragnesh Papaniya
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=20260724073131.12F331F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=pragnesh.papaniya@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.