Skip to content

Commit 3bce3cc

Browse files
committed
Merge tag 'drm-xe-fixes-2024-12-23' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
UAPI Changes: - Revert some devcoredump file format changes breaking a mesa debug tool (John) Driver Changes: - Fixes around waits when moving to system (Nirmoy) - Fix a typo when checking for LMEM provisioning (Michal) - Fix a fault on fd close after unbind (Lucas) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Z2mjt7OTfH76cgua@fedora
2 parents fc033cf + fe39b22 commit 3bce3cc

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
724724
new_mem->mem_type == XE_PL_SYSTEM) {
725725
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
726726
DMA_RESV_USAGE_BOOKKEEP,
727-
true,
727+
false,
728728
MAX_SCHEDULE_TIMEOUT);
729729
if (timeout < 0) {
730730
ret = timeout;
@@ -848,8 +848,16 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
848848

849849
out:
850850
if ((!ttm_bo->resource || ttm_bo->resource->mem_type == XE_PL_SYSTEM) &&
851-
ttm_bo->ttm)
851+
ttm_bo->ttm) {
852+
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
853+
DMA_RESV_USAGE_KERNEL,
854+
false,
855+
MAX_SCHEDULE_TIMEOUT);
856+
if (timeout < 0)
857+
ret = timeout;
858+
852859
xe_tt_unmap_sg(ttm_bo->ttm);
860+
}
853861

854862
return ret;
855863
}

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
109109
drm_puts(&p, "\n**** GuC CT ****\n");
110110
xe_guc_ct_snapshot_print(ss->guc.ct, &p);
111111

112-
drm_puts(&p, "\n**** Contexts ****\n");
112+
/*
113+
* Don't add a new section header here because the mesa debug decoder
114+
* tool expects the context information to be in the 'GuC CT' section.
115+
*/
116+
/* drm_puts(&p, "\n**** Contexts ****\n"); */
113117
xe_guc_exec_queue_snapshot_print(ss->ge, &p);
114118

115119
drm_puts(&p, "\n**** Job ****\n");
@@ -363,6 +367,15 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
363367
char buff[ASCII85_BUFSZ], *line_buff;
364368
size_t line_pos = 0;
365369

370+
/*
371+
* Splitting blobs across multiple lines is not compatible with the mesa
372+
* debug decoder tool. Note that even dropping the explicit '\n' below
373+
* doesn't help because the GuC log is so big some underlying implementation
374+
* still splits the lines at 512K characters. So just bail completely for
375+
* the moment.
376+
*/
377+
return;
378+
366379
#define DMESG_MAX_LINE_LEN 800
367380
#define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "\n\0" */
368381

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/nospec.h>
99

1010
#include <drm/drm_device.h>
11+
#include <drm/drm_drv.h>
1112
#include <drm/drm_file.h>
1213
#include <uapi/drm/xe_drm.h>
1314

@@ -762,9 +763,11 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
762763
*/
763764
void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
764765
{
766+
struct xe_device *xe = gt_to_xe(q->gt);
765767
struct xe_file *xef;
766768
struct xe_lrc *lrc;
767769
u32 old_ts, new_ts;
770+
int idx;
768771

769772
/*
770773
* Jobs that are run during driver load may use an exec_queue, but are
@@ -774,6 +777,10 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
774777
if (!q->vm || !q->vm->xef)
775778
return;
776779

780+
/* Synchronize with unbind while holding the xe file open */
781+
if (!drm_dev_enter(&xe->drm, &idx))
782+
return;
783+
777784
xef = q->vm->xef;
778785

779786
/*
@@ -787,6 +794,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
787794
lrc = q->lrc[0];
788795
new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
789796
xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
797+
798+
drm_dev_exit(idx);
790799
}
791800

792801
/**

drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ static int pf_validate_vf_config(struct xe_gt *gt, unsigned int vfid)
20462046
valid_any = valid_any || (valid_ggtt && is_primary);
20472047

20482048
if (IS_DGFX(xe)) {
2049-
bool valid_lmem = pf_get_vf_config_ggtt(primary_gt, vfid);
2049+
bool valid_lmem = pf_get_vf_config_lmem(primary_gt, vfid);
20502050

20512051
valid_any = valid_any || (valid_lmem && is_primary);
20522052
valid_all = valid_all && valid_lmem;

0 commit comments

Comments
 (0)