From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] PM / devfreq: add Airoha SoC Subsystem devfreq driver
Date: Fri, 09 Oct 2026 07:46:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-165032@kernel.org> (raw)
In-Reply-To: <20261009073330.18175-3-ansuelsmth@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] devfreq: target callback fails to update *freq to actual applied rate
--
commit ef9292d19d56ca62518a03cc0a714b29d6101475
Author: Christian Marangi <ansuelsmth@gmail.com>
PM / devfreq: add Airoha SoC Subsystem devfreq driver
Add simple Airoha SoC devfreq driver. This simple driver register a
driver from a given clock and register a passive governor to scale the
frequency with the CPU frequency.
> diff --git a/drivers/devfreq/airoha-subsystem-devfreq.c b/drivers/devfreq/airoha-subsystem-devfreq.c
> new file mode 100644
> index 0000000000000..4b89121f7b8ec
> --- /dev/null
> +++ b/drivers/devfreq/airoha-subsystem-devfreq.c
[ ... ]
> +static int airoha_devfreq_target(struct device *dev, unsigned long *freq,
> + u32 flags)
> +{
> + struct airoha_devfreq_data *data = dev_get_drvdata(dev);
> +
> + return clk_set_rate(data->clk, *freq);
> +}
[Severity: Medium]
Does this target callback need to update the freq pointer to the actual
frequency applied?
When the devfreq core or governor requests a frequency transition, it calls
the .target callback with the requested frequency in the freq parameter. This
happens on every frequency transition triggered by the governor.
The devfreq core's internal state (devfreq->previous_freq) and statistics
track the frequency returned in the freq pointer. If the unrounded or
interpolated requested frequency is blindly passed to clk_set_rate() and
left unchanged instead of being updated to the actual frequency applied to
the hardware, this can cause -EINVAL lookup errors in devfreq_get_freq_level()
and break statistics.
Could devfreq_recommended_opp() be used here to constrain the requested
frequency to a valid OPP and update freq before applying it?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261009073330.18175-1-ansuelsmth@gmail.com?part=2
prev parent reply other threads:[~2026-10-09 7:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 7:33 [PATCH v2 0/2] PM / devfreq: add Airoha SoC Subsystem scale support Christian Marangi
2026-10-09 7:33 ` [PATCH v2 1/2] dt-bindings: devfreq: Document support for Airoha Subsystem Scale Christian Marangi
2026-10-09 7:39 ` sashiko-bot
2026-10-09 15:06 ` Conor Dooley
2026-10-09 15:15 ` Christian Marangi (Ansuel)
2026-10-09 7:33 ` [PATCH v2 2/2] PM / devfreq: add Airoha SoC Subsystem devfreq driver Christian Marangi
2026-10-09 7:46 ` sashiko-bot [this message]
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=sashiko-outbox-165032@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox