Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthew Brost" <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v8 19/24] drm/xe: Add ULLS migration job support to migration layer
Date: Fri, 25 Sep 2026 20:41:37 +0000	[thread overview]
Message-ID: <20260925204138.6C9181F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260925201526.1355279-20-matthew.brost@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] drm/xe/migrate: ULLS exit worker fires during system suspend causing fatal hardware access
- [High] drm/xe/migrate: ULLS state not cleared on GT reset causes migration engine hang
--

commit ffd4d32bbca19023aed05a8d61a40704a5e6e6a4
Author: Matthew Brost <matthew.brost@intel.com>

drm/xe: Add ULLS migration job support to migration layer

This commit adds a function to enter Ultra Low Latency Submission (ULLS)
mode for migration jobs, and a delayed worker to exit it for power savings.
It introduces several ULLS state flags and related job submission triggers.

> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c

[ ... ]

> +static struct dma_fence *xe_migrate_job_push(struct xe_migrate *m,
> +					     struct xe_sched_job *job)
> +{
> +	enum xe_ulls_state ulls = ULLS_NONE;
> +
> +	lockdep_assert_held(&m->job_mutex);
> +
> +	if (xe_migrate_ulls_enabled(m)) {
> +		ulls = ULLS_ACTIVE;

[Severity: High]
Does the software state stay out of sync if a GT reset occurs while ULLS is
active?

If m->ulls.enabled is never cleared by a GT reset hook, the next migration
job submitted post-reset will see ulls.enabled as true. It will then submit
as a chained job (ULLS_ACTIVE), bypassing the GuC doorbell (H2G
XE_GUC_ACTION_SCHED_CONTEXT).

Since the hardware was reset, the context needs a schedule doorbell to pick
up the new tail, potentially causing the migration engine to hang permanently.

> +		mod_delayed_work(system_percpu_wq, &m->ulls.exit_work,
> +				 ULLS_EXIT_JIFFIES);
> +	}
> +
> +	return __xe_migrate_job_push(m, job, ulls);
> +}

[ ... ]

