Skip to content

Commit 84335a9

Browse files
committed
Merge tag 'drm-xe-fixes-2026-05-21' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
- SRIOV related fixes (Wajdeczko, Mohanram) - Fix leak and double-free (Lin) - Multi-cast register fixes (Gustavo) - Multi-queue fix (Niranjana) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/ag9rR5VwCdkA0lzI@intel.com
2 parents 4378a41 + 4d25342 commit 84335a9

11 files changed

Lines changed: 69 additions & 34 deletions

File tree

drivers/gpu/drm/xe/regs/xe_gt_regs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@
152152

153153
#define XEHPG_INSTDONE_GEOM_SVGUNIT XE_REG_MCR(0x666c)
154154

155-
#define CACHE_MODE_1 XE_REG(0x7004, XE_REG_OPTION_MASKED)
155+
#define CACHE_MODE_1 XE_REG_MCR(0x7004, XE_REG_OPTION_MASKED)
156156
#define MSAA_OPTIMIZATION_REDUC_DISABLE REG_BIT(11)
157157

158158
#define COMMON_SLICE_CHICKEN1 XE_REG(0x7010, XE_REG_OPTION_MASKED)
159+
#define XEHP_COMMON_SLICE_CHICKEN1 XE_REG_MCR(0x7010, XE_REG_OPTION_MASKED)
159160
#define DISABLE_BOTTOM_CLIP_RECTANGLE_TEST REG_BIT(14)
160161

161162
#define HIZ_CHICKEN XE_REG(0x7018, XE_REG_OPTION_MASKED)
@@ -178,6 +179,7 @@
178179
#define XEHPG_SC_INSTDONE_EXTRA2 XE_REG_MCR(0x7108)
179180

180181
#define COMMON_SLICE_CHICKEN4 XE_REG(0x7300, XE_REG_OPTION_MASKED)
182+
#define XEHP_COMMON_SLICE_CHICKEN4 XE_REG_MCR(0x7300, XE_REG_OPTION_MASKED)
181183
#define SBE_PUSH_CONSTANT_BEHIND_FIX_ENABLE REG_BIT(12)
182184
#define DISABLE_TDC_LOAD_BALANCING_CALC REG_BIT(6)
183185
#define HW_FILTERING REG_BIT(5)

drivers/gpu/drm/xe/xe_gsc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc)
482482
EXEC_QUEUE_FLAG_PERMANENT, 0);
483483
if (IS_ERR(q)) {
484484
xe_gt_err(gt, "Failed to create queue for GSC submission\n");
485-
err = PTR_ERR(q);
486-
goto out_bo;
485+
return PTR_ERR(q);
487486
}
488487

489488
wq = alloc_ordered_workqueue("gsc-ordered-wq", 0);
@@ -506,8 +505,6 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc)
506505

507506
out_q:
508507
xe_exec_queue_put(q);
509-
out_bo:
510-
xe_bo_unpin_map_no_vm(bo);
511508
return err;
512509
}
513510

drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ int xe_gt_sriov_pf_monitor_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32
114114
* VFs with no events are not printed.
115115
*
116116
* This function can only be called on PF.
117+
*
118+
* Return: always 0
117119
*/
118-
void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p)
120+
int xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p)
119121
{
120122
unsigned int n, total_vfs = xe_gt_sriov_pf_get_totalvfs(gt);
121123
const struct xe_gt_sriov_monitor *data;
@@ -144,4 +146,6 @@ void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p
144146
#undef __format
145147
#undef __value
146148
}
149+
150+
return 0;
147151
}

drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct drm_printer;
1313
struct xe_gt;
1414

1515
void xe_gt_sriov_pf_monitor_flr(struct xe_gt *gt, u32 vfid);
16-
void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p);
16+
int xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p);
1717

1818
#ifdef CONFIG_PCI_IOV
1919
int xe_gt_sriov_pf_monitor_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);

drivers/gpu/drm/xe/xe_gt_sriov_vf.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,13 +1137,15 @@ void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val)
11371137
}
11381138

