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] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume()
Date: Tue, 28 Apr 2026 15:51:55 -0300 [thread overview]
Message-ID: <874ikuq5o4.fsf@intel.com> (raw)
In-Reply-To: <20260428183050.3998257-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).
>
> Fixes: 67df4a5cbc58 ("drm/xe/pf: Add data structures and handlers for migration rings")
> Assisted-by: Claude:claude-opus-4.6
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_migration.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c b/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> index 6c4b16409cc9..d6f602f715f0 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_migration.c
> @@ -149,7 +149,7 @@ 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 && PTR_ERR(data) != -EAGAIN)
Hm... Is it safe to user PRT_ERR() without an IS_ERR() check in the
first place?
Perhaps we could take this opportunity to fix that as well.
--
Gustavo Sousa
> return data;
> if (PTR_ERR(data) == -EAGAIN)
> more_data = true;
> --
> 2.43.0
next prev parent reply other threads:[~2026-04-28 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 18:30 [PATCH] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() Shuicheng Lin
2026-04-28 18:51 ` Gustavo Sousa [this message]
2026-04-28 19:08 ` ✓ CI.KUnit: success for " Patchwork
2026-04-28 19:56 ` ✓ Xe.CI.BAT: " 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=874ikuq5o4.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