Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: "Shuicheng Lin" <shuicheng.lin@intel.com>,
	"Michał Winiarski" <michal.winiarski@intel.com>
Subject: Re: [PATCH v2] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume()
Date: Tue, 28 Apr 2026 18:27:44 -0300	[thread overview]
Message-ID: <87y0i6ojvz.fsf@intel.com> (raw)
In-Reply-To: <20260428201448.3999428-1-shuicheng.lin@intel.com>

Shuicheng Lin <shuicheng.lin@intel.com> writes:

> PTR_ERR() returns a negative value, so comparing against the positive
> EAGAIN is always true for ERR_PTR(-EAGAIN), causing pf_migration_consume()
> to bail out instead of continuing to the remaining GTs. On multi-GT
> platforms this can skip GTs that already have data ready.
>
> Compare against -EAGAIN to match the intent (and the following line
> that correctly uses -EAGAIN). While at it, gate PTR_ERR() with
> IS_ERR().
>
> v2: add IS_ERR() guard before PTR_ERR(). (Gustavo)
>
> Fixes: 67df4a5cbc58 ("drm/xe/pf: Add data structures and handlers for migration rings")
> Cc: Gustavo Sousa <gustavo.sousa@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_sriov_pf_migration.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c b/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> index 6c4b16409cc9..150a241110fb 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> @@ -149,10 +149,11 @@ pf_migration_consume(struct xe_device *xe, unsigned int vfid)
>  
>  	for_each_gt(gt, xe, gt_id) {
>  		data = xe_gt_sriov_pf_migration_save_consume(gt, vfid);
> -		if (data && PTR_ERR(data) != EAGAIN)
> +		if (!data)
> +			continue;
> +		if (!IS_ERR(data) || PTR_ERR(data) != -EAGAIN)
>  			return data;
> -		if (PTR_ERR(data) == -EAGAIN)
> -			more_data = true;
> +		more_data = true;
>  	}
>  
>  	if (!more_data)
> -- 
> 2.43.0

  parent reply	other threads:[~2026-04-28 21:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 20:14 [PATCH v2] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() Shuicheng Lin
2026-04-28 20:22 ` ✓ CI.KUnit: success for drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() (rev2) Patchwork
2026-04-28 21:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-28 21:27 ` Gustavo Sousa [this message]
2026-04-29  7:45 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-29 18:45 ` ✓ CI.KUnit: success for drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() (rev3) Patchwork
2026-04-29 19:50 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-30  7:39 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-30 15:33   ` Lin, Shuicheng

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=87y0i6ojvz.fsf@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.winiarski@intel.com \
    --cc=shuicheng.lin@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