All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v13 6/9] drm/vc4: Carry the HVS channel over to created CRTC states
Date: Thu, 03 Dec 2026 16:06:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-248171@kernel.org> (raw)
In-Reply-To: <20261203-drm-reset-state-flag-v13-6-b09f19f64e64@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/vc4: KUnit test leaks modeset locks on KUNIT_ASSERT failure
--

commit d86da181a3f3948d7fa9df62b1551aeb2cabcba4
Author: Maxime Ripard <mripard@kernel.org>

drm/vc4: Carry the HVS channel over to created CRTC states

This commit copies the current HVS channel into newly created CRTC states
in vc4_pv_muxing_atomic_check() when a CRTC remains enabled, and adds a
KUnit test covering that path.

> diff --git a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c
> index 7a54f46acff91..c868d2cd1b3db 100644
> --- a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c
> +++ b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c
> @@ -1121,10 +1121,115 @@ drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable_too_many_crtc_state(struct ku

[ ... ]

> +static void
> +drm_test_vc5_pv_muxing_bugs_created_state_keeps_channel(struct kunit *test)
> +{
> +	struct drm_modeset_acquire_ctx ctx;

[ ... ]

> +	drm_modeset_acquire_init(&ctx, 0);
> +
> +	drm = &vc4->base;
> +retry_first:
> +	state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx);
> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
> +
> +	ret = vc4_mock_atomic_add_output(test, state, VC4_ENCODER_TYPE_HDMI0);
> +	if (ret == -EDEADLK) {
> +		drm_atomic_commit_clear(state);
> +		ret = drm_modeset_backoff(&ctx);
> +		if (!ret)
> +			goto retry_first;
> +	}
> +	KUNIT_ASSERT_EQ(test, ret, 0);

[ ... ]

> +	KUNIT_EXPECT_EQ(test, new_vc4_crtc_state->assigned_channel, old_channel);
> +
> +	drm_modeset_drop_locks(&ctx);
> +	drm_modeset_acquire_fini(&ctx);
> +}

[Severity: Low]
Can a failing KUNIT_ASSERT_* in this test leak the modeset locks held in
ctx?

Once vc4_mock_atomic_add_output() or drm_atomic_check_only() acquires
modeset locks into ctx, any subsequent KUNIT_ASSERT_* failure exits the
test kthread directly via kunit_try_catch_throw() without reaching
drm_modeset_drop_locks() and drm_modeset_acquire_fini().

That trips lockdep's held-lock check on thread exit and leaves the locks
linked onto the abandoned ctx.locked list, hitting
WARN_ON(!list_empty(&lock->head)) in drm_modeset_lock_fini() during
KUnit device teardown.

Using KUNIT_EXPECT_* with a jump to a cleanup label would ensure the
locks are released on failure.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-drm-reset-state-flag-v13-0-b09f19f64e64@kernel.org?part=6

  reply	other threads:[~2026-12-03 16:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:07 [PATCH v13 0/9] drm: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-12-03 14:07 ` [PATCH v13 1/9] drm/lease: Add a helper to tell whether a lease was revoked Maxime Ripard
2026-12-03 14:23   ` sashiko-bot
2026-12-03 14:07 ` [PATCH v13 2/9] drm/atomic: Add drm_atomic_implements_create_state() helper Maxime Ripard
2026-12-03 14:07 ` [PATCH v13 3/9] drm/atomic: Allow filling a commit with pristine object states Maxime Ripard
2026-12-03 15:02   ` sashiko-bot
2026-12-03 14:07 ` [PATCH v13 4/9] drm/tests: atomic: Add tests for drm_atomic_commit_fill_with_defaults() Maxime Ripard
2026-12-03 15:21   ` sashiko-bot
2026-12-03 14:07 ` [PATCH v13 5/9] drm/amd/display: Take over the current stream and dc_state Maxime Ripard
2026-12-03 15:40   ` sashiko-bot
2026-12-03 14:07 ` [PATCH v13 6/9] drm/vc4: Carry the HVS channel over to created CRTC states Maxime Ripard
2026-12-03 16:06   ` sashiko-bot [this message]
2026-12-03 14:07 ` [PATCH v13 7/9] drm/msm/dpu1: Carry the mixers " Maxime Ripard
2026-12-03 16:36   ` sashiko-bot
2026-12-03 14:07 ` [PATCH v13 8/9] drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-12-03 14:07 ` [PATCH v13 9/9] drm/vkms: Add driver-specific plane property for testing Maxime Ripard

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-248171@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mripard@kernel.org \
    --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.