Skip to content

Commit 190eaa4

Browse files
committed
Merge tag 'drm-xe-fixes-2026-01-29' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Skip address copy for sync-only execs (Lin) - Fix a WA (Tvrtko) - Derive mem_copy cap from graphics version (Nitin) - Fix is_bound() pci_dev lifetime (Lin) - xe nvm cleanup fixes (Lin) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/aXu_JzBFb9YVFYW1@fedora
2 parents 2243afc + 8a44241 commit 190eaa4

8 files changed

Lines changed: 33 additions & 44 deletions

File tree

drivers/gpu/drm/xe/xe_configfs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,10 @@ static bool is_bound(struct xe_config_group_device *dev)
347347
return false;
348348

349349
ret = pci_get_drvdata(pdev);
350-
pci_dev_put(pdev);
351-
352350
if (ret)
353351
pci_dbg(pdev, "Already bound to driver\n");
354352

353+
pci_dev_put(pdev);
355354
return ret;
356355
}
357356

drivers/gpu/drm/xe/xe_device.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,6 @@ void xe_device_remove(struct xe_device *xe)
984984
{
985985
xe_display_unregister(xe);
986986

987-
xe_nvm_fini(xe);
988-
989987
drm_dev_unplug(&xe->drm);
990988

991989
xe_bo_pci_dev_remove_all(xe);

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
190190
goto err_syncs;
191191
}
192192

193-
if (xe_exec_queue_is_parallel(q)) {
194-
err = copy_from_user(addresses, addresses_user, sizeof(u64) *
195-
q->width);
193+
if (args->num_batch_buffer && xe_exec_queue_is_parallel(q)) {
194+
err = copy_from_user(addresses, addresses_user,
195+
sizeof(u64) * q->width);
196196
if (err) {
197197
err = -EFAULT;
198198
goto err_syncs;

drivers/gpu/drm/xe/xe_lrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc,
11851185
return -ENOSPC;
11861186

11871187
*cmd++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
1188-
*cmd++ = CS_DEBUG_MODE1(0).addr;
1188+
*cmd++ = CS_DEBUG_MODE2(0).addr;
11891189
*cmd++ = _MASKED_BIT_ENABLE(INSTRUCTION_STATE_CACHE_INVALIDATE);
11901190

11911191
return cmd - batch;

drivers/gpu/drm/xe/xe_nvm.c

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ static bool xe_nvm_writable_override(struct xe_device *xe)
8383
return writable_override;
8484
}
8585

86+
static void xe_nvm_fini(void *arg)
87+
{
88+
struct xe_device *xe = arg;
89+
struct intel_dg_nvm_dev *nvm = xe->nvm;
90+
91+
if (!xe->info.has_gsc_nvm)
92+
return;
93+
94+
/* No access to internal NVM from VFs */
95+
if (IS_SRIOV_VF(xe))
96+
return;
97+
98+
/* Nvm pointer should not be NULL here */
99+
if (WARN_ON(!nvm))
100+
return;
101+
102+
auxiliary_device_delete(&nvm->aux_dev);
103+
auxiliary_device_uninit(&nvm->aux_dev);
104+
xe->nvm = NULL;
105+
}
106+
86107
int xe_nvm_init(struct xe_device *xe)
87108
{
88109
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
@@ -132,39 +153,17 @@ int xe_nvm_init(struct xe_device *xe)
132153
ret = auxiliary_device_init(aux_dev);
133154
if (ret) {
134155
drm_err(&xe->drm, "xe-nvm aux init failed %d\n", ret);
135-
goto err;
156+
kfree(nvm);
157+
xe->nvm = NULL;
158+
return ret;
136159
}
137160

138161
ret = auxiliary_device_add(aux_dev);
139162
if (ret) {
140163
drm_err(&xe->drm, "xe-nvm aux add failed %d\n", ret);
141164
auxiliary_device_uninit(aux_dev);
142-
goto err;
165+
xe->nvm = NULL;
166+
return ret;
143167
}
144-
return 0;
145-
146-
err:
147-
kfree(nvm);
148-
xe->nvm = NULL;
149-
return ret;
150-
}
151-
152-
void xe_nvm_fini(struct xe_device *xe)
153-
{
154-
struct intel_dg_nvm_dev *nvm = xe->nvm;
155-
156-
if (!xe->info.has_gsc_nvm)
157-
return;
158-
159-
/* No access to internal NVM from VFs */
160-
if (IS_SRIOV_VF(xe))
161-
return;
162-
163-
/* Nvm pointer should not be NULL here */
164-
if (WARN_ON(!nvm))
165-
return;
166-
167-
auxiliary_device_delete(&nvm->aux_dev);
168-
auxiliary_device_uninit(&nvm->aux_dev);
169-
xe->nvm = NULL;
168+
return devm_add_action_or_reset(xe->drm.dev, xe_nvm_fini, xe);
170169
}

drivers/gpu/drm/xe/xe_nvm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ struct xe_device;
1010

1111
int xe_nvm_init(struct xe_device *xe);
1212

13-
void xe_nvm_fini(struct xe_device *xe);
14-
1513
#endif

drivers/gpu/drm/xe/xe_pci.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ static const struct xe_device_desc lnl_desc = {
342342
.has_display = true,
343343
.has_flat_ccs = 1,
344344
.has_pxp = true,
345-
.has_mem_copy_instr = true,
346345
.max_gt_per_tile = 2,
347346
.needs_scratch = true,
348347
.va_bits = 48,
@@ -363,7 +362,6 @@ static const struct xe_device_desc bmg_desc = {
363362
.has_heci_cscfi = 1,
364363
.has_late_bind = true,
365364
.has_sriov = true,
366-
.has_mem_copy_instr = true,
367365
.max_gt_per_tile = 2,
368366
.needs_scratch = true,
369367
.subplatforms = (const struct xe_subplatform_desc[]) {
@@ -380,7 +378,6 @@ static const struct xe_device_desc ptl_desc = {
380378
.has_display = true,
381379
.has_flat_ccs = 1,
382380
.has_sriov = true,
383-
.has_mem_copy_instr = true,
384381
.max_gt_per_tile = 2,
385382
.needs_scratch = true,
386383
.needs_shared_vf_gt_wq = true,
@@ -393,7 +390,6 @@ static const struct xe_device_desc nvls_desc = {
393390
.dma_mask_size = 46,
394391
.has_display = true,
395392
.has_flat_ccs = 1,
396-
.has_mem_copy_instr = true,
397393
.max_gt_per_tile = 2,
398394
.require_force_probe = true,
399395
.va_bits = 48,
@@ -675,7 +671,6 @@ static int xe_info_init_early(struct xe_device *xe,
675671
xe->info.has_pxp = desc->has_pxp;
676672
xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
677673
desc->has_sriov;
678-
xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
679674
xe->info.skip_guc_pc = desc->skip_guc_pc;
680675
xe->info.skip_mtcfg = desc->skip_mtcfg;
681676
xe->info.skip_pcode = desc->skip_pcode;
@@ -864,6 +859,7 @@ static int xe_info_init(struct xe_device *xe,
864859
xe->info.has_range_tlb_inval = graphics_desc->has_range_tlb_inval;
865860
xe->info.has_usm = graphics_desc->has_usm;
866861
xe->info.has_64bit_timestamp = graphics_desc->has_64bit_timestamp;
862+
xe->info.has_mem_copy_instr = GRAPHICS_VER(xe) >= 20;
867863

868864
xe_info_probe_tile_count(xe);
869865

drivers/gpu/drm/xe/xe_pci_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct xe_device_desc {
4646
u8 has_late_bind:1;
4747
u8 has_llc:1;
4848
u8 has_mbx_power_limits:1;
49-
u8 has_mem_copy_instr:1;
5049
u8 has_pxp:1;
5150
u8 has_sriov:1;
5251
u8 needs_scratch:1;

0 commit comments

Comments
 (0)