All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Work around a loongarch clang error report
@ 2025-09-10 16:11 Thomas Hellström
  2025-09-10 17:08 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Hellström @ 2025-09-10 16:11 UTC (permalink / raw)
  To: intel-xe; +Cc: Thomas Hellström, Matthew Brost, kernel test robot

There seems to be a problem with the clang loongarch compiler in
that it confuses instruction pointer reads if there are more than
one per function. So break one out to a separate function
(The one in xe_validation_guard()).

Fixes: 59eabff2a352 ("drm/xe: Convert xe_bo_create_pin_map() for exhaustive eviction")
Cc: Matthew Brost <matthew.brost@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509101853.nDmyxTEM-lkp@intel.com/
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
Sending out this patch in case we need a quick fix. But if this is
indeed a compiler error we shouln't hide it by merging this.
---
 drivers/gpu/drm/xe/xe_migrate.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 6fad5d469629..1d667fa36cf3 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -394,6 +394,24 @@ struct xe_migrate *xe_migrate_alloc(struct xe_tile *tile)
 	return m;
 }
 
+static int xe_migrate_lock_prepare_vm(struct xe_tile *tile, struct xe_migrate *m, struct xe_vm *vm)
+{
+	struct xe_device *xe = tile_to_xe(tile);
+	struct xe_validation_ctx ctx;
+	struct drm_exec exec;
+	int err = 0;
+
+	xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
+		err = xe_vm_drm_exec_lock(vm, &exec);
+		drm_exec_retry_on_contention(&exec);
+		err = xe_migrate_prepare_vm(tile, m, vm, &exec);
+		drm_exec_retry_on_contention(&exec);
+		xe_validation_retry_on_oom(&ctx, &err);
+	}
+
+	return err;
+}
+
 /**
  * xe_migrate_init() - Initialize a migrate context
  * @m: The migration context
@@ -405,8 +423,6 @@ int xe_migrate_init(struct xe_migrate *m)
 	struct xe_tile *tile = m->tile;
 	struct xe_gt *primary_gt = tile->primary_gt;
 	struct xe_device *xe = tile_to_xe(tile);
-	struct xe_validation_ctx ctx;
-	struct drm_exec exec;
 	struct xe_vm *vm;
 	int err;
 
@@ -416,14 +432,7 @@ int xe_migrate_init(struct xe_migrate *m)
 	if (IS_ERR(vm))
 		return PTR_ERR(vm);
 
-	err = 0;
-	xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
-		err = xe_vm_drm_exec_lock(vm, &exec);
-		drm_exec_retry_on_contention(&exec);
-		err = xe_migrate_prepare_vm(tile, m, vm, &exec);
-		drm_exec_retry_on_contention(&exec);
-		xe_validation_retry_on_oom(&ctx, &err);
-	}
+	err = xe_migrate_lock_prepare_vm(tile, m, vm);
 	if (err)
 		return err;
 
-- 
2.51.0


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

end of thread, other threads:[~2025-09-11 14:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 16:11 [PATCH] drm/xe: Work around a loongarch clang error report Thomas Hellström
2025-09-10 17:08 ` ✓ CI.KUnit: success for " Patchwork
2025-09-10 17:41 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-11  0:29 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-11 14:35 ` [PATCH] " Lucas De Marchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.