Re: [PATCH] net: macb: fix ignored return value of clk_prepare_enable() in runtime resume

From: Théo Lebrun

Date: Sun May 31 2026 - 02:42:50 EST


Hello Gustavo,

Your CC list is laking some net maintainers, how did you get who to send
this email to?

./scripts/get_maintainer.pl -f drivers/net/ethernet/cadence/macb_main.c

On Sun May 31, 2026 at 7:18 AM CEST, Gustavo Kenji Mendonça Kaneko wrote:
> macb_runtime_resume() calls clk_prepare_enable() five times without
> checking the return value. If any clock fails to enable, the driver
> silently continues with potentially unclocked hardware, which can
> cause undefined behavior or system instability on resume from runtime
> suspend.

Could you point out if this was figured out to address a bug or if it is
only a theoretical defense?

> The existing macb_clks_disable() already uses clk_bulk_disable_unprepare()
> for the symmetric disable path. Align the enable path by using
> clk_bulk_prepare_enable(), which atomically enables all clocks and
> automatically rolls back any successfully enabled clocks on failure.

"atomically" usually refers to some locking mechanism, is that the
signification you had in mind here? Because I see none.

> Signed-off-by: Gustavo Kenji Mendonça Kaneko <kaneko.dev@xxxxx>

Thanks!

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com