Skip to content

Commit 551801b

Browse files
mwiniarsThomas Hellström
authored andcommitted
drm/xe/pf: Check for fence error on VRAM save/restore
The code incorrectly assumes that the VRAM save/restore fence is valid. Fix it by checking for error. Fixes: 49cf1b9 ("drm/xe/pf: Handle VRAM migration data as part of PF control") Suggested-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patch.msgid.link/20251114122339.1791026-1-michal.winiarski@intel.com Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> (cherry picked from commit 78ff838) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 0fd2f9f commit 551801b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ static int pf_save_vram_chunk(struct xe_gt *gt, unsigned int vfid,
571571
fence = __pf_save_restore_vram(gt, vfid,
572572
src_vram, src_vram_offset,
573573
data->bo, 0, size, true);
574+
if (IS_ERR(fence)) {
575+
ret = PTR_ERR(fence);
576+
goto fail;
577+
}
574578

575579
ret = dma_fence_wait_timeout(fence, false, PF_VRAM_SAVE_RESTORE_TIMEOUT);
576580
dma_fence_put(fence);
@@ -654,6 +658,11 @@ static int pf_restore_vf_vram_mig_data(struct xe_gt *gt, unsigned int vfid,
654658

655659
fence = __pf_save_restore_vram(gt, vfid, vram, data->hdr.offset,
656660
data->bo, 0, data->hdr.size, false);
661+
if (IS_ERR(fence)) {
662+
ret = PTR_ERR(fence);
663+
goto err;
664+
}
665+
657666
ret = dma_fence_wait_timeout(fence, false, PF_VRAM_SAVE_RESTORE_TIMEOUT);
658667
dma_fence_put(fence);
659668
if (!ret) {

0 commit comments

Comments
 (0)