Skip to content

Commit 9794b89

Browse files
committed
Merge tag 'drm-xe-next-fixes-2024-11-28' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - Update xe2 graphics name string (Matt Roper) - Fix a couple of guc submit races (Matt Auld) - Fix pat index usage in migrate (Matt Auld) - Ensure non-cached migrate pagetable bo mappings (Matt Auld) - Take a PM ref in the delayed snapshot capture worker (Matt Brost) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Z0iOjKwEGVo_DmgY@fedora
2 parents c54fdcc + aef0b4a commit 9794b89

File tree

4 files changed

+36
-12
lines changed

4 files changed

+36
-12
lines changed

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "xe_guc_submit.h"
2424
#include "xe_hw_engine.h"
2525
#include "xe_module.h"
26+
#include "xe_pm.h"
2627
#include "xe_sched_job.h"
2728
#include "xe_vm.h"
2829

@@ -158,8 +159,11 @@ static void xe_devcoredump_deferred_snap_work(struct work_struct *work)
158159
{
159160
struct xe_devcoredump_snapshot *ss = container_of(work, typeof(*ss), work);
160161
struct xe_devcoredump *coredump = container_of(ss, typeof(*coredump), snapshot);
162+
struct xe_device *xe = coredump_to_xe(coredump);
161163
unsigned int fw_ref;
162164

165+
xe_pm_runtime_get(xe);
166+
163167
/* keep going if fw fails as we still want to save the memory and SW data */
164168
fw_ref = xe_force_wake_get(gt_to_fw(ss->gt), XE_FORCEWAKE_ALL);
165169
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL))
@@ -168,6 +172,8 @@ static void xe_devcoredump_deferred_snap_work(struct work_struct *work)
168172
xe_guc_exec_queue_snapshot_capture_delayed(ss->ge);
169173
xe_force_wake_put(gt_to_fw(ss->gt), fw_ref);
170174

175+
xe_pm_runtime_put(xe);
176+
171177
/* Calculate devcoredump size */
172178
ss->read.size = __xe_devcoredump_read(NULL, INT_MAX, coredump);
173179

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -769,17 +769,19 @@ static void disable_scheduling_deregister(struct xe_guc *guc,
769769
struct xe_exec_queue *q)
770770
{
771771
MAKE_SCHED_CONTEXT_ACTION(q, DISABLE);
772-
struct xe_device *xe = guc_to_xe(guc);
773772
int ret;
774773

775774
set_min_preemption_timeout(guc, q);
776775
smp_rmb();
777-
ret = wait_event_timeout(guc->ct.wq, !exec_queue_pending_enable(q) ||
778-
xe_guc_read_stopped(guc), HZ * 5);
776+
ret = wait_event_timeout(guc->ct.wq,
777+
(!exec_queue_pending_enable(q) &&
778+
!exec_queue_pending_disable(q)) ||
779+
xe_guc_read_stopped(guc),
780+
HZ * 5);
779781
if (!ret) {
780782
struct xe_gpu_scheduler *sched = &q->guc->sched;
781783

782-
drm_warn(&xe->drm, "Pending enable failed to respond");
784+
xe_gt_warn(q->gt, "Pending enable/disable failed to respond\n");
783785
xe_sched_submission_start(sched);
784786
xe_gt_reset_async(q->gt);
785787
xe_sched_tdr_queue_imm(sched);
@@ -1101,7 +1103,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
11011103
* modifying state
11021104
*/
11031105
ret = wait_event_timeout(guc->ct.wq,
1104-
!exec_queue_pending_enable(q) ||
1106+
(!exec_queue_pending_enable(q) &&
1107+
!exec_queue_pending_disable(q)) ||
11051108
xe_guc_read_stopped(guc), HZ * 5);
11061109
if (!ret || xe_guc_read_stopped(guc))
11071110
goto trigger_reset;
@@ -1330,8 +1333,8 @@ static void __guc_exec_queue_process_msg_suspend(struct xe_sched_msg *msg)
13301333

13311334
if (guc_exec_queue_allowed_to_change_state(q) && !exec_queue_suspended(q) &&
13321335
exec_queue_enabled(q)) {
1333-
wait_event(guc->ct.wq, q->guc->resume_time != RESUME_PENDING ||
1334-
xe_guc_read_stopped(guc));
1336+
wait_event(guc->ct.wq, (q->guc->resume_time != RESUME_PENDING ||
1337+
xe_guc_read_stopped(guc)) && !exec_queue_pending_disable(q));
13351338

13361339
if (!xe_guc_read_stopped(guc)) {
13371340
s64 since_resume_ms =
@@ -1868,16 +1871,29 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
18681871
xe_gt_assert(guc_to_gt(guc), runnable_state == 0);
18691872
xe_gt_assert(guc_to_gt(guc), exec_queue_pending_disable(q));
18701873

1871-
clear_exec_queue_pending_disable(q);
18721874
if (q->guc->suspend_pending) {
18731875
suspend_fence_signal(q);
1876+
clear_exec_queue_pending_disable(q);
18741877
} else {
18751878
if (exec_queue_banned(q) || check_timeout) {
18761879
smp_wmb();
18771880
wake_up_all(&guc->ct.wq);
18781881
}
1879-
if (!check_timeout)
1882+
if (!check_timeout && exec_queue_destroyed(q)) {
1883+
/*
1884+
* Make sure to clear the pending_disable only
1885+
* after sampling the destroyed state. We want
1886+
* to ensure we don't trigger the unregister too
1887+
* early with something intending to only
1888+
* disable scheduling. The caller doing the
1889+
* destroy must wait for an ongoing
1890+
* pending_disable before marking as destroyed.
1891+
*/
1892+
clear_exec_queue_pending_disable(q);
18801893
deregister_exec_queue(guc, q);
1894+
} else {
1895+
clear_exec_queue_pending_disable(q);
1896+
}
18811897
}
18821898
}
18831899
}

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
209209
num_entries * XE_PAGE_SIZE,
210210
ttm_bo_type_kernel,
211211
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
212-
XE_BO_FLAG_PINNED);
212+
XE_BO_FLAG_PINNED |
213+
XE_BO_FLAG_PAGETABLE);
213214
if (IS_ERR(bo))
214215
return PTR_ERR(bo);
215216

@@ -1350,6 +1351,7 @@ __xe_migrate_update_pgtables(struct xe_migrate *m,
13501351

13511352
/* For sysmem PTE's, need to map them in our hole.. */
13521353
if (!IS_DGFX(xe)) {
1354+
u16 pat_index = xe->pat.idx[XE_CACHE_WB];
13531355
u32 ptes, ofs;
13541356

13551357
ppgtt_ofs = NUM_KERNEL_PDE - 1;
@@ -1409,7 +1411,7 @@ __xe_migrate_update_pgtables(struct xe_migrate *m,
14091411
pt_bo->update_index = current_update;
14101412

14111413
addr = vm->pt_ops->pte_encode_bo(pt_bo, 0,
1412-
XE_CACHE_WB, 0);
1414+
pat_index, 0);
14131415
bb->cs[bb->len++] = lower_32_bits(addr);
14141416
bb->cs[bb->len++] = upper_32_bits(addr);
14151417
}

drivers/gpu/drm/xe/xe_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static const struct xe_graphics_desc graphics_xelpg = {
174174
GENMASK(XE_HW_ENGINE_CCS3, XE_HW_ENGINE_CCS0)
175175

176176
static const struct xe_graphics_desc graphics_xe2 = {
177-
.name = "Xe2_LPG / Xe2_HPG",
177+
.name = "Xe2_LPG / Xe2_HPG / Xe3_LPG",
178178

179179
XE2_GFX_FEATURES,
180180
};

0 commit comments

Comments
 (0)