From: sashiko-bot@kernel.org
To: "Ze Huang" <ze.huang@oss.qualcomm.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/imx/lcdc: avoid duplicate clk_per enable
Date: Sun, 26 Jul 2026 19:59:19 +0000 [thread overview]
Message-ID: <20260726195919.D70021F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727-drm-simple-kms-removal-v3-1-de36e534f7a1@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Calls to sleeping functions (`clk_prepare_enable` and `clk_disable_unprepare`) from the plane atomic update and CRTC enable/disable callbacks, violating DRM atomic context requirements.
--
--- Patch [1]: [PATCH v3 1/2] drm/imx/lcdc: avoid duplicate clk_per enable ---
commit 48c4f154b28e9de1d485ea56766c8a24df823739
Author: Ze Huang <ze.huang@oss.qualcomm.com>
drm/imx/lcdc: avoid duplicate clk_per enable
The simple-KMS helper calls the pipe update after enabling the CRTC,
which causes imx_lcdc_update_hw_registers() to be called again. This
patch avoids the duplicate clock enable by skipping the register update
when the CRTC already needs a modeset.
> diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> index c67fe80b8115e..e00e52c1c46ec 100644
> --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> @@ -310,7 +310,8 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
> else if (old_crtc != crtc)
> mode_changed = true;
>
> - imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
> + if (!drm_atomic_crtc_needs_modeset(crtc->state))
> + imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
[Severity: High]
This is a pre-existing issue, but does calling imx_lcdc_update_hw_registers()
from imx_lcdc_pipe_update() risk sleeping in an atomic context?
imx_lcdc_pipe_update() acts as a plane atomic update callback, which executes
in an atomic context where sleeping is forbidden. However, it calls
imx_lcdc_update_hw_registers(), which in turn calls sleeping functions:
imx_lcdc_update_hw_registers() {
...
clk_disable_unprepare(lcdc->clk_per);
...
clk_prepare_enable(lcdc->clk_per);
...
}
Will this cause 'scheduling while atomic' panics when a plane format changes
without a full modeset?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-07-26 19:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 19:42 [PATCH v3 0/2] drm: replace simple display pipe users with atomic helpers Ze Huang
2026-07-26 19:42 ` [PATCH v3 1/2] drm/imx/lcdc: avoid duplicate clk_per enable Ze Huang
2026-07-26 19:59 ` sashiko-bot [this message]
2026-07-27 1:38 ` Ze Huang
2026-07-26 19:42 ` [PATCH v3 2/2] drm/imx: replace struct drm_simple_display_pipe with regular atomic helpers Ze Huang
2026-07-26 19:55 ` sashiko-bot
2026-07-27 1:53 ` Ze Huang
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=20260726195919.D70021F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=ze.huang@oss.qualcomm.com \
/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