Netdev List
 help / color / mirror / Atom feed
From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Gustavo Kenji Mendonça Kaneko" <kaneko.dev@pm.me>,
	netdev@vger.kernel.org
Cc: <conor.dooley@microchip.com>, <davem@davemloft.net>,
	<kuba@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: macb: fix ignored return value of clk_prepare_enable() in runtime resume
Date: Sun, 31 May 2026 08:41:13 +0200	[thread overview]
Message-ID: <DIWNNTPN8ZRN.2HYJUO6WIETTD@bootlin.com> (raw)
In-Reply-To: <20260531051841.55311-1-kaneko.dev@pm.me>

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@pm.me>

Thanks!

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


      reply	other threads:[~2026-05-31  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31  5:18 [PATCH] net: macb: fix ignored return value of clk_prepare_enable() in runtime resume Gustavo Kenji Mendonça Kaneko
2026-05-31  6:41 ` Théo Lebrun [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=DIWNNTPN8ZRN.2HYJUO6WIETTD@bootlin.com \
    --to=theo.lebrun@bootlin.com \
    --cc=conor.dooley@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kaneko.dev@pm.me \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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