Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tomasz Lis" <tomasz.lis@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/xe/vf: Late fixups of LRCs after VF migration
Date: Fri, 06 Nov 2026 22:24:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-202331@kernel.org> (raw)
In-Reply-To: <20261106215700.1218318-2-tomasz.lis@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/xe/vf: unchecked drmm_mutex_init() in
  xe_gt_sriov_vf_init_early()
- [Low] drm/xe/vf: inaccurate commit message on LRC fixups for
  registered queues
--

commit 23a112cec6cc9cc925edc77bd85cca15d49b52e4
Author: Tomasz Lis <tomasz.lis@intel.com>

drm/xe/vf: Late fixups of LRCs after VF migration

This commit moves LRC HWSP GGTT rebasing out of vf_post_migration_fixups()
to register_exec_queue() and guc_exec_queue_unpause_prepare(), protecting
the migration scratch buffer with a drm-managed mutex.

> Do not fix LRCs of existing contexts during VF post-migration
> recovery. Instead, perform fixups before every exec queue
> registration.

[Severity: Low]
Is this commit message description accurate for already-registered
contexts?

Contexts that are already registered across VF migration do not run
register_exec_queue() again; instead, their LRCs are still rebased during
post-migration recovery in guc_exec_queue_unpause_prepare() (via
vf_post_migration_recovery() -> vf_post_migration_rearm() ->
xe_guc_submit_unpause_prepare_vf()).  Only unregistered contexts defer LRC
fixups until register_exec_queue().

> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 2a5f2064ad3e8..4412ed6eb422f 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
[ ... ]
> @@ -1498,17 +1494,19 @@ static void vf_migration_fini(void *arg)
>   */
>  int xe_gt_sriov_vf_init_early(struct xe_gt *gt)
>  {
> +	struct xe_device *xe = gt_to_xe(gt);
>  	void *buf;
>  
> -	if (!xe_sriov_vf_migration_supported(gt_to_xe(gt)))
> +	if (!xe_sriov_vf_migration_supported(xe))
>  		return 0;
>  
> -	buf = drmm_kmalloc(&gt_to_xe(gt)->drm,
> -			   post_migration_scratch_size(gt_to_xe(gt)),
> +	buf = drmm_kmalloc(&xe->drm,
> +			   post_migration_scratch_size(xe),
>  			   GFP_KERNEL);
>  	if (!buf)
>  		return -ENOMEM;
>  
> +	drmm_mutex_init(&xe->drm, &gt->sriov.vf.migration.scratch_lock);
>  	gt->sriov.vf.migration.scratch = buf;

[Severity: Medium]
Should xe_gt_sriov_vf_init_early() check and return the error from
drmm_mutex_init()?

drmm_mutex_init() expands to drmm_add_action_or_reset(), which is annotated
__must_check and triggers a -Wunused-result warning (breaking builds with
-Werror).  If the drmres allocation fails, __drmm_mutex_release() destroys
scratch_lock while xe_gt_sriov_vf_init_early() returns 0, leaving
xe_exec_queue_lrcs_hwsp_rebase() to lock a destroyed mutex.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106215700.1218318-1-tomasz.lis@intel.com?part=1

  reply	other threads:[~2026-11-06 22:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 21:56 [PATCH v3 0/2] drm/xe/vf: New approach for post-migration LRC fixups Tomasz Lis
2026-11-06 21:56 ` [PATCH v3 1/2] drm/xe/vf: Late fixups of LRCs after VF migration Tomasz Lis
2026-11-06 22:24   ` sashiko-bot [this message]
2026-11-06 21:57 ` [PATCH v3 2/2] drm/xe: After VF migration, repeat BO mapping in progress Tomasz Lis
2026-11-06 22:24   ` sashiko-bot
2026-11-06 22:05 ` ✓ CI.KUnit: success for drm/xe/vf: New approach for post-migration LRC fixups (rev3) Patchwork
2026-11-06 22:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-08  2:51 ` ✗ 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=sashiko-outbox-202331@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tomasz.lis@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox