Skip to content

Commit f66ac60

Browse files
committed
Merge tag 'drm-xe-fixes-2025-12-19' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
UAPI Changes: - Limit num_syncs to prevent oversized kernel allocations (Shuicheng) - Disallow 0 OA property values (Ashutosh) - Disallow 0 EU stall property values (Ashutosh) Driver Changes: - Fix kobject leak (Shuicheng) - Workaround (Vinay) - Loop variable reference fix (Matt Brost) - Fix a CONFIG corner-case incorrect number of arguments (Arnd Bergmann) - Skip reason prefix while emitting array (Raag) - VF migration fix (Tomasz) - Fix context in mei interrupt top half (Junxiao) - Don't include the CCS metadata in the dma-buf sg-table (Thomas) - VF queueing recovery work fix (Satyanarayana) - Increase TDF timeout (Jagmeet) - GT reset registers vs scheduler ordering fix (Jan) - Adjust long-running workload timeslices (Matt Brost) - Always set OA_OAGLBCTXCTRL_COUNTER_RESUME (Ashutosh) - Fix a return value (Dan Carpenter) - Drop preempt-fences when destroying imported dma-bufs (Thomas) - Use usleep_range for accurate long-running workload timeslicing (Matthew) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/aUSMlQ4iruzm0NQR@fedora
2 parents 77de4a2 + 80f9c60 commit f66ac60

20 files changed

Lines changed: 76 additions & 46 deletions

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ static bool xe_ttm_bo_lock_in_destructor(struct ttm_buffer_object *ttm_bo)
15271527
* always succeed here, as long as we hold the lru lock.
15281528
*/
15291529
spin_lock(&ttm_bo->bdev->lru_lock);
1530-
locked = dma_resv_trylock(ttm_bo->base.resv);
1530+
locked = dma_resv_trylock(&ttm_bo->base._resv);
15311531
spin_unlock(&ttm_bo->bdev->lru_lock);
15321532
xe_assert(xe, locked);
15331533

@@ -1547,13 +1547,6 @@ static void xe_ttm_bo_release_notify(struct ttm_buffer_object *ttm_bo)
15471547
bo = ttm_to_xe_bo(ttm_bo);
15481548
xe_assert(xe_bo_device(bo), !(bo->created && kref_read(&ttm_bo->base.refcount)));
15491549

1550-
/*
1551-
* Corner case where TTM fails to allocate memory and this BOs resv
1552-
* still points the VMs resv
1553-
*/
1554-
if (ttm_bo->base.resv != &ttm_bo->base._resv)
1555-
return;
1556-
15571550
if (!xe_ttm_bo_lock_in_destructor(ttm_bo))
15581551
return;
15591552

@@ -1563,22 +1556,22 @@ static void xe_ttm_bo_release_notify(struct ttm_buffer_object *ttm_bo)
15631556
* TODO: Don't do this for external bos once we scrub them after
15641557
* unbind.
15651558
*/
1566-
dma_resv_for_each_fence(&cursor, ttm_bo->base.resv,
1559+
dma_resv_for_each_fence(&cursor, &ttm_bo->base._resv,
15671560
DMA_RESV_USAGE_BOOKKEEP, fence) {
15681561
if (xe_fence_is_xe_preempt(fence) &&
15691562
!dma_fence_is_signaled(fence)) {
15701563
if (!replacement)
15711564
replacement = dma_fence_get_stub();
15721565

1573-
dma_resv_replace_fences(ttm_bo->base.resv,
1566+
dma_resv_replace_fences(&ttm_bo->base._resv,
15741567
fence->context,
15751568
replacement,
15761569
DMA_RESV_USAGE_BOOKKEEP);
15771570
}
15781571
}
15791572
dma_fence_put(replacement);
15801573

1581-
dma_resv_unlock(ttm_bo->base.resv);
1574+
dma_resv_unlock(&ttm_bo->base._resv);
15821575
}
15831576

15841577
static void xe_ttm_bo_delete_mem_notify(struct ttm_buffer_object *ttm_bo)

drivers/gpu/drm/xe/xe_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ static void tdf_request_sync(struct xe_device *xe)
10561056
* transient and need to be flushed..
10571057
*/
10581058
if (xe_mmio_wait32(&gt->mmio, XE2_TDF_CTRL, TRANSIENT_FLUSH_REQUEST, 0,
1059-
150, NULL, false))
1059+
300, NULL, false))
10601060
xe_gt_err_once(gt, "TD flush timeout\n");
10611061

10621062
xe_force_wake_put(gt_to_fw(gt), fw_ref);

drivers/gpu/drm/xe/xe_dma_buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static struct sg_table *xe_dma_buf_map(struct dma_buf_attachment *attach,
124124
case XE_PL_TT:
125125
sgt = drm_prime_pages_to_sg(obj->dev,
126126
bo->ttm.ttm->pages,
127-
bo->ttm.ttm->num_pages);
127+
obj->size >> PAGE_SHIFT);
128128
if (IS_ERR(sgt))
129129
return sgt;
130130