11391139
/**
1140-
* xe_gt_sriov_vf_print_config - Print VF self config.
1140+
* xe_gt_sriov_vf_print_config() - Print VF self config.
11411141
* @gt: the &xe_gt
11421142
* @p: the &drm_printer
11431143
*
11441144
* This function is for VF use only.
1145+
*
1146+
* Return: always 0.
11451147
*/
1146-
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
1148+
int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
11471149
{
11481150
struct xe_gt_sriov_vf_selfconfig *config = &gt->sriov.vf.self_config;
11491151
struct xe_device *xe = gt_to_xe(gt);
@@ -1170,16 +1172,20 @@ void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
11701172

11711173
drm_printf(p, "GuC contexts:\t%u\n", config->num_ctxs);
11721174
drm_printf(p, "GuC doorbells:\t%u\n", config->num_dbs);
1175+
1176+
return 0;
11731177
}
11741178

11751179
/**
1176-
* xe_gt_sriov_vf_print_runtime - Print VF's runtime regs received from PF.
1180+
* xe_gt_sriov_vf_print_runtime() - Print VF's runtime regs received from PF.
11771181
* @gt: the &xe_gt
11781182
* @p: the &drm_printer
11791183
*
11801184
* This function is for VF use only.
1185+
*
1186+
* Return: always 0.
11811187
*/
1182-
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
1188+
int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
11831189
{
11841190
struct vf_runtime_reg *vf_regs = gt->sriov.vf.runtime.regs;
11851191
unsigned int size = gt->sriov.vf.runtime.num_regs;
@@ -1188,16 +1194,20 @@ void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
11881194

11891195
for (; size--; vf_regs++)
11901196
drm_printf(p, "%#x = %#x\n", vf_regs->offset, vf_regs->value);
1197+
1198+
return 0;
11911199
}
11921200

11931201
/**
1194-
* xe_gt_sriov_vf_print_version - Print VF ABI versions.
1202+
* xe_gt_sriov_vf_print_version() - Print VF ABI versions.
11951203
* @gt: the &xe_gt
11961204
* @p: the &drm_printer
11971205
*
11981206
* This function is for VF use only.
1207+
*
1208+
* Return: always 0.
11991209
*/
1200-
void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
1210+
int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
12011211
{
12021212
struct xe_device *xe = gt_to_xe(gt);
12031213
struct xe_uc_fw_version *guc_version = &gt->sriov.vf.guc_version;
@@ -1227,6 +1237,8 @@ void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
12271237
GUC_RELAY_VERSION_LATEST_MAJOR, GUC_RELAY_VERSION_LATEST_MINOR);
12281238
drm_printf(p, "\thandshake:\t%u.%u\n",
12291239
pf_version->major, pf_version->minor);
1240+
1241+
return 0;
12301242
}
12311243

12321244
static bool vf_post_migration_shutdown(struct xe_gt *gt)

drivers/gpu/drm/xe/xe_gt_sriov_vf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ bool xe_gt_sriov_vf_sched_groups_enabled(struct xe_gt *gt);
3535
u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg);
3636
void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val);
3737

38-
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39-
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40-
void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
38+
int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39+
int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40+
int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
4141

4242
int xe_gt_sriov_vf_wait_valid_ggtt(struct xe_gt *gt);
4343
int xe_vf_migration_fixups_complete_count(struct xe_gt *gt);

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,14 @@ static void guc_exec_queue_fini(struct xe_exec_queue *q)
16731673
struct xe_guc_exec_queue *ge = q->guc;
16741674
struct xe_guc *guc = exec_queue_to_guc(q);
16751675

1676+
if (xe_exec_queue_is_multi_queue_secondary(q)) {
1677+
struct xe_exec_queue_group *group = q->multi_queue.group;
1678+
1679+
mutex_lock(&group->list_lock);
1680+
list_del(&q->multi_queue.link);
1681+
mutex_unlock(&group->list_lock);
1682+
}
1683+
16761684
release_guc_id(guc, q);
16771685
xe_sched_entity_fini(&ge->entity);
16781686
xe_sched_fini(&ge->sched);
@@ -1694,14 +1702,6 @@ static void __guc_exec_queue_destroy_async(struct work_struct *w)
16941702
guard(xe_pm_runtime)(guc_to_xe(guc));
16951703
trace_xe_exec_queue_destroy(q);
16961704

