From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: j.neuschaefer@gmx.net, avifishman70@gmail.com,
benjaminfair@google.com, daniel.lezcano@linaro.org,
devicetree@vger.kernel.org, krzk+dt@kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux@roeck-us.net,
mturquette@baylibre.com, openbmc@lists.ozlabs.org,
p.zabel@pengutronix.de, robh+dt@kernel.org, sboyd@kernel.org,
tali.perry1@gmail.com, tglx@linutronix.de, tmaimon77@gmail.com,
venture@google.com, wim@linux-watchdog.org, yuenn@google.com
Subject: Re: [PATCH v6 2/2] clk: wpcm450: Add Nuvoton WPCM450 clock/reset controller driver
Date: Wed, 19 Apr 2023 23:52:57 +0200 [thread overview]
Message-ID: <ZEBiuRH3DjVUO/Kp@probook> (raw)
In-Reply-To: <c04038f2-b7aa-7c37-df93-6950831579f6@wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]
Hello Christophe,
On Sat, Apr 15, 2023 at 02:16:09PM +0200, Christophe JAILLET wrote:
> Le 15/04/2023 à 13:13, Jonathan Neuschäfer a écrit :
> > This driver implements the following features w.r.t. the clock and reset
> > controller in the WPCM450 SoC:
> >
> > - It calculates the rates for all clocks managed by the clock controller
> > - It leaves the clock tree mostly unchanged, except that it enables/
> > disables clock gates based on usage.
> > - It exposes the reset lines managed by the controller using the
> > Generic Reset Controller subsystem
> >
> > NOTE: If the driver and the corresponding devicetree node are present,
> > the driver will disable "unused" clocks. This is problem until
> > the clock relations are properly declared in the devicetree (in a
> > later patch). Until then, the clk_ignore_unused kernel parameter
> > can be used as a workaround.
> >
> > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer-hi6Y0CQ0nG0@public.gmane.org>
> > ---
[...]
> > + // Enables/gates
> > + for (i = 0; i < ARRAY_SIZE(clken_data); i++) {
> > + const struct wpcm450_clken_data *data = &clken_data[i];
> > +
> > + hw = clk_hw_register_gate_parent_data(NULL, data->name, &data->parent, data->flags,
> > + clk_base + REG_CLKEN, data->bitnum,
> > + data->flags, &wpcm450_clk_lock);
>
> If an error occures in the 'for' loop or after it, should this be
> clk_hw_unregister_gate()'ed somewhere?
Ideally yes —
in this case, if the clock driver fails, the system is arguably in such
a bad state that there isn't much point in bothering.
>
> CJ
>
> > + if (IS_ERR(hw)) {
> > + pr_err("Failed to register gate: %pe\n", hw);
> > + goto err_free;
> > + }
> > + clk_data->hws[data->bitnum] = hw;
> > + }
Best regards,
Jonathan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-04-19 21:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-15 11:13 [PATCH v6 0/2] Nuvoton WPCM450 clock and reset driver Jonathan Neuschäfer
2023-04-15 11:13 ` [PATCH v6 1/2] dt-bindings: clock: Add Nuvoton WPCM450 clock/reset controller Jonathan Neuschäfer
2023-04-15 11:13 ` [PATCH v6 2/2] clk: wpcm450: Add Nuvoton WPCM450 clock/reset controller driver Jonathan Neuschäfer
2023-04-15 12:16 ` Christophe JAILLET
2023-04-19 21:52 ` Jonathan Neuschäfer [this message]
2023-04-20 5:32 ` Christophe JAILLET
2023-04-22 15:56 ` Jonathan Neuschäfer
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=ZEBiuRH3DjVUO/Kp@probook \
--to=j.neuschaefer@gmx.net \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mturquette@baylibre.com \
--cc=openbmc@lists.ozlabs.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tglx@linutronix.de \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=wim@linux-watchdog.org \
--cc=yuenn@google.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