summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-09-02drm/amdgpu: Add UALink NPA address computation for ring buffersPhilip Yang
Add a ring buffer type enum and address formula for the reserved NPA space between source and destination GPUs, covering both addressing modes. Add a GART-adjusted variant so the local SDMA engine can address remote GPU buffers. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add UALink NPA address layout helpersPhilip Yang
Add accessors for the local accelerator ID, addressing mode, and active peer bitmap, plus a TLB flush helper for the NPA VM. Provide per-ring size and byte offset helpers for both source-identification and source-alias addressing modes. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add UALink remote state structures and API declarationsPhilip Yang
Extend the UALink manager with data structures for cross-GPU interrupt and TLB shootdown: per-ring state, per-peer channel pairs, and the top-level remote container. Declare the public init, teardown, and reset APIs. Define ring buffer capacity, firmware command and status codes, SMN mailbox register addresses, and the metadata and writeback buffer layouts shared between driver and MPNHT firmware. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Fix UALink vPod double-activationPhilip Yang
ualink_ppod_setup_commit_store() updated accel_state via check_ppod_state() but never called deactivate_local_vpod() when the accelerator was already in READY state. A subsequent vpod config commit would then call activate_local_vpod() again, resulting in activate_accelerator() calling amdgpu_ualink_manager_start() a second time on top of already-initialized NPA VM, causing a NULL pointer dereference in rb_insert_color when drm_sched_entity nodes already in the SDMA scheduler FIFO rb-tree were double-initialized. Fix: call deactivate_accelerator() in ualink_ppod_setup_commit_store() guarded by accel_state >= READY, under mgpu_info.mutex to serialize with activate_local_vpod() in ualink_vpod_config_commit_store(). Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Enable UALink Manager when pod becomes activeMukul Joshi
Enable the UALink manager when the pod state transitions to active. This would enable exchanging of memory across GPUs in a rack-scale setup. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Use reserved VMID for NPA VMMukul Joshi
Map NPA VM to use the reserved VMID. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Reserve VMID for NPA VMMukul Joshi
Reserve MMHUB VMID 15 to be used for NPA VM. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Rework VMID reservation logicMukul Joshi
Rework the VMID reservation logic by passing in the mask of VMIDs (for both GFXHUB and MMHUB) available for it to use. The VMID masks for both GFXHUB and MMHUB are initialized in the respective ASIC specific files. This also helps in reserving per-ASIC VMIDs. This is in preparation for reserving a VMID for NPA added in the next patch. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Initialize VM for NPA addr managementMukul Joshi
Initialize a NPA VM for managing NPA addresses on the exporter GPU. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add address allocator for NPA addressesMukul Joshi
Add a address allocator, which uses DRM MM, for allocating and deallocating NPA addresses for BOs exported/imported in a rack-scale setup. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add a new NPA Address spaceMukul Joshi
Add a new address space for NPA address management. This is needed for sharing buffer objects across GPUs with each running their own OS. The NPA address space size can change across different HW generations so the size is initialized during early init of the driver boot up process. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Fix NULL pointer issue during ualink initJinzhou Su
PSP may be disabled during driver initialization. So psp->cmd is not allocated, so any psp_*() call would deref NULL. Also skip if sysfs_init failed and ualink.info was never allocated. Signed-off-by: Jinzhou Su <jinzhou.su@amd.com> Acked-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: extend PSP command polling sleep rangeLe Ma
Increase the upper bound of the PSP command polling sleep range to allow more time for commands such as UAL_SET_STATION_CONFIG to complete before the next status check. Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add ual_config_state to ual_get_configHarish Kasiviswanathan
Add psp_gfx_ual_config_state Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: add handler for nHT errorGangliang Xie
add handler for nHT error v2: add EA ill op check Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add helper function to check psp xgmi taHarish Kasiviswanathan
Helper function to check if psp xgmi ta is supported Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Enable/disable NPA address translation using PSPFelix Kuehling
Enable or disable NPA address translation using PSP during accelerator state transitions in and out of READY state. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Implement PSP cmd UAL_SET_NPA_CONFIGFelix Kuehling
To set NPA translation configuration to PSP. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Set UALink station config to PSPFelix Kuehling
Set the UALink station configuration to PSP in the commit store callback. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Implement PSP cmd UAL_SET_STATION_CONFIGFelix Kuehling
To set the UALink station configuration to PSP. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Set virtual pod configuration to PSPFelix Kuehling
Set the virtual pod configuration to PSP in the commit store callback. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Implement PSP cmd UAL_SET_VPOD_CONFIGFelix Kuehling
To set the virtual pod configuration to PSP. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Set physical pod configuration to PSPFelix Kuehling
Set the physical pod configuration to PSP in the commit store callback. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Implement PSP cmd UAL_SET_PPOD_CONFIGFelix Kuehling
To set the physical pod configuration to PSP. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Query initial UALink config from PSPFelix Kuehling
Query the initial UALink configuration info from PSP at driver initialization time. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Implement PSP cmd UAL_GET_CONFIGFelix Kuehling
To query UALink configuration information from PSP. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add UALink manager core infrastructureMukul Joshi
This patch introduces AMDGPU UALink manager core infrastructure which will be responsible for sharing buffer objects across multiple GPUs, with each GPU running their own OS, in a rack scale setup. The core infrastructure of the ualink manager will include: - Store BOs exported from a GPU. - Store BOs imported by a GPU. - Store connection state with different GPUs. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add sysfs API for UALink station configurationFelix Kuehling
<device>/ualink/stations: Directory for staging UALink station/port configuration attributes: - station_flags (currently only sets the number of port per station) - lane_en_bitmap (hexadecimal bitmaps of lanes enabled per station) - write "true" to commit to apply settings Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add sysfs API for UALink virtual pod configFelix Kuehling
<device>/ualink/config: Directory for staging virtual pod configuration attributes. Write "true" to commit to apply settings Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add sysfs API for UALink physical pod setupFelix Kuehling
<device>/ualink/setup: Directory for staging physical pod setup attributes. Write "true" to commit to apply settings Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add sysfs API for UALink informationFelix Kuehling
<device>/ualink/info: Directory contains current UALink attributes - link_type: UALoE of UALink - accel_state: unconfigured, configured, ready, active, error - accel_id: Accelerator ID - ppod_id: Physical pod ID (UUID) - ppod_size: Number of accelerators in physical pod - bandwidth: Estimated total bandwidth between pairs of accelerators - latency: Estimated latency between pairs of accelerators - vpod_id: Virtual pod ID - vpod_size: Number of accelerators in virtual pod - vpod_active_accels: List of all accelerator IDs in vpod - local_accels: List of local accelerator IDs in vpod - addr_mode: source-aliasing or source-identification Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Fetch asp ualink interface versionLijo Lazar
Add interface to get ASP ualink interface version. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add psp ualink command interfacesLijo Lazar
Add asp ualink command/response structures Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Remove gfxoff calls in GC v12.1Lijo Lazar
The calls are redundant as GFXOFF is not there on GC v12.1. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/pm: Implement notify_ac_dc callback for swsmuLijo Lazar
Wire up the notify_ac_dc pp_funcs callback for swsmu instead of special-casing is_support_sw_smu in the ACPI event handler. This keeps AC/DC transition notification through the same callback path as used by legacy powerplay and legacy-dpm backends. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdkfd: don't gate userptr cleanup on the owning mmPerry Yuan
amdgpu_ttm_tt_get_usermm() returns gtt->usertask->mm. By the time KFD frees its BOs from kfd_process_wq_release(), the process has long since run exit_mm() and that pointer is NULL, so the cleanup below is simply skipped on process teardown. mem->user_pages then leaks along with the page references it still holds, or mem->range on HMM builds. Check the USERPTR alloc flag instead. It is set when the BO is created and stays valid no matter what the process does. Signed-off-by: Perry Yuan <perry.yuan@amd.com> Reviewed-by: Philip Yang <philip.yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdkfd: skip migration when the fault window is already in VRAMWilliam Palacek
svm_migrate_vma_to_vram() is called for windows that are already fully resident in the target GPU's VRAM. migrate_vma_setup() raises an MMU notifier invalidate before it can discover there is nothing to collect, and with retry faults enabled svm_range_cpu_invalidate_pagetables() special cases only MMU_NOTIFY_UNMAP, so MMU_NOTIFY_MIGRATE is handled by its default arm, reaching svm_range_evict() and then svm_range_unmap_from_gpus(). The attempt therefore drops the window's GPU mapping and then returns having migrated nothing, so the next fault on that window is escalated into another migration instead of being satisfied by mapping alone. Measured on MI300X (gfx942, SPX/NPS1, xnack+) under an HMM oversubscription workload, 96 to 97% of to-VRAM migration attempts collected zero pages, and the driver unmapped a window roughly 35 times for every migration that moved data. Test whether every page of the faulting window is already resident in this node's VRAM and return early if it is. prange->actual_loc alone is not sufficient: since commit a546a2768440 ("drm/amdkfd: Use partial migrations/mapping for GPU/CPU page faults in SVM") migration is per window, so a range can report actual_loc == best_loc while part of it has been evicted back to system memory. 3.3% of attempts were in exactly that state and did have pages to move, so the per-page test is required rather than the scalar alone. Instrumented over 100000 attempts on an earlier run against a different driver build, the per-page test never skipped one that had pages to move. The actual_loc comparison is kept alongside the per-page test because SVM_RANGE_VRAM_DOMAIN records only that a page is in some device's VRAM, not which device's. With this applied the fault driven phase of that workload falls from 270 to 348 s down to 45 to 48 s, across 9 patched and 7 unpatched runs with no overlap at either oversubscription factor tested. page_in at the end of that phase does not fall with it: 44.5 to 48.3M pages patched against 44.1 to 49.7M unpatched at factor 1.10, and 46.2 to 48.0M against 44.1 to 45.7M at factor 1.02. Those ranges overlap at 1.10, so the claim is that no data is stranded, not that more moves. Unmaps per productive migration fall from about 35 to about 2. Retry fault counts do not fall in any arm, so this is not a refault loop; what changes is how often a fault escalates into a migration. The scan is bounded by the migration window, one granule on the fault path and the whole range on the prefetch path. That is the same order as the migrate_vma_setup() walk it avoids, and it returns at the first page that is not resident, so the worst case is one extra pass over a range that then migrates normally. Signed-off-by: William Palacek <William.Palacek@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Fix cursor disable with horizontally split planesYuling Li
[WHY] resource_can_pipe_disable_cursor() disables the hardware cursor on a pipe when a higher layer fully covers that pipe's recout, to avoid double-cursor and scaling artifacts. When merging pipe-split halves of the same overlay layer, the inner loop walks every pipe above the current one and looks for siblings sharing test_pipe's layer_index. Because test_pipe itself satisfies that condition, it can be treated as its own split partner. That incorrectly doubles r2.width and makes the covering check succeed even when the overlay does not fully contain the underlying pipe. On horizontally split or multi-quadrant layouts this causes the cursor to disappear over overlay regions while input/coordinate mapping remains correct. [HOW] Skip test_pipe when searching for a pipe-split sibling on the same layer, so only the other half of the split plane is merged into r2. Signed-off-by: Yuling Li <yulingli@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: skip IMU microcode request for GC 12.1Horatio Zhang
vBIOS has the support of IMU firmware. Requesting it now fails and aborts GPU init: amdgpu 0001:01:00.0: early_init of IP block <gfx_v12_1> failed -19 amdgpu 0001:01:00.0: Fatal error during GPU init v2: drop the MODULE_FIRMWARE declaration. Signed-off-by: Horatio Zhang <hongkun.zhang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/userq: dont overwrite the error of subsequent map callSunil Khatri
If a queue fails to map that we need to return the error code back to the caller and not overwrite with a success specifically. Accumulate the failure and return that. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu/userq: add a warning if fw does not support userqueuesSunil Khatri
Creating a queue could fail due to various reasons and returning -EINVAL does not suffice in case where fw does not support the uq's It's better to add a one time log that saves unnecessary debug effort. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Skip accessing psp rum time db for APUsKanala Ramalingeswara Reddy
Psp runtime DB is for dGPUs only. Signed-off-by: Kanala Ramalingeswara Reddy <Kanala.RamalingeswaraReddy@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: update the fw version for gfx12 userqueuesSunil Khatri
Update to the latest stable fw versions where userqueues is working as it is expected with major fixes. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: update the fw version for gfx11 userqueuesSunil Khatri
Update to the latest stable fw versions where userqueues is working as it is expected with major fixes. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: fix byte/dword unit mismatch in coredump IB dumpSunil Khatri
In amdgpu_devcoredump_print_ibs(), the NO_CPU_ACCESS VRAM path passed cursor.start/4 and cursor.size/4 to amdgpu_device_mm_access(), but that function's pos/size parameters are byte offsets/lengths (confirmed by amdgpu_ttm_vram_mm_access() and leading to wrong size calculation. Similarly with that change the off index needs to be calculated based on dword since that is a u32 type. Fixes: 7b15fc2d1f1a ("drm/amdgpu: dump job ibs in the devcoredump") Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdkfd: fix scope of mqd_mgr dereference in pqm_debugfs_mqdsMario Limonciello
Reading /sys/kernel/debug/kfd/mqds while a process holds an active KFD queue triggers a NULL pointer dereference because the for loop that calls mqd_mgr->debugfs_show_mqd() is incorrectly placed outside the if (pqn->q) block that initializes mqd_mgr. The queue list can contain entries where pqn->q is NULL (kernel queues where only pqn->kq is valid). In the original code: if (pqn->q) { ... mqd_mgr = q->device->dqm->mqd_mgrs[mqd_type]; size = mqd_mgr->mqd_stride(...); } for (xcc = 0; xcc < num_xccs; xcc++) { // WRONG: outside if block mqd = q->mqd + size * xcc; r = mqd_mgr->debugfs_show_mqd(m, mqd); } When iterating over a queue node where pqn->q is NULL: 1. The if (pqn->q) block is skipped 2. mqd_mgr remains uninitialized (NULL from declaration) 3. The for loop executes anyway 4. mqd_mgr->debugfs_show_mqd(m, mqd) dereferences NULL The crash manifests as: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode RIP: 0010:0x0 Call Trace: pqm_debugfs_mqds+0x10c/0x1d0 [amdgpu] kfd_debugfs_mqds_by_process+0x9b/0x110 [amdgpu] seq_read_iter+0x132/0x4b0 ... Fix by moving the for loop inside the if (pqn->q) block, so mqd_mgr and related variables are only used when properly initialized. Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5689 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260831130051.2031435-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: remove unecessary parameters from trace_amdgpu_vm_update_ptesChristian König
Those can be determined by the parameter structure as well. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: start to move VM internals into amdgpu_vm_internal.hChristian König
Avoid exposing some defines outside of the VM code. Signed-off-by: Christian König <christian.koenig@amd.com> Assisted-by: Claude:Sonnet 4 Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: cancel hang_detect_work before taking userq_mutexVitaly Prosyak
cancel_delayed_work_sync() waits for any running work instance to finish. hang_detect_work takes userq_mutex during its run, so calling cancel_delayed_work_sync() inside userq_mutex in amdgpu_userq_destroy() risks deadlock: amdgpu_userq_destroy holds userq_mutex -> cancel_delayed_work_sync -> __flush_work (waits for work) -> hang_detect_work (running) tries to acquire userq_mutex -> DEADLOCK WARNING: possible circular locking dependency detected amd_basic/3761 is trying to acquire lock: (work_completion)(&(&queue->hang_detect_work)->work), at: __flush_work but task is already holding lock: (&userq_mgr->userq_mutex), at: amdgpu_userq_destroy+0x76/0x3e0 [amdgpu] Move the cancel before mutex_lock() to eliminate this dependency. Cc: Christian Koenig <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Sunil Khatri <sunil.khatri@amd.com> Cc: Prike Liang <prike.liang@amd.com> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Christian Koenig <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amd/display: Emit VTEM for HF-VSDB VRR on TMDS linksFangzhi Zuo
HDMI-Forum VRR metadata is carried in the Video Timing Extended Metadata Packet (VTEM). amdgpu_dm_update_freesync_state_on_stream() only built the VTEM for SIGNAL_TYPE_HDMI_FRL, so on a TMDS link a sink that advertises HDMI-Forum VRR via the HF-VSDB (but not AMD FreeSync via the AMD-VSDB) never received a VTEM and VRR could not engage. Per HDMI 2.1 a VTEM is a video-blanking data-island packet valid in both TMDS and FRL modes; only the compressed-video CVTEM is tied to FRL. Build the VTEM on a TMDS link as well when the sink reports HF-VSDB VRR. Sinks without HF-VSDB VRR keep the existing AMD FreeSync SPD infopacket path, so AMD FreeSync behavior is unchanged. Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Tested-by: Pei-Hsin Yang <peihsiny@valvesoftware.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>