From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Grégory Clement" <gregory.clement@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>
Subject: Re: [PATCH v4 4/4] clk: eyeq: add driver
Date: Fri, 04 Oct 2024 18:55:15 +0200 [thread overview]
Message-ID: <D4N6GX6P0ZCH.2PJGDMKEZ6LLQ@bootlin.com> (raw)
In-Reply-To: <75884d07-f052-435d-9f1a-44e9e0bb755f@wanadoo.fr>
Hello Christophe,
On Fri Oct 4, 2024 at 6:34 PM CEST, Christophe JAILLET wrote:
> Le 04/10/2024 à 17:45, Théo Lebrun a écrit :
> > +static void eqc_probe_init_plls(struct device *dev, struct eqc_priv *priv)
> > +{
> > + const struct eqc_match_data *data = priv->data;
> > + unsigned long mult, div, acc;
> > + const struct eqc_pll *pll;
> > + struct clk_hw *hw;
> > + unsigned int i;
> > + u32 r0, r1;
> > + u64 val;
> > + int ret;
> > +
> > + for (i = 0; i < data->pll_count; i++) {
> > + pll = &data->plls[i];
> > +
> > + val = readq(priv->base + pll->reg64);
> > + r0 = val;
> > + r1 = val >> 32;
> > +
> > + ret = eqc_pll_parse_registers(r0, r1, &mult, &div, &acc);
> > + if (ret) {
> > + dev_warn(dev, "failed parsing state of %s\n", pll->name);
> > + priv->cells->hws[pll->index] = ERR_PTR(ret);
> > + continue;
> > + }
> > +
> > + hw = clk_hw_register_fixed_factor_with_accuracy_fwname(dev,
> > + dev->of_node, pll->name, "ref", 0, mult, div, acc);
>
> Should this be freed somewhere or is it auto-magically freed by a
> put_something()?
> Maybe devm_action_or_reset()?
This driver does not support being removed. It provides essential PLLs
and the system has not chance of working without them.
Almost all instances will be instantiated at of_clk_init() stage by the
way (ie before platform bus infrastructure init). Devres isn't a
solution in those cases.
We are missing suppress_bind_attrs though.
I can add that at next revision.
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2024-10-04 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 15:45 [PATCH v4 0/4] Add Mobileye EyeQ clock support Théo Lebrun
2024-10-04 15:45 ` [PATCH v4 1/4] Revert "dt-bindings: clock: mobileye,eyeq5-clk: add bindings" Théo Lebrun
2024-10-04 15:45 ` [PATCH v4 2/4] dt-bindings: clock: add Mobileye EyeQ6L/EyeQ6H clock indexes Théo Lebrun
2024-10-04 15:45 ` [PATCH v4 3/4] clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag Théo Lebrun
2024-10-04 15:45 ` [PATCH v4 4/4] clk: eyeq: add driver Théo Lebrun
2024-10-04 16:34 ` Christophe JAILLET
2024-10-04 16:55 ` Théo Lebrun [this message]
2024-10-04 21:20 ` Christophe JAILLET
2024-10-07 13:56 ` Théo Lebrun
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=D4N6GX6P0ZCH.2PJGDMKEZ6LLQ@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.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;
as well as URLs for NNTP newsgroup(s).