From: sashiko-bot@kernel.org
To: "Minseo Park" <hiyoukou@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 3/4] drm/sti: hqvdp: start the XP70 from device init
Date: Thu, 26 Nov 2026 08:34:46 +0000 [thread overview]
Message-ID: <sashiko-outbox-235033@kernel.org> (raw)
In-Reply-To: <20261126024710.33401-4-hiyoukou@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/sti: hqvdp: sti_hqvdp_bind() exposes plane with clk off on
init failure
- [Medium] drm/sti: hqvdp: sti_hqvdp_bind() leaks hqvdp->clk on error
and unbind
--
commit a8cf3e26ef27767a003bfe97a37331241f497584
Author: Minseo Park <hiyoukou@gmail.com>
drm/sti: hqvdp: start the XP70 from device init
This commit moves the sti_hqvdp_start_xp70() call out of
sti_hqvdp_atomic_check() and into sti_hqvdp_bind() so that atomic check
does not touch hardware or load firmware.
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 360d213f2094f..c6b6ed54b8995 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -1081,10 +1081,6 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
> return -EINVAL;
> }
>
> - if (!hqvdp->xp70_initialized)
> - /* Start HQVDP XP70 coprocessor */
> - sti_hqvdp_start_xp70(hqvdp);
> -
> if (!hqvdp->vtg_registered) {
> /* Prevent VTG shutdown */
> if (clk_prepare_enable(hqvdp->clk_pix_main)) {
> @@ -1333,6 +1329,9 @@ static int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
>
> hqvdp->drm_dev = drm_dev;
>
> + /* Start HQVDP XP70 coprocessor */
> + sti_hqvdp_start_xp70(hqvdp);
[Severity: High]
Can this expose the HQVDP plane with hqvdp->clk disabled when
sti_hqvdp_start_xp70() fails?
Commit e00fe64a5ccd ("drm/sti: load HQVDP firmware the first time HQVDP's
plane is used") moved firmware loading out of sti_hqvdp_bind() because the
root filesystem may not be mounted yet at bind time. When
request_firmware() or the XP70 boot poll fails in sti_hqvdp_start_xp70(),
hqvdp->xp70_initialized stays false and hqvdp->clk is left disabled, yet
sti_hqvdp_bind() still registers the DRM plane and neither
sti_hqvdp_atomic_check() nor sti_hqvdp_atomic_update() checks
hqvdp->xp70_initialized.
A subsequent commit on the plane then performs unclocked MMIO reads and
writes in sti_hqvdp_atomic_update() (via sti_hqvdp_get_free_cmd() and
HQVDP_MBX_NEXT_CMD), which can trigger an external abort or bus hang, and
disabling the plane runs sti_hqvdp_disable() from vtg_irq_thread(), doing
unclocked MMIO and sleeping for 1000 ms in the VSync IRQ thread.
Could sti_hqvdp_start_xp70() be called from sti_hqvdp_atomic_update()
instead, with register accesses guarded by hqvdp->xp70_initialized?
> +
> /* Create HQVDP plane once xp70 is initialized */
> plane = sti_hqvdp_create(drm_dev, hqvdp->dev, STI_HQVDP_0);
> if (!plane)
[Severity: Medium]
Does this leak the prepare and enable references on hqvdp->clk?
sti_hqvdp_start_xp70() calls clk_prepare_enable(hqvdp->clk), which is now
enabled unconditionally at bind time even if the plane is never used, and
nothing calls clk_disable_unprepare(hqvdp->clk) if sti_hqvdp_create() or a
later component bind fails, or when the component is unbound in
sti_hqvdp_unbind().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126024710.33401-1-hiyoukou@gmail.com?part=3
next prev parent reply other threads:[~2026-11-26 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 2:47 [PATCH v2 0/4] drm/sti: move commit work out of .atomic_check() Minseo Park
2026-11-26 2:47 ` [PATCH v2 1/4] drm/sti: cursor: do not resize the pixmap from .atomic_check() Minseo Park
2026-11-26 8:32 ` sashiko-bot
2026-11-26 2:47 ` [PATCH v2 2/4] drm/sti: gdp: set the pixel clock from .atomic_update() Minseo Park
2026-11-26 8:35 ` sashiko-bot
2026-11-26 2:47 ` [PATCH v2 3/4] drm/sti: hqvdp: start the XP70 from device init Minseo Park
2026-11-26 8:34 ` sashiko-bot [this message]
2026-11-26 2:47 ` [PATCH v2 4/4] drm/sti: hqvdp: register the VTG client from .atomic_update() Minseo Park
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=sashiko-outbox-235033@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hiyoukou@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.