Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/vf: Wait for all fixups before using default LRCs

When a context is being created during save/restore, the LRC creation
needs to wait for GGTT address space to be shifted. But it also needs
to have fixed default LRCs. This is mandatory to avoid the situation
where LRC will be created based on data from before the fixups, but
reference within exec queue will be set too late for fixups.

This fixes an issue where contexts created during save/restore have
a large chance of having one unfixed LRC, due to the xe_lrc_create()
being synced for equal start to race with default LRC fixups.

v2: Move the fixups confirmation further, behind all fixups.
Revert some renames.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20260226212701.2937065-4-tomasz.lis@intel.com

authored by

Tomasz Lis and committed by
Michal Wajdeczko
f3fb5f1e ec172c7b

+10 -8
+9 -7
drivers/gpu/drm/xe/xe_gt_sriov_vf.c
··· 536 536 */ 537 537 xe_ggtt_shift_nodes(tile->mem.ggtt, start); 538 538 539 - if (xe_sriov_vf_migration_supported(gt_to_xe(gt))) { 540 - WRITE_ONCE(gt->sriov.vf.migration.ggtt_need_fixes, false); 541 - smp_wmb(); /* Ensure above write visible before wake */ 542 - wake_up_all(&gt->sriov.vf.migration.wq); 543 - } 544 - 545 539 return 0; 546 540 } 547 541 ··· 838 844 839 845 for_each_hw_engine(hwe, gt, id) 840 846 xe_default_lrc_update_memirq_regs_with_address(hwe); 847 + } 848 + 849 + static void vf_post_migration_mark_fixups_done(struct xe_gt *gt) 850 + { 851 + WRITE_ONCE(gt->sriov.vf.migration.ggtt_need_fixes, false); 852 + smp_wmb(); /* Ensure above write visible before wake */ 853 + wake_up_all(&gt->sriov.vf.migration.wq); 841 854 } 842 855 843 856 static void vf_start_migration_recovery(struct xe_gt *gt) ··· 1381 1380 if (err) 1382 1381 goto fail; 1383 1382 1383 + vf_post_migration_mark_fixups_done(gt); 1384 1384 vf_post_migration_rearm(gt); 1385 1385 1386 1386 err = vf_post_migration_resfix_done(gt, marker); ··· 1516 1514 } 1517 1515 1518 1516 /** 1519 - * xe_gt_sriov_vf_wait_valid_ggtt() - VF wait for valid GGTT addresses 1517 + * xe_gt_sriov_vf_wait_valid_ggtt() - wait for valid GGTT nodes and address refs 1520 1518 * @gt: the &xe_gt 1521 1519 */ 1522 1520 void xe_gt_sriov_vf_wait_valid_ggtt(struct xe_gt *gt)
+1 -1
drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h
··· 73 73 bool recovery_queued; 74 74 /** @recovery_inprogress: VF post migration recovery in progress */ 75 75 bool recovery_inprogress; 76 - /** @ggtt_need_fixes: VF GGTT needs fixes */ 76 + /** @ggtt_need_fixes: VF GGTT and references to it need fixes */ 77 77 bool ggtt_need_fixes; 78 78 }; 79 79