1697-
if (xe_exec_queue_is_multi_queue_secondary(q)) {
1698-
struct xe_exec_queue_group *group = q->multi_queue.group;
1699-
1700-
mutex_lock(&group->list_lock);
1701-
list_del(&q->multi_queue.link);
1702-
mutex_unlock(&group->list_lock);
1703-
}
1704-
17051705
/* Confirm no work left behind accessing device structures */
17061706
cancel_delayed_work_sync(&ge->sched.base.work_tdr);
17071707

drivers/gpu/drm/xe/xe_memirq.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,25 @@ static bool memirq_received(struct xe_memirq *memirq, struct iosys_map *vector,
427427
return __memirq_received(memirq, vector, offset, name, true);
428428
}
429429

430+
static void memirq_assume_received(struct xe_memirq *memirq, const char *source,
431+
u16 offset, const char *status)
432+
{
433+
memirq_debug(memirq, "ASSUME %s %s(%u)\n", source, status, offset);
434+
}
435+
430436
static void memirq_dispatch_engine(struct xe_memirq *memirq, struct iosys_map *status,
431437
struct xe_hw_engine *hwe)
432438
{
433439
memirq_debug(memirq, "STATUS %s %*ph\n", hwe->name, 16, status->vaddr);
434440

435-
if (memirq_received(memirq, status, ilog2(GT_MI_USER_INTERRUPT), hwe->name))
436-
xe_hw_engine_handle_irq(hwe, GT_MI_USER_INTERRUPT);
441+
/*
442+
* The programming note says to assume that GT_MI_USER_INTERRUPT is always
443+
* set. Check and clear related status byte just for a debug.
444+
*/
445+
if (IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEMIRQ) &&
446+
!memirq_received(memirq, status, ilog2(GT_MI_USER_INTERRUPT), hwe->name))
447+
memirq_assume_received(memirq, hwe->name, ilog2(GT_MI_USER_INTERRUPT), "USER");
448+
xe_hw_engine_handle_irq(hwe, GT_MI_USER_INTERRUPT);
437449
}
438450

439451
static void memirq_dispatch_guc(struct xe_memirq *memirq, struct iosys_map *status,
@@ -443,8 +455,14 @@ static void memirq_dispatch_guc(struct xe_memirq *memirq, struct iosys_map *stat
443455

444456
memirq_debug(memirq, "STATUS %s %*ph\n", name, 16, status->vaddr);
445457

446-
if (memirq_received(memirq, status, ilog2(GUC_INTR_GUC2HOST), name))
447-
xe_guc_irq_handler(guc, GUC_INTR_GUC2HOST);
458+
/*
459+
* The programming note says to assume that GUC_INTR_GUC2HOST is always
460+
* set. Check and clear related status byte just for a debug.
461+
*/
462+
if (IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEMIRQ) &&
463+
!memirq_received(memirq, status, ilog2(GUC_INTR_GUC2HOST), name))
464+
memirq_assume_received(memirq, name, ilog2(GUC_INTR_GUC2HOST), "GUC2HOST");
465+
xe_guc_irq_handler(guc, GUC_INTR_GUC2HOST);
448466

449467
/*
450468
* This is a software interrupt that must be cleared after it's consumed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,10 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
20322032
if (XE_IOCTL_DBG(oa->xe, !param.exec_q))
20332033
return -ENOENT;
20342034

2035-
if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1))
2036-
return -EOPNOTSUPP;
2035+
if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1)) {
2036+
ret = -EOPNOTSUPP;
2037+
goto err_exec_q;
2038+
}
20372039
}
20382040

20392041
/*

drivers/gpu/drm/xe/xe_tuning.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static const struct xe_rtp_entry_sr engine_tunings[] = {
129129
static const struct xe_rtp_entry_sr lrc_tunings[] = {
130130
{ XE_RTP_NAME("Tuning: Windower HW Filtering"),
131131
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(3000, 3599), ENGINE_CLASS(RENDER)),
132-
XE_RTP_ACTIONS(SET(COMMON_SLICE_CHICKEN4, HW_FILTERING))
132+
XE_RTP_ACTIONS(SET(XEHP_COMMON_SLICE_CHICKEN4, HW_FILTERING))
133133
},
134134

135135
/* DG2 */

0 commit comments

Comments
 (0)