All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Brzezinka" <sebastian.brzezinka@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6 1/3] drm/i915/selftests: Fix unlocked mm.stolen in reset selftest
Date: Wed, 18 Nov 2026 13:31:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-221017@kernel.org> (raw)
In-Reply-To: <c47b0ea2093da73a92e9e6d62b062f9cc52851d1.1795006734.git.sebastian.brzezinka@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/i915/selftests: commit message omits
  __drm_mm_interval_first() check fix
--

commit 7de700f4e6f9ce33a0c4b581db34793a6145c70e
Author: Sebastian Brzezinka <sebastian.brzezinka@intel.com>

drm/i915/selftests: Fix unlocked mm.stolen in reset selftest

This commit acquires gt->i915->mm.stolen_lock around the stolen memory
walk in __igt_reset_stolen() and moves the interval tree lookup into a
stolen_page_unused() helper that compares the result against
&gt->i915->mm.stolen.head_node.

> diff --git a/drivers/gpu/drm/i915/gt/selftest_reset.c b/drivers/gpu/drm/i915/gt/selftest_reset.c
> index 3599c9f101e14..8d5f3ef84db55 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_reset.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_reset.c
> @@ -14,6 +14,16 @@
>  #include "selftests/igt_atomic.h"
>  #include "selftests/igt_spinner.h"
>  
> +static bool stolen_page_unused(struct intel_gt *gt, resource_size_t page)
> +{
> +	lockdep_assert_held(&gt->i915->mm.stolen_lock);
> +
> +	return __drm_mm_interval_first(&gt->i915->mm.stolen,
> +					page << PAGE_SHIFT,
> +					((page + 1) << PAGE_SHIFT) - 1) ==
> +	       &gt->i915->mm.stolen.head_node;
> +}

[ ... ]

> @@ -95,9 +107,7 @@ __igt_reset_stolen(struct intel_gt *gt,
>  				      ggtt->error_capture.start,
>  				      PAGE_SIZE);
>  
> -		if (!__drm_mm_interval_first(&gt->i915->mm.stolen,
> -					     page << PAGE_SHIFT,
> -					     ((page + 1) << PAGE_SHIFT) - 1))
> +		if (stolen_page_unused(gt, page))
>  			memset_io(s, STACK_MAGIC, PAGE_SIZE);

[Severity: Low]
Should the commit message also describe the __drm_mm_interval_first()
return-value fix in stolen_page_unused()?

__drm_mm_interval_first() returns &mm->head_node when no interval overlaps
the queried range, so the previous !__drm_mm_interval_first() checks were
always false and __igt_reset_stolen() never poisoned or verified unused
stolen pages.  This functional change is currently only mentioned in the
changelog notes below the "---" separator, which will be stripped when the
patch is applied.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/c47b0ea2093da73a92e9e6d62b062f9cc52851d1.1795006734.git.sebastian.brzezinka@intel.com?part=1

  reply	other threads:[~2026-11-18 13:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 13:02 [PATCH v6 0/3] drm/i915/selftests: fix stolen reset test races Sebastian Brzezinka
2026-11-18 13:02 ` [PATCH v6 1/3] drm/i915/selftests: Fix unlocked mm.stolen in reset selftest Sebastian Brzezinka
2026-11-18 13:31   ` sashiko-bot [this message]
2026-11-18 15:23   ` Krzysztof Karas
2026-11-19 10:32     ` Sebastian Brzezinka
2026-11-19 14:48       ` Krzysztof Karas
2026-11-19 15:07   ` Krzysztof Niemiec
2026-11-18 13:02 ` [PATCH v6 2/3] drm/i915/selftests: Limit stolen reset test to usable stolen Sebastian Brzezinka
2026-11-18 13:09   ` sashiko-bot
2026-11-18 15:24   ` Krzysztof Karas
2026-11-19 15:12   ` Krzysztof Niemiec
2026-11-18 13:02 ` [PATCH v6 3/3] drm/i915/selftests: take error_mutex in stolen reset test Sebastian Brzezinka
2026-11-18 13:13   ` sashiko-bot
2026-11-18 15:34   ` Krzysztof Karas
2026-11-19 10:45     ` Sebastian Brzezinka
2026-11-19 10:58       ` Andi Shyti
2026-11-19 11:06         ` Sebastian Brzezinka
2026-11-19 14:46           ` Krzysztof Karas
2026-11-19 15:11           ` Krzysztof Niemiec
2026-11-18 17:29 ` ✗ i915.CI.BAT: failure for drm/i915/selftests: fix stolen reset test races Patchwork
2026-11-19  8:26 ` ✓ i915.CI.BAT: success for drm/i915/selftests: fix stolen reset test races (rev2) Patchwork
2026-11-19 18:53 ` ✗ i915.CI.Full: failure " 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=sashiko-outbox-221017@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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.