Skip to content

Commit 7d6ca51

Browse files
committed
Merge tag 'drm-fixes-2026-07-18-1' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Daie Airlie: "Weekly drm fixes, there is amdgpu, xe and i915 and then a lot of scattered fixes. Looks about the right level for the new right. ttm: - Handle NULL pages and backup handles in ttm_pool_backup() correctly gpusvm: - Improve unmap and error handling on gpusvm udmabuf: - Always synchronize for CPU in begin_cpu_udmabuf xe: - Fix BO prefetch with CONSULT_MEM_ADVISE_PREF_LOCK - Hold a dma-buf reference for imported BOs - Fix writable override for CRI - Fix VF CCS attach/detach race with in-flight BO moves - Fix WOPCM size for LNL+ - Reset current_op in xe_pt_update_ops_init - Keep scheduler timeline name alive - Hold device ref until queue teardown completes - Disable display in admin only PF mode i915: - NV12 display fix for bigjoiner - clear watermark on plane disable - GT selftest fixes host1x: - Fix UAF amdxdna - Fix UAF - Reject more invalid amdxdna command submissions ivpu: - Fix wrong read - Handle invalid firmware log in ivpu panthor: - Fix error handling virtio: - Fix virtio deadlock - Fix invalid gem detach amdgpu: - DCN 4.2 fixes - NUTMEG fixes - 8K panel fix - Backlight fixes - UserQ fix - Fix bo->pin leaking in amdgpu_bo_create_reserved() - VFCT fixes - devcoredump fixes - Display fixes - SMU7 DPM fix - AC/DC fixes for SMU7 and SI - Queue reset fix - PCIe DPM fix - XHCI/GPU resume ordering fix - Pageflip timeout fix amdkfd: - Fix potential overflow in CWSR size calculation - DQM error clean up fixes * tag 'drm-fixes-2026-07-18-1' of https://gitlab.freedesktop.org/drm/kernel: (61 commits) Revert "drm/amd/display: Restore 5s vbl offdelay for NV3x+ DGPUs" drm/amd/display: check GRPH_FLIP status before sending event drm/amd/display: consolidate DCN vblank/flip handling onto vupdate_no_lock drm/amd: Create a device link between APU display and XHCI devices drm/amd/display: wire DCN42B mcache programming callback drm/amd/display: set new_stream to NULL after release drm/amd/display: Force PWM backlight on Lenovo Legion 5 15ARH05 drm/amdkfd: free MQD managers on DQM init failures drm/amdgpu/ttm: Consider concurrent VM flushes for buffer entities drm/amd/pm/smu7: Fix AC/DC switch notification drm/amdgpu: Disable PCIe dynamic speed switching on Ryzen Pinnacle Ridge drm/amdgpu: always emit the job vm fence drm/amd/pm/si: Fix AC/DC switch notification drm/amd/pm/si: Don't schedule thermal work when queue isn't initialized drm/amd/display: dce100: skip non-DP stream encoders for DP MST drm/amd/display: Set native cursor mode for disabled CRTCs drm/amd/pm/ci: Don't disable MCLK DPM on Bonaire 0x6658 (R7 260X) drm/amd/display: fix __udivdi3 link error drm/amdgpu: Reserve space for IB contents in devcoredumps drm/amdgpu: Print vmid, pasid and more task info in devcoredump ...
2 parents 94515f3 + 973fd94 commit 7d6ca51

67 files changed

Lines changed: 1076 additions & 564 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/accel/amdxdna/amdxdna_ctx.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job)
577577
amdxdna_arg_bos_put(job);
578578
amdxdna_gem_put_obj(job->cmd_bo);
579579
dma_fence_put(job->fence);
580+
mmdrop(job->mm);
580581
}
581582

