From: sashiko-bot@kernel.org
To: "Sean Young" <sean@mess.org>
Cc: linux-amlogic@lists.infradead.org, media-ci@linuxtv.org,
neil.armstrong@linaro.org
Subject: Re: [PATCH v5 07/15] media: meson-ir-tx: Ensure clock is disabled on unbind
Date: Wed, 29 Jul 2026 15:36:03 +0000 [thread overview]
Message-ID: <20260729153603.F34521F000E9@smtp.kernel.org> (raw)
In-Reply-To: <0a0066a531aedbcb18620cac5897cb91c78a5188.1785338381.git.sean@mess.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] The clock is automatically disabled on unbind via devres, but the hardware is not gracefully shut down first, violating the hardware state machine.
Pre-existing issues:
- [High] The driver overwrites genuine error codes (including -EPROBE_DEFER) with a hardcoded -ENODEV, breaking deferred probing.
--
--- Patch [7]: [PATCH v5 07/15] media: meson-ir-tx: Ensure clock is disabled on unbind ---
commit ed37040061f2257376fd955ba2cd00d04a46719c
Author: Sean Young <sean@mess.org>
media: meson-ir-tx: Ensure clock is disabled on unbind
This commit updates the meson-ir-tx driver to use devm_clk_get_enabled() so
that the clock is automatically disabled during driver unbind.
> diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c
> index fded2c256f2a6..e7bb107e6a843 100644
> --- a/drivers/media/rc/meson-ir-tx.c
> +++ b/drivers/media/rc/meson-ir-tx.c
> @@ -288,8 +288,8 @@ static int meson_irtx_mod_clock_probe(struct meson_irtx *ir,
> if (!np)
> return -ENODEV;
>
> - clock = devm_clk_get(ir->dev, "xtal");
> - if (IS_ERR(clock) || clk_prepare_enable(clock))
> + clock = devm_clk_get_enabled(ir->dev, "xtal");
> + if (IS_ERR(clock))
> return -ENODEV;
[Severity: High]
This is a pre-existing issue, but does returning -ENODEV here in
meson_irtx_mod_clock_probe() overwrite the actual error code returned by
devm_clk_get_enabled(), such as -EPROBE_DEFER?
If the clock provider is not yet ready, returning -ENODEV instead of
propagating the error code could permanently fail to probe instead of
deferring. A similar override happens in meson_irtx_probe() with
platform_get_irq().
[Severity: Medium]
With devm_clk_get_enabled(), the clock is automatically disabled on unbind via
devres.
Is it safe to disable the clock without first shutting down the hardware block?
The driver configures the hardware in meson_irtx_probe(), but since there is
no .remove callback in meson_irtx_pd (or a corresponding devm action) to
gracefully shut down the hardware, it is left running. Disabling the clock
while the hardware is still active might freeze the hardware block or cause
bus lockups when the driver is unbound.
>
> *clk_nr = IRB_MOD_XTAL3_CLK;
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1785338381.git.sean@mess.org?part=7
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-07-29 15:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 15:22 [PATCH v5 00/15] Fix leaks in rc core Sean Young
2026-07-29 15:22 ` [PATCH v5 01/15] media: streamzap: Add missing rc_unregister_device() Sean Young
2026-07-29 15:22 ` [PATCH v5 02/15] media: redrat3: Ensure rc device is freed if enable_detector() fails Sean Young
2026-07-29 15:22 ` [PATCH v5 03/15] media: redrat3: Ensure we don't read beyond the end of the packet Sean Young
2026-07-29 15:22 ` [PATCH v5 04/15] media: redrat3: Ensure all urbs are suspended Sean Young
2026-07-29 15:22 ` [PATCH v5 05/15] media: redrat3: Error path leaves device in transmitting state Sean Young
2026-07-29 15:35 ` Markus Elfring
2026-07-29 15:22 ` [PATCH v5 06/15] media: sunxi-cir: Ensure no more interrupts can occur before free Sean Young
2026-07-29 15:31 ` sashiko-bot
2026-07-29 15:22 ` [PATCH v5 07/15] media: meson-ir-tx: Ensure clock is disabled on unbind Sean Young
2026-07-29 15:22 ` Sean Young
2026-07-29 15:36 ` sashiko-bot [this message]
2026-07-29 15:22 ` [PATCH v5 08/15] media: meson-ir-tx: Ensure rc_free_device() is called " Sean Young
2026-07-29 15:22 ` Sean Young
2026-07-29 15:22 ` [PATCH v5 09/15] media: meson-ir-tx: Ensure probe error is propagated Sean Young
2026-07-29 15:22 ` Sean Young
2026-07-29 15:22 ` [PATCH v5 10/15] media: ir-hix5hd2: Ensure rdev is setup before interrupts are enabled Sean Young
2026-07-29 15:22 ` [PATCH v5 11/15] media: cx88: Specify rc type at rc_allocate_type() Sean Young
2026-07-29 15:22 ` [PATCH v5 12/15] media: saa7134: " Sean Young
2026-07-29 15:22 ` [PATCH v5 13/15] media: rc: Fix race condition during rc_register_device() Sean Young
2026-07-29 15:22 ` [PATCH v5 14/15] media: rc: Use after free in ir_raw_event_handle() Sean Young
2026-07-29 15:22 ` [PATCH v5 15/15] media: rc: Fix use after free in bpf progs Sean Young
2026-07-29 15:52 ` sashiko-bot
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=20260729153603.F34521F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=media-ci@linuxtv.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sean@mess.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.