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/pf: Assert LMEM provisioning is done only on DGFX

The Local Memory (aka VRAM) is only available on DGFX platforms.
We shouldn't attempt to provision VFs with LMEM or attempt to
update the LMTT on non-DGFX platforms. Add missing asserts that
would enforce that and fix release code that could crash on iGFX
due to uninitialized LMTT.

Fixes: c063cce7df3a ("drm/xe/pf: Update the LMTT when freeing VF GT config")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607153155.1592-1-michal.wajdeczko@intel.com

+13 -2
+13 -2
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
··· 1290 1290 struct xe_tile *tile; 1291 1291 unsigned int tid; 1292 1292 1293 + xe_assert(xe, IS_DGFX(xe)); 1294 + xe_assert(xe, IS_SRIOV_PF(xe)); 1295 + 1293 1296 for_each_tile(tile, xe, tid) { 1294 1297 lmtt = &tile->sriov.pf.lmtt; 1295 1298 xe_lmtt_drop_pages(lmtt, vfid); ··· 1310 1307 unsigned int gtid; 1311 1308 unsigned int tid; 1312 1309 int err; 1310 + 1311 + xe_assert(xe, IS_DGFX(xe)); 1312 + xe_assert(xe, IS_SRIOV_PF(xe)); 1313 1313 1314 1314 total = 0; 1315 1315 for_each_tile(tile, xe, tid) ··· 1359 1353 1360 1354 static void pf_release_vf_config_lmem(struct xe_gt *gt, struct xe_gt_sriov_config *config) 1361 1355 { 1356 + xe_gt_assert(gt, IS_DGFX(gt_to_xe(gt))); 1362 1357 xe_gt_assert(gt, !xe_gt_is_media_type(gt)); 1363 1358 lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt)); 1364 1359 ··· 1378 1371 int err; 1379 1372 1380 1373 xe_gt_assert(gt, vfid); 1374 + xe_gt_assert(gt, IS_DGFX(xe)); 1381 1375 xe_gt_assert(gt, !xe_gt_is_media_type(gt)); 1382 1376 1383 1377 size = round_up(size, pf_get_lmem_alignment(gt)); ··· 1846 1838 static void pf_release_vf_config(struct xe_gt *gt, unsigned int vfid) 1847 1839 { 1848 1840 struct xe_gt_sriov_config *config = pf_pick_vf_config(gt, vfid); 1841 + struct xe_device *xe = gt_to_xe(gt); 1849 1842 1850 1843 if (!xe_gt_is_media_type(gt)) { 1851 1844 pf_release_vf_config_ggtt(gt, config); 1852 - pf_release_vf_config_lmem(gt, config); 1853 - pf_update_vf_lmtt(gt_to_xe(gt), vfid); 1845 + if (IS_DGFX(xe)) { 1846 + pf_release_vf_config_lmem(gt, config); 1847 + pf_update_vf_lmtt(xe, vfid); 1848 + } 1854 1849 } 1855 1850 pf_release_config_ctxs(gt, config); 1856 1851 pf_release_config_dbs(gt, config);