Skip to content

Commit 4f577be

Browse files
committed
Merge tag 'drm-xe-next-fixes-2025-06-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - A couple of vm init fixes (Matt Auld) - Hwmon fixes (Karthik) - Drop reduntant conversion to bool (Raag) - Fix CONFIG_INTEL_VSEC dependency (Arnd) - Rework eviction rejection of bound external bos (Thomas) - Stop re-submitting signalled jobs (Matt Auld) - A couple of pxp fixes (Daniele) - Add back a fix that got lost in a merge (Matt Auld) - Create LRC bo without VM (Niranjana) - Fix for the above fix (Maciej) Signed-off-by: Dave Airlie <[email protected]> From: Thomas Hellstrom <[email protected]> Link: https://lore.kernel.org/r/aEHq44uIAZwfK-mG@fedora
2 parents 27bba88 + 7c7c5cb commit 4f577be

21 files changed

+491
-186
lines changed

Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,26 @@ Description: RO. Package default power limit (default TDP setting).
6060

6161
Only supported for particular Intel Xe graphics platforms.
6262

63-
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power2_crit
64-
Date: February 2024
65-
KernelVersion: 6.8
63+
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_crit
64+
Date: May 2025
65+
KernelVersion: 6.15
6666
67-
Description: RW. Package reactive critical (I1) power limit in microwatts.
67+
Description: RW. Card reactive critical (I1) power limit in microwatts.
6868

69-
Package reactive critical (I1) power limit in microwatts is exposed
69+
Card reactive critical (I1) power limit in microwatts is exposed
7070
for client products. The power controller will throttle the
7171
operating frequency if the power averaged over a window exceeds
7272
this limit.
7373

7474
Only supported for particular Intel Xe graphics platforms.
7575

76-
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/curr2_crit
77-
Date: February 2024
78-
KernelVersion: 6.8
76+
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/curr1_crit
77+
Date: May 2025
78+
KernelVersion: 6.15
7979
80-
Description: RW. Package reactive critical (I1) power limit in milliamperes.
80+
Description: RW. Card reactive critical (I1) power limit in milliamperes.
8181

82-
Package reactive critical (I1) power limit in milliamperes is
82+
Card reactive critical (I1) power limit in milliamperes is
8383
exposed for server products. The power controller will throttle
8484
the operating frequency if the power averaged over a window
8585
exceeds this limit.

drivers/gpu/drm/xe/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
config DRM_XE
33
tristate "Intel Xe Graphics"
44
depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
5+
depends on INTEL_VSEC || !INTEL_VSEC
6+
depends on X86_PLATFORM_DEVICES || !(X86 && ACPI)
57
select INTERVAL_TREE
68
# we need shmfs for the swappable backing store, and in particular
79
# the shmem_readpage() which depends upon tmpfs
@@ -27,7 +29,6 @@ config DRM_XE
2729
select BACKLIGHT_CLASS_DEVICE if ACPI
2830
select INPUT if ACPI
2931
select ACPI_VIDEO if X86 && ACPI
30-
select X86_PLATFORM_DEVICES if X86 && ACPI
3132
select ACPI_WMI if X86 && ACPI
3233
select SYNC_FILE
3334
select IOSF_MBI

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
#define TEMP_MASK REG_GENMASK(7, 0)
3939

4040
#define PCU_CR_PACKAGE_RAPL_LIMIT XE_REG(MCHBAR_MIRROR_BASE_SNB + 0x59a0)
41-
#define PKG_PWR_LIM_1 REG_GENMASK(14, 0)
42-
#define PKG_PWR_LIM_1_EN REG_BIT(15)
43-
#define PKG_PWR_LIM_1_TIME REG_GENMASK(23, 17)
44-
#define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23, 22)
45-
#define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21, 17)
41+
#define PWR_LIM_VAL REG_GENMASK(14, 0)
42+
#define PWR_LIM_EN REG_BIT(15)
43+
#define PWR_LIM_TIME REG_GENMASK(23, 17)
44+
#define PWR_LIM_TIME_X REG_GENMASK(23, 22)
45+
#define PWR_LIM_TIME_Y REG_GENMASK(21, 17)
4646

4747
#endif /* _XE_MCHBAR_REGS_H_ */

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818
#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
1919
#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
2020

21-
#define BMG_PACKAGE_POWER_SKU XE_REG(0x138098)
22-
#define BMG_PACKAGE_POWER_SKU_UNIT XE_REG(0x1380dc)
2321
#define BMG_PACKAGE_ENERGY_STATUS XE_REG(0x138120)
2422
#define BMG_FAN_1_SPEED XE_REG(0x138140)
2523
#define BMG_FAN_2_SPEED XE_REG(0x138170)
2624
#define BMG_FAN_3_SPEED XE_REG(0x1381a0)
2725
#define BMG_VRAM_TEMPERATURE XE_REG(0x1382c0)
2826
#define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434)
29-
#define BMG_PACKAGE_RAPL_LIMIT XE_REG(0x138440)
3027
#define BMG_PLATFORM_ENERGY_STATUS XE_REG(0x138458)
31-
#define BMG_PLATFORM_POWER_LIMIT XE_REG(0x138460)
3228

3329
#endif /* _XE_PCODE_REGS_H_ */

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -841,21 +841,6 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
841841
goto out;
842842
}
843843

844-
/* Reject BO eviction if BO is bound to current VM. */
845-
if (evict && ctx->resv) {
846-
struct drm_gpuvm_bo *vm_bo;
847-
848-
drm_gem_for_each_gpuvm_bo(vm_bo, &bo->ttm.base) {
849-
struct xe_vm *vm = gpuvm_to_vm(vm_bo->vm);
850-
851-
if (xe_vm_resv(vm) == ctx->resv &&
852-
xe_vm_in_preempt_fence_mode(vm)) {
853-
ret = -EBUSY;
854-
goto out;
855-
}
856-
}
857-
}
858-
859844
/*
860845
* Failed multi-hop where the old_mem is still marked as
861846
* TTM_PL_FLAG_TEMPORARY, should just be a dummy move.
@@ -1013,6 +998,25 @@ static long xe_bo_shrink_purge(struct ttm_operation_ctx *ctx,
1013998
return lret;
1014999
}
10151000

1001+
static bool
1002+
xe_bo_eviction_valuable(struct ttm_buffer_object *bo, const struct ttm_place *place)
1003+
{
1004+
struct drm_gpuvm_bo *vm_bo;
1005+
1006+
if (!ttm_bo_eviction_valuable(bo, place))
1007+
return false;
1008+
1009+
if (!xe_bo_is_xe_bo(bo))
1010+
return true;
1011+
1012+
drm_gem_for_each_gpuvm_bo(vm_bo, &bo->base) {
1013+
if (xe_vm_is_validating(gpuvm_to_vm(vm_bo->vm)))
1014+
return false;
1015+
}
1016+
1017+
return true;
1018+
}
1019+
10161020
/**
10171021
* xe_bo_shrink() - Try to shrink an xe bo.
10181022
* @ctx: The struct ttm_operation_ctx used for shrinking.
@@ -1047,7 +1051,7 @@ long xe_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo,
10471051
(flags.purge && !xe_tt->purgeable))
10481052
return -EBUSY;
10491053

1050-
if (!ttm_bo_eviction_valuable(bo, &place))
1054+
if (!xe_bo_eviction_valuable(bo, &place))
10511055
return -EBUSY;
10521056

10531057
if (!xe_bo_is_xe_bo(bo) || !xe_bo_get_unless_zero(xe_bo))
@@ -1588,7 +1592,7 @@ const struct ttm_device_funcs xe_ttm_funcs = {
15881592
.io_mem_pfn = xe_ttm_io_mem_pfn,
15891593
.access_memory = xe_ttm_access_memory,
15901594
.release_notify = xe_ttm_bo_release_notify,
1591-
.eviction_valuable = ttm_bo_eviction_valuable,
1595+
.eviction_valuable = xe_bo_eviction_valuable,
15921596
.delete_mem_notify = xe_ttm_bo_delete_mem_notify,
15931597
.swap_notify = xe_ttm_bo_swap_notify,
15941598
};
@@ -2431,6 +2435,8 @@ int xe_bo_validate(struct xe_bo *bo, struct xe_vm *vm, bool allow_res_evict)
24312435
.no_wait_gpu = false,
24322436
.gfp_retry_mayfail = true,
24332437
};
2438+
struct pin_cookie cookie;
2439+
int ret;
24342440

24352441
if (vm) {
24362442
lockdep_assert_held(&vm->lock);
@@ -2440,8 +2446,12 @@ int xe_bo_validate(struct xe_bo *bo, struct xe_vm *vm, bool allow_res_evict)
24402446
ctx.resv = xe_vm_resv(vm);
24412447
}
24422448

2449+
cookie = xe_vm_set_validating(vm, allow_res_evict);
24432450
trace_xe_bo_validate(bo);
2444-
return ttm_bo_validate(&bo->ttm, &bo->placement, &ctx);
2451+
ret = ttm_bo_validate(&bo->ttm, &bo->placement, &ctx);
2452+
xe_vm_clear_validating(vm, allow_res_evict, cookie);
2453+
2454+
return ret;
24452455
}
24462456

24472457
bool xe_bo_is_xe_bo(struct ttm_buffer_object *bo)
@@ -2557,7 +2567,7 @@ typedef int (*xe_gem_create_set_property_fn)(struct xe_device *xe,
25572567
u64 value);
25582568

25592569
static const xe_gem_create_set_property_fn gem_create_set_property_funcs[] = {
2560-
[DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY] = gem_create_set_pxp_type,
2570+
[DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE] = gem_create_set_pxp_type,
25612571
};
25622572

25632573
static int gem_create_user_ext_set_property(struct xe_device *xe,

drivers/gpu/drm/xe/xe_device_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ auto_link_downgrade_capable_show(struct device *dev, struct device_attribute *at
115115
xe_pm_runtime_put(xe);
116116

117117
cap = REG_FIELD_GET(LINK_DOWNGRADE, val);
118-
return sysfs_emit(buf, "%u\n", cap == DOWNGRADE_CAPABLE ? true : false);
118+
return sysfs_emit(buf, "%u\n", cap == DOWNGRADE_CAPABLE);
119119
}
120120
static DEVICE_ATTR_ADMIN_RO(auto_link_downgrade_capable);
121121

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ struct xe_device {
325325
u8 has_heci_gscfi:1;
326326
/** @info.has_llc: Device has a shared CPU+GPU last level cache */
327327
u8 has_llc:1;
328+
/** @info.has_mbx_power_limits: Device has support to manage power limits using
329+
* pcode mailbox commands.
330+
*/
331+
u8 has_mbx_power_limits:1;
328332
/** @info.has_pxp: Device has PXP support */
329333
u8 has_pxp:1;
330334
/** @info.has_range_tlb_invalidation: Has range based TLB invalidations */

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
114114

115115
static int __xe_exec_queue_init(struct xe_exec_queue *q)
116116
{
117-
struct xe_vm *vm = q->vm;
118117
int i, err;
119118
u32 flags = 0;
120119

@@ -132,32 +131,20 @@ static int __xe_exec_queue_init(struct xe_exec_queue *q)
132131
flags |= XE_LRC_CREATE_RUNALONE;
133132
}
134133

135-
if (vm) {
136-
err = xe_vm_lock(vm, true);
137-
if (err)
138-
return err;
139-
}
140-
141134
for (i = 0; i < q->width; ++i) {
142135
q->lrc[i] = xe_lrc_create(q->hwe, q->vm, SZ_16K, q->msix_vec, flags);
143136
if (IS_ERR(q->lrc[i])) {
144137
err = PTR_ERR(q->lrc[i]);
145-
goto err_unlock;
138+
goto err_lrc;
146139
}
147140
}
148141

149-
if (vm)
150-
xe_vm_unlock(vm);
151-
152142
err = q->ops->init(q);
153143
if (err)
154144
goto err_lrc;
155145

156146
return 0;
157147

158-
err_unlock:
159-
if (vm)
160-
xe_vm_unlock(vm);
161148
err_lrc:
162149
for (i = i - 1; i >= 0; --i)
163150
xe_lrc_put(q->lrc[i]);

drivers/gpu/drm/xe/xe_gpu_scheduler.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ static inline void xe_sched_tdr_queue_imm(struct xe_gpu_scheduler *sched)
5151

5252
static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched)
5353
{
54-
drm_sched_resubmit_jobs(&sched->base);
54+
struct drm_sched_job *s_job;
55+
56+
list_for_each_entry(s_job, &sched->base.pending_list, list) {
57+
struct drm_sched_fence *s_fence = s_job->s_fence;
58+
struct dma_fence *hw_fence = s_fence->parent;
59+
60+
if (hw_fence && !dma_fence_is_signaled(hw_fence))
61+
sched->base.ops->run_job(s_job);
62+
}
5563
}
5664

5765
static inline bool

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q)
229229
static void guc_submit_fini(struct drm_device *drm, void *arg)
230230
{
231231
struct xe_guc *guc = arg;
232+
struct xe_device *xe = guc_to_xe(guc);
233+
struct xe_gt *gt = guc_to_gt(guc);
234+
int ret;
235+
236+
ret = wait_event_timeout(guc->submission_state.fini_wq,
237+
xa_empty(&guc->submission_state.exec_queue_lookup),
238+
HZ * 5);
239+
240+
drain_workqueue(xe->destroy_wq);
241+
242+
xe_gt_assert(gt, ret);
232243

233244
xa_destroy(&guc->submission_state.exec_queue_lookup);
234245
}

0 commit comments

Comments
 (0)