drivers/gpu/drm/xe/xe_eu_stall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int xe_eu_stall_user_ext_set_property(struct xe_device *xe, u64 extension
315315
return -EFAULT;
316316

317317
if (XE_IOCTL_DBG(xe, ext.property >= ARRAY_SIZE(xe_set_eu_stall_property_funcs)) ||
318-
XE_IOCTL_DBG(xe, ext.pad))
318+
XE_IOCTL_DBG(xe, !ext.property) || XE_IOCTL_DBG(xe, ext.pad))
319319
return -EINVAL;
320320

321321
idx = array_index_nospec(ext.property, ARRAY_SIZE(xe_set_eu_stall_property_funcs));

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
132132

133133
if (XE_IOCTL_DBG(xe, args->extensions) ||
134134
XE_IOCTL_DBG(xe, args->pad[0] || args->pad[1] || args->pad[2]) ||
135-
XE_IOCTL_DBG(xe, args->reserved[0] || args->reserved[1]))
135+
XE_IOCTL_DBG(xe, args->reserved[0] || args->reserved[1]) ||
136+
XE_IOCTL_DBG(xe, args->num_syncs > DRM_XE_MAX_SYNCS))
136137
return -EINVAL;
137138

138139
q = xe_exec_queue_lookup(xef, args->exec_queue_id);

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,16 +797,17 @@ static int do_gt_restart(struct xe_gt *gt)
797797
xe_gt_sriov_pf_init_hw(gt);
798798

799799
xe_mocs_init(gt);
800-
err = xe_uc_start(&gt->uc);
801-
if (err)
802-
return err;
803800

804801
for_each_hw_engine(hwe, gt, id)
805802
xe_reg_sr_apply_mmio(&hwe->reg_sr, gt);
806803

807804
/* Get CCS mode in sync between sw/hw */
808805
xe_gt_apply_ccs_mode(gt);
809806

807+
err = xe_uc_start(&gt->uc);
808+
if (err)
809+
return err;
810+
810811
/* Restore GT freq to expected values */
811812
xe_gt_sanitize_freq(gt);
812813

drivers/gpu/drm/xe/xe_gt_freq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,10 @@ int xe_gt_freq_init(struct xe_gt *gt)
293293
return -ENOMEM;
294294

295295
err = sysfs_create_files(gt->freq, freq_attrs);
296-
if (err)
296+
if (err) {
297+
kobject_put(gt->freq);
297298
return err;
299+
}
298300

299301
err = devm_add_action_or_reset(xe->drm.dev, freq_fini, gt->freq);
300302
if (err)

drivers/gpu/drm/xe/xe_gt_idle.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <drm/drm_managed.h>
77

8+
#include <generated/xe_wa_oob.h>
89
#include "xe_force_wake.h"
910
#include "xe_device.h"
1011
#include "xe_gt.h"
@@ -16,6 +17,7 @@
1617
#include "xe_mmio.h"
1718
#include "xe_pm.h"
1819
#include "xe_sriov.h"
20+
#include "xe_wa.h"
1921

2022
/**
2123
* DOC: Xe GT Idle
@@ -145,6 +147,12 @@ void xe_gt_idle_enable_pg(struct xe_gt *gt)
145147
xe_mmio_write32(mmio, RENDER_POWERGATE_IDLE_HYSTERESIS, 25);
146148
}
147149

150+
if (XE_GT_WA(gt, 14020316580))
151+
gtidle->powergate_enable &= ~(VDN_HCP_POWERGATE_ENABLE(0) |
152+
VDN_MFXVDENC_POWERGATE_ENABLE(0) |
153+
VDN_HCP_POWERGATE_ENABLE(2) |
154+
VDN_MFXVDENC_POWERGATE_ENABLE(2));
155+
148156
xe_mmio_write32(mmio, POWERGATE_ENABLE, gtidle->powergate_enable);
149157
xe_force_wake_put(gt_to_fw(gt), fw_ref);
150158
}

drivers/gpu/drm/xe/xe_gt_sriov_vf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static void vf_start_migration_recovery(struct xe_gt *gt)
733733

734734
spin_lock(&gt->sriov.vf.migration.lock);
735735

736-
if (!gt->sriov.vf.migration.recovery_queued ||
736+
if (!gt->sriov.vf.migration.recovery_queued &&
737737
!gt->sriov.vf.migration.recovery_teardown) {
738738
gt->sriov.vf.migration.recovery_queued = true;
739739
WRITE_ONCE(gt->sriov.vf.migration.recovery_inprogress, true);

drivers/gpu/drm/xe/xe_gt_throttle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static ssize_t reasons_show(struct kobject *kobj,
140140
struct throttle_attribute *other_ta = kobj_attribute_to_throttle(kattr);
141141

142142
if (other_ta->mask != U32_MAX && reasons & other_ta->mask)
143-
ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name);
143+
ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name + strlen("reason_"));
144144
}
145145

146146
if (drm_WARN_ONCE(&xe->drm, !ret, "Unknown reason: %#x\n", reasons))

0 commit comments

Comments
 (0)