> +static void xe_migrate_ulls_exit(struct work_struct *work)
> +{
> +	struct xe_migrate *m = container_of(work, struct xe_migrate,
> +					    ulls.exit_work.work);
> +	struct xe_device *xe = tile_to_xe(m->tile);
> +	struct xe_sched_job *job = NULL;
> +	struct dma_fence *fence = NULL;
> +	u64 batch_addr[2] = { 0, 0 };
> +	int idx;
> +
> +	xe_assert(xe, m->ulls.enabled);
> +
> +	if (!drm_dev_enter(&xe->drm, &idx))
> +		return;
> +
> +	/*
> +	 * Must be done outside job_mutex as that lock is tainted with
> +	 * reclaim and must be done holding a pm ref.
> +	 */
> +	job = xe_sched_job_create(m->q, batch_addr);

[Severity: Critical]
Could this worker fire during system suspend and attempt invalid hardware
access?

The system suspend path (xe_pm_suspend) does not appear to call
cancel_delayed_work_sync(&m->ulls.exit_work).

If ULLS is entered right before suspend (e.g., from an eviction page fault),
this exit worker might execute after the device has entered D3Cold. This
would lead to a machine check, PCI abort, or kernel panic when
xe_sched_job_create() pushes the job and the scheduler writes to GuC MMIO
or the GGTT ring buffer on a powered-down device.

> +	if (WARN_ON_ONCE(IS_ERR(job))) {
> +		drm_dev_exit(idx);
> +		mod_delayed_work(system_percpu_wq, &m->ulls.exit_work,
> +				 ULLS_EXIT_JIFFIES);
> +		return;		/* Not fatal */
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925201526.1355279-1-matthew.brost@intel.com?part=19

  reply	other threads:[~2026-09-25 20:41 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 20:15 [PATCH v8 00/24] CPU binds and ULLS on migration queue Matthew Brost
2026-09-25 20:15 ` [PATCH v8 01/24] drm/xe: reference VM from PT BOs Matthew Brost
2026-09-25 20:15 ` [PATCH v8 02/24] drm/xe: Drop struct xe_migrate_pt_update argument from populate/clear vfuns Matthew Brost
2026-09-25 20:15 ` [PATCH v8 03/24] drm/xe: Add xe_migrate_update_pgtables_cpu_execute helper Matthew Brost
2026-09-25 20:15 ` [PATCH v8 04/24] drm/xe: Decouple exec queue idle check from LRC Matthew Brost
2026-09-25 20:15 ` [PATCH v8 05/24] drm/xe: Add job count to GuC exec queue snapshot Matthew Brost
2026-09-25 20:15 ` [PATCH v8 06/24] drm/xe: Update xe_bo_put_deferred arguments to include writeback flag Matthew Brost
2026-09-25 20:15 ` [PATCH v8 07/24] drm/xe: Update scheduler job layer to support PT jobs Matthew Brost
2026-09-25 20:15 ` [PATCH v8 08/24] drm/xe: Add helpers to access PT ops Matthew Brost
2026-09-25 20:15 ` [PATCH v8 09/24] drm/xe: Add struct xe_pt_job_ops Matthew Brost
2026-09-25 20:15 ` [PATCH v8 10/24] drm/xe: Update GuC submission backend to run PT jobs Matthew Brost
2026-09-25 20:38   ` sashiko-bot
2026-09-25 23:20   ` Ghimiray, Himal Prasad
2026-09-25 20:15 ` [PATCH v8 11/24] drm/xe: Store level in struct xe_vm_pgtable_update Matthew Brost
2026-09-25 20:15 ` [PATCH v8 12/24] drm/xe: Don't use migrate exec queue for page fault binds Matthew Brost
2026-09-25 20:15 ` [PATCH v8 13/24] drm/xe: Enable CPU binds for jobs Matthew Brost
2026-09-25 20:39   ` sashiko-bot
2026-09-25 20:15 ` [PATCH v8 14/24] drm/xe: Remove unused arguments from xe_migrate_pt_update_ops Matthew Brost
2026-09-25 20:15 ` [PATCH v8 15/24] drm/xe: Make bind queues operate cross-tile Matthew Brost
2026-09-25 20:15 ` [PATCH v8 16/24] drm/xe: Add CPU bind layer Matthew Brost
2026-09-25 20:15 ` [PATCH v8 17/24] drm/xe: Add device flag to enable PT mirroring across tiles Matthew Brost
2026-09-25 20:46   ` sashiko-bot
2026-09-25 20:15 ` [PATCH v8 18/24] drm/xe: Add ULLS support to LRC Matthew Brost
2026-09-25 20:15 ` [PATCH v8 19/24] drm/xe: Add ULLS migration job support to migration layer Matthew Brost
2026-09-25 20:41   ` sashiko-bot [this message]
2026-09-25 20:15 ` [PATCH v8 20/24] drm/xe: Add ULLS migration job support to ring ops Matthew Brost
2026-09-25 20:48   ` sashiko-bot
2026-09-25 20:15 ` [PATCH v8 21/24] drm/xe: Add ULLS migration job support to GuC submission Matthew Brost
2026-09-25 20:45   ` sashiko-bot
2026-09-25 20:15 ` [PATCH v8 22/24] drm/xe: Enter ULLS for migration jobs upon page fault or SVM prefetch Matthew Brost
2026-09-25 20:15 ` [PATCH v8 23/24] drm/xe: add migrate ULLS period configfs attribute Matthew Brost
2026-09-25 20:15 ` [PATCH v8 24/24] drm/xe: Document ULLS for migration jobs Matthew Brost
2026-09-25 21:02 ` ✗ CI.checkpatch: warning for CPU binds and ULLS on migration queue (rev10) Patchwork
2026-09-25 21:04 ` ✓ CI.KUnit: success " Patchwork
2026-09-25 22:12 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-26  7:40 ` ✗ Xe.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=20260925204138.6C9181F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox