U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jonas Karlman <jonas@kwiboo.se>
Cc: Lukasz Majewski <lukma@denx.de>,
	 Sean Anderson <seanga2@gmail.com>, Tom Rini <trini@konsulko.com>,
	 Kever Yang <kever.yang@rock-chips.com>,
	Dang Huynh <danct12@riseup.net>,
	 u-boot@lists.denx.de
Subject: Re: [PATCH] clk: Fix clk_set_parent() regression
Date: Tue, 22 Apr 2025 09:47:12 +0200	[thread overview]
Message-ID: <87o6woljsv.fsf@bootlin.com> (raw)
In-Reply-To: <20250419090718.2469756-1-jonas@kwiboo.se> (Jonas Karlman's message of "Sat, 19 Apr 2025 09:07:16 +0000")

On 19/04/2025 at 09:07:16 GMT, Jonas Karlman <jonas@kwiboo.se> wrote:

> The commit ac30d90f3367 ("clk: Ensure the parent clocks are enabled
> while reparenting") add a call to clk_enable() for the parent clock.
>
> For clock drivers that do not implement the enable() ops, like most
> Rockchip clock drivers, this now cause the set_parent() ops to never
> be called when CLK_CCF=n (default for Rockchip).
>
> clk_enable() typically return -NOSYS when the enable() ops is not
> implemented by the clock driver, with CLK_CCF=y clk_enable() instead
> return 0 when the enable() ops is unimplemented.

I am really not a big fan of this logic to return low-level information
in high-level helpers. I am constantly disagreeing with this approach
because this is exactly the kind of breakage it leads to.

> Change to ignore -NOSYS from the newly introduced clk_enable() call to
> fix this regression and restore the old behavior of set_parent() ops
> being called regardless of if enable() ops is implemented or not.
>
> Fixes: ac30d90f3367 ("clk: Ensure the parent clocks are enabled while reparenting")
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Thanks for the fix,

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Miquèl

      parent reply	other threads:[~2025-04-22 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19  9:07 [PATCH] clk: Fix clk_set_parent() regression Jonas Karlman
2025-04-19  9:13 ` Dang Huynh
2025-04-22  7:47 ` Miquel Raynal [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=87o6woljsv.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=danct12@riseup.net \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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