Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume()
@ 2026-04-28 20:14 Shuicheng Lin
  2026-04-28 20:22 ` ✓ CI.KUnit: success for drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() (rev2) Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Shuicheng Lin @ 2026-04-28 20:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Shuicheng Lin, Gustavo Sousa, Michał Winiarski

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>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-30 15:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2] drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() Gustavo Sousa
2026-04-29  7:45 ` ✗ Xe.CI.FULL: failure for drm/xe/pf: Fix EAGAIN sign in pf_migration_consume() (rev2) 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox