From: Ralph Siemsen <ralph.siemsen@linaro.org>
To: Marek Vasut <marek.vasut@mailbox.org>
Cc: u-boot@lists.u-boot-project.org, Tom Rini <trini@konsulko.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>
Subject: Re: [PATCH v2] gpio: dwapb_gpio: Enable all clocks
Date: Sat, 15 Aug 2026 10:05:36 -0400 [thread overview]
Message-ID: <aoByMCnVSX_GyuU5@maple.netwinder.org> (raw)
In-Reply-To: <9eb93d89-41f9-4c9b-a876-22e6f496443a@mailbox.org>
On Sat, Aug 15, 2026 at 12:05:55AM +0200, Marek Vasut wrote:
>On 8/14/26 8:29 PM, Ralph Siemsen wrote:
>
>[...]
>
>>@@ -132,12 +134,34 @@ static int gpio_dwapb_reset(struct udevice *dev)
>> return 0;
>> }
>>+static int gpio_dwapb_enable_optional_clocks(struct udevice *dev)
>>+{
>>+ struct gpio_dwapb_priv *priv = dev_get_priv(dev);
>>+ int ret;
>>+
>>+ ret = clk_get_bulk(dev, &priv->clks);
>>+ if (ret) {
>>+ /* Clocks are optional */
>>+ if (ret != -ENOENT)
>>+ dev_err(dev, "Failed to get clocks: %d\n", ret);
>>+ return ret;
>>+ }
>>+
>>+ ret = clk_enable_bulk(&priv->clks);
>>+ if (ret)
>>+ dev_err(dev, "Failed to enable clocks: %d\n", ret);
>>+
>>+ return ret;
>>+}
>>+
>> static int gpio_dwapb_probe(struct udevice *dev)
>> {
>> struct gpio_dev_priv *priv = dev_get_uclass_priv(dev);
>> struct gpio_dwapb_plat *plat = dev_get_plat(dev);
>> if (!plat) {
>>+ gpio_dwapb_enable_optional_clocks(dev);
>Error is not propagated from this call.
This was intentional. All existing users work without explicitly
enabling the clock. They probably do it in board specific code, or in a
previous boot stage.
While adding clk_enable() should be harmless, what if it fails on some
of the existing boards? I would rather not break them, this can be quite
hard to debug.
>Fail path that would disable the clock is missing in this function.
Okay, I can add this.
Ralph
next prev parent reply other threads:[~2026-08-15 14:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 18:29 [PATCH v2] gpio: dwapb_gpio: Enable all clocks Ralph Siemsen
2026-08-14 22:05 ` Marek Vasut via U-Boot
2026-08-15 14:05 ` Ralph Siemsen [this message]
2026-08-16 11:32 ` Marek Vasut via U-Boot
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=aoByMCnVSX_GyuU5@maple.netwinder.org \
--to=ralph.siemsen@linaro.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=marek.vasut@mailbox.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/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