All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
	Krzysztof Karas <krzysztof.karas@intel.com>
Subject: Re: [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer
Date: Thu, 01 Oct 2026 11:08:57 +0300	[thread overview]
Message-ID: <b949384fbed6c626193ac60f4b4e5d881910e70e@intel.com> (raw)
In-Reply-To: <20261001071757.2688815-1-krzysztof.karas@intel.com>

On Thu, 01 Oct 2026, Krzysztof Karas <krzysztof.karas@intel.com> wrote:
> If intel_ring_begin() fails in live_emit_pte_full_ring(), then
> cleanup is performed on an uninitialized timer.
>
> Prevent that by jumping to a dedicated label for driver removal
> cleanup.
>
> Assisted-by: Copilot-Claude-Opus-5

Nowadays it's sufficient to state, "Assisted-by: LLM".

> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/selftest_migrate.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> index 5b986a7687d9..5e3a9b5a83eb 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> @@ -651,17 +651,18 @@ static int live_emit_pte_full_ring(void *arg)
>  	len = emit_pte(rq, &it, obj->pat_index, false, 0, CHUNK_SZ);
>  	if (!len) {
>  		err = -EINVAL;
> -		goto out_rq;
> +		goto out_timer;
>  	}
>  	if (len < 0) {
>  		err = len;
> -		goto out_rq;
> +		goto out_timer;
>  	}
>  
> -out_rq:
> -	i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */
> +out_timer:
>  	timer_delete_sync(&st.timer);
>  	timer_destroy_on_stack(&st.timer);
> +out_rq:
> +	i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */

This seems like the proper thing to do.

I can't think of any reason why changing the order would be bad, but
then this is not really my area of expertise. With that,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  out_unpin:
>  	intel_context_unpin(ce);
>  out_put:

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-10-01  8:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  7:17 [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer Krzysztof Karas
2026-10-01  8:08 ` Jani Nikula [this message]
2026-10-01 10:07 ` ✓ i915.CI.BAT: success for drm/i915/gt: Do not destroy uninitialized timer (rev2) Patchwork
2026-10-01 12:06 ` [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer Sebastian Brzezinka
2026-10-02 11:55 ` ✓ i915.CI.Full: success for drm/i915/gt: Do not destroy uninitialized timer (rev2) Patchwork

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=b949384fbed6c626193ac60f4b4e5d881910e70e@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@intel.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 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.