582583
int amdxdna_cmd_submit(struct amdxdna_client *client,
@@ -590,6 +591,10 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
590591
int ret, idx;
591592

592593
XDNA_DBG(xdna, "Command BO hdl %d, Arg BO count %d", cmd_bo_hdl, arg_bo_cnt);
594+
595+
if (!xdna->dev_info->ops->cmd_submit)
596+
return -EOPNOTSUPP;
597+
593598
job = kzalloc_flex(*job, bos, arg_bo_cnt);
594599
if (!job)
595600
return -ENOMEM;
@@ -603,6 +608,16 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
603608
ret = -EINVAL;
604609
goto free_job;
605610
}
611+
} else if (!drv_cmd) {
612+
/*
613+
* Only internal driver commands (drv_cmd != NULL) may omit a
614+
* command BO. A user command submission with the invalid handle
615+
* would leave job->cmd_bo NULL and later fault when the scheduler
616+
* dereferences it in amdxdna_cmd_set_state().
617+
*/
618+
XDNA_DBG(xdna, "Command BO handle required for user submission");
619+
ret = -EINVAL;
620+
goto free_job;
606621
}
607622

608623
ret = amdxdna_arg_bos_lookup(client, job, arg_bo_hdls, arg_bo_cnt);
@@ -628,6 +643,7 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
628643

629644
job->hwctx = hwctx;
630645
job->mm = current->mm;
646+
mmgrab(job->mm);
631647

632648
job->fence = amdxdna_fence_create(hwctx);
633649
if (!job->fence) {
@@ -662,6 +678,8 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
662678
cmd_put:
663679
amdxdna_gem_put_obj(job->cmd_bo);
664680
free_job:
681+
if (job->mm)
682+
mmdrop(job->mm);
665683
kfree(job);
666684
return ret;
667685
}

drivers/accel/ivpu/ivpu_fw_log.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ static int fw_log_from_bo(struct ivpu_device *vdev, struct ivpu_bo *bo, u32 *off
4343
ivpu_dbg(vdev, FW_BOOT, "Invalid header size 0x%x\n", log->header_size);
4444
return -EINVAL;
4545
}
46+
if (log->size < log->header_size) {
47+
ivpu_dbg(vdev, FW_BOOT, "Invalid log size 0x%x\n", log->size);
48+
return -EINVAL;
49+
}
4650
if ((char *)log + log->size > (char *)ivpu_bo_vaddr(bo) + ivpu_bo_size(bo)) {
4751
ivpu_dbg(vdev, FW_BOOT, "Invalid log size 0x%x\n", log->size);
4852
return -EINVAL;

drivers/accel/ivpu/ivpu_hw_btrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ static void diagnose_failure_mtl(struct ivpu_device *vdev)
927927

928928
static void diagnose_failure_lnl(struct ivpu_device *vdev)
929929
{
930-
u32 reg = REGB_RD32(VPU_HW_BTRS_MTL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
930+
u32 reg = REGB_RD32(VPU_HW_BTRS_LNL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
931931

932932
if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, ATS_ERR, reg)) {
933933
ivpu_err(vdev, "ATS_ERR_LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",

drivers/dma-buf/udmabuf.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,21 +224,22 @@ static int begin_cpu_udmabuf(struct dma_buf *buf,
224224
{
225225
struct udmabuf *ubuf = buf->priv;
226226
struct device *dev = ubuf->device->this_device;
227-
int ret = 0;
228227

229228
if (!ubuf->sg) {
230229
ubuf->sg = get_sg_table(dev, buf, direction);
231230
if (IS_ERR(ubuf->sg)) {
231+
int ret;
232+
232233
ret = PTR_ERR(ubuf->sg);
233234
ubuf->sg = NULL;
235+
return ret;
234236
} else {
235237
ubuf->sg_dir = direction;
236238
}
237-
} else {
238-
dma_sync_sgtable_for_cpu(dev, ubuf->sg, direction);
239239
}
240240

241-
return ret;
241+
dma_sync_sgtable_for_cpu(dev, ubuf->sg, direction);
242+
return 0;
242243
}
243244

244245
static int end_cpu_udmabuf(struct dma_buf *buf,

drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,59 @@ static bool amdgpu_read_disabled_bios(struct amdgpu_device *adev)
372372
}
373373

374374
#ifdef CONFIG_ACPI
375+
/**
376+
* amdgpu_acpi_vfct_match() - Check if a VFCT entry matches the device
377+
* @adev: AMDGPU device
378+
* @vhdr: VFCT image header to check
379+
*
380+
* VFCT entries contain the PCI bus number as recorded during BIOS POST.
381+
* On systems where the kernel renumbers PCI buses (e.g. pci=realloc or
382+
* resource conflicts), the runtime bus number may differ from the POST
383+
* value. Match by device identity (vendor + device + function) and use
384+
* the bus number as a preference: exact bus match is preferred, but when
385+
* the bus numbers disagree we accept the entry if the device identity
386+
* matches.
387+
*
388+
* Returns: 0 on match, -ENODEV on no match
389+
*/
390+
static int amdgpu_acpi_vfct_match(struct amdgpu_device *adev,
391+
VFCT_IMAGE_HEADER *vhdr)
392+
{
393+
/* Vendor and device IDs must always match */
394+
if (vhdr->VendorID != adev->pdev->vendor ||
395+
vhdr->DeviceID != adev->pdev->device)
396+
return -ENODEV;
397+
398+
if (vhdr->PCIDevice != PCI_SLOT(adev->pdev->devfn) ||
399+
vhdr->PCIFunction != PCI_FUNC(adev->pdev->devfn))
400+
return -ENODEV;
401+
402+
/* Exact bus number match - preferred */
403+
if (vhdr->PCIBus == adev->pdev->bus->number)
404+
return 0;
405+
406+
/* Bus mismatch but device identity matches (PCI renumbering case) */
407+
dev_notice(adev->dev,
408+
"VFCT bus number mismatch: table %u != runtime %u, matching by device identity (vendor 0x%04x device 0x%04x)\n",
409+
vhdr->PCIBus, adev->pdev->bus->number,
410+
adev->pdev->vendor, adev->pdev->device);
411+
return 0;
412+
}
413+
375414
static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
376415
{
377416
struct acpi_table_header *hdr;
378417
acpi_size tbl_size;
379418
UEFI_ACPI_VFCT *vfct;
380419
unsigned int offset;
420+
bool r = false;
381421

382422
if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
383423
return false;
384424
tbl_size = hdr->length;
385425
if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
386426
dev_info(adev->dev, "ACPI VFCT table present but broken (too short #1),skipping\n");
387-
return false;
427+
goto out;
388428
}
389429

390430
vfct = (UEFI_ACPI_VFCT *)hdr;
@@ -397,36 +437,36 @@ static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
397437
offset += sizeof(VFCT_IMAGE_HEADER);
398438
if (offset > tbl_size) {
399439
dev_info(adev->dev, "ACPI VFCT image header truncated,skipping\n");
400-
return false;
440+
goto out;
401441
}
402442

403443
offset += vhdr->ImageLength;
404444
if (offset > tbl_size) {
405445
dev_info(adev->dev, "ACPI VFCT image truncated,skipping\n");
406-
return false;
446+
goto out;
407447
}
408448

409449
if (vhdr->ImageLength &&
410-
vhdr->PCIBus == adev->pdev->bus->number &&
411-
vhdr->PCIDevice == PCI_SLOT(adev->pdev->devfn) &&
412-
vhdr->PCIFunction == PCI_FUNC(adev->pdev->devfn) &&
413-
vhdr->VendorID == adev->pdev->vendor &&
414-
vhdr->DeviceID == adev->pdev->device) {
450+
!amdgpu_acpi_vfct_match(adev, vhdr)) {
415451
adev->bios = kmemdup(&vbios->VbiosContent,
416452
vhdr->ImageLength,
417453
GFP_KERNEL);
418454

419455
if (!check_atom_bios(adev, vhdr->ImageLength)) {
420456
amdgpu_bios_release(adev);
421-
return false;
457+
goto out;
422458
}
423459
adev->bios_size = vhdr->ImageLength;
424-
return true;
460+
r = true;
461+
goto out;
425462
}
426463
}
427464

428465
dev_info(adev->dev, "ACPI VFCT table present but broken (too short #2),skipping\n");
429-
return false;
466+
467+
out:
468+
acpi_put_table(hdr);
469+
return r;
430470
}
431471
#else
432472
static inline bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
234234
drm_printf(p, "\nIB #%d 0x%llx %d dw\n", i,
235235
coredump->ibs[i].gpu_addr,
236236
coredump->ibs[i].ib_size_dw);
237+
238+
for (int j = 0; j < coredump->ibs[i].ib_size_dw; j++)
239+
drm_printf(p, "0xffffffff\n");
237240
}
238241
return;
239242
}
@@ -355,10 +358,14 @@ amdgpu_devcoredump_format(char *buffer, size_t count, struct amdgpu_coredump_inf
355358
drm_printf(&p, "kernel: %s\n", init_utsname()->release);
356359
drm_printf(&p, "module: " KBUILD_MODNAME "\n");
357360
drm_printf(&p, "time: %ptSp\n", &coredump->reset_time);
361+
drm_printf(&p, "pasid: %u\n", coredump->pasid);
362+
drm_printf(&p, "vmid: %u\n", coredump->vmid);
358363

359364
if (coredump->reset_task_info.task.pid)
360-
drm_printf(&p, "process_name: %s PID: %d\n",
365+
drm_printf(&p, "process_name: %s TGID: %d thread: %s PID: %d\n",
361366
coredump->reset_task_info.process_name,
367+
coredump->reset_task_info.tgid,
368+
coredump->reset_task_info.task.comm,
362369
coredump->reset_task_info.task.pid);
363370

364371
/* SOC Information */
@@ -562,6 +569,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
562569
amdgpu_vm_put_task_info(ti);
563570
}
564571
coredump->pasid = job->pasid;
572+
coredump->vmid = job->vmid;
565573
coredump->num_ibs = job->num_ibs;
566574
for (i = 0; i < job->num_ibs; ++i) {
567575
coredump->ibs[i].gpu_addr = job->ibs[i].gpu_addr;

drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct amdgpu_coredump_info {
6363
char *formatted;
6464

6565
unsigned int pasid;
66+
unsigned int vmid;
6667
int num_ibs;
6768
struct amdgpu_coredump_ib_info ibs[] __counted_by(num_ibs);
6869
};

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,15 @@ static bool amdgpu_device_pcie_dynamic_switching_supported(struct amdgpu_device
13231323

13241324
if (c->x86_vendor == X86_VENDOR_INTEL)
13251325
return false;
1326+
1327+
/*
1328+
* AMD Ryzen Pinnacle Ridge (Zen+, family 0x17 model 0x08) CPUs don't
1329+
* support PCIe dynamic speed switching.
1330+
* https://gitlab.freedesktop.org/drm/amd/-/work_items/5436
1331+
*/
1332+
if (c->x86_vendor == X86_VENDOR_AMD && c->x86 == 0x17 &&
1333+
c->x86_model == 0x08)
1334+
return false;
13261335
#endif
13271336
return true;
13281337
}

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3137,9 +3137,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
31373137
case IP_VERSION(11, 5, 3):
31383138
case IP_VERSION(11, 5, 4):
31393139
case IP_VERSION(11, 5, 6):
3140+
adev->family = AMDGPU_FAMILY_GC_11_5_0;
3141+
break;
31403142
case IP_VERSION(11, 7, 0):
31413143
case IP_VERSION(11, 7, 1):
3142-
adev->family = AMDGPU_FAMILY_GC_11_5_0;
3144+
adev->family = AMDGPU_FAMILY_GC_11_5_4;
31433145
break;
31443146
case IP_VERSION(12, 0, 0):
31453147
case IP_VERSION(12, 0, 1):

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,12 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
276276
goto error_free;
277277
}
278278

279-
r = amdgpu_bo_pin(*bo_ptr, domain);
280-
if (r) {
281-
dev_err(adev->dev, "(%d) kernel bo pin failed\n", r);
282-
goto error_unreserve;
279+
if (free) {
280+
r = amdgpu_bo_pin(*bo_ptr, domain);
281+
if (r) {
282+
dev_err(adev->dev, "(%d) kernel bo pin failed\n", r);
283+
goto error_unreserve;
284+
}
283285
}
284286

285287
r = amdgpu_ttm_alloc_gart(&(*bo_ptr)->tbo);
@@ -302,7 +304,8 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
302304
return 0;
303305

304306
error_unpin:
305-
amdgpu_bo_unpin(*bo_ptr);
307+
if (free)
308+
amdgpu_bo_unpin(*bo_ptr);
306309
error_unreserve:
307310
amdgpu_bo_unreserve(*bo_ptr);
308311

0 commit comments

Comments
 (0)