summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
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> (cherry picked from commit dce8195027f146467c9378efb2bb1b0859cb735e) Cc: stable@vger.kernel.org
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> (cherry picked from commit 69fa36e3ac92f2544ee7a1b719ec212b8247a2da) Cc: stable@vger.kernel.org
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> (cherry picked from commit d50201b891604ab97f305d4a20d888ba93305b48) Cc: stable@vger.kernel.org
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> (cherry picked from commit 1bd613b0ed98a23575b18674c94b8b3392614681) Cc: stable@vger.kernel.org
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> (cherry picked from commit 8bfe29d5c798940f797aa24135d2734c3ffce9de) Cc: stable@vger.kernel.org
2026-09-02drm/amd/display: fix division by zero in get_estimated_bw()Hari Mishal
get_estimated_bw() divides by link->dpia_bw_alloc_config.bw_granularity, which is zeroed by reset_bw_alloc_struct() and only populated once DP_TUNNELING_BW_ALLOC_CAP_CHANGED has been handled. link_dp_dpia_handle_bw_alloc_status(), the DPCD interrupt handler, calls get_estimated_bw() whenever DP_TUNNELING_ESTIMATED_BW_CHANGED is set, independently of whether DP_TUNNELING_BW_ALLOC_CAP_CHANGED has ever fired for that link. A connected USB4/DPIA tunneling device that reports an estimated-bandwidth change before ever reporting a capability change drives a division by zero in this IRQ path. link_dpia_send_bw_alloc_request() already guards the same bw_granularity division; add the identical guard here rather than introducing a new pattern. Fixes: 8e5cfe547bf3 ("drm/amd/display: upstream link_dp_dpia_bw.c") Reviewed-by: Alex Hung <alex.hung@amd.com> Assisted-by: gkh_clanker_t1000 Signed-off-by: Hari Mishal <harimishal1@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit f2a961457c33dc34223aad5c9e8971de34a4eed3) Cc: stable@vger.kernel.org
2026-09-02drm/amd/display: use halving distribution for all encode-to-linear curvesMelissa Wen
In encode-to-linear conversions, LUT entries should be uniformly distributed across the input range: non-linear encodings are already approximately perceptually uniform, so every input code carries the same weight. A fixed count per region does the opposite, concentrating entries on the darker values and leaving few for the bright end, whereas halving distribution spaces all 256 entries uniformly. This holds for any encoded input, so remove the PQ/sRGB condition from commit "drm/amd/display: use halving distribution for PQ/sRGB linearizing LUT" and apply halving to all encode-to-linear operations (pre-defined TF or user LUTs). It fixes the following IGT kms_colorop subtests: - plane-XR30-XR30-srgb_inv_eotf_lut-srgb_eotf_lut - plane-XR30-XR30-gamma_2_2-gamma_2_2_inv-gamma_2_2 Fixes: a71d2b051f33 ("drm/amd/display: use halving distribution for PQ/sRGB linearizing LUT") Reviewed-by: Alex Hung <alex.hung@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 6df7c9c307e72e7f13829e94edc89134f0764775)
2026-09-02drm/amd/display: Fix backlight control for luminance-capable OLEDRoman Li
[WHY] For some eDP panels VESA aux backlight control is necessary, otherwise they stay black. [HOW] When AUX backlight control is used, select BACKLIGHT_CONTROL_VESA_AUX for panels that advertise panel_luminance_control. Reviewed-by: Hansen Dsouza <hansen.dsouza@amd.com> Signed-off-by: Roman Li <Roman.Li@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 42f698bd061d76d5f4c84a195e465cfbeec775e4)
2026-09-02drm/amd/display: Remove const Qualifier From Non-Pointer FieldsAustin Zheng
[WHY/HOW] Integer values for dml2_core_calcs_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport_params should not have the const qualifier. This prevents using different values of the inputs when the function is called again. Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Austin Zheng <Austin.Zheng@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 342280aae4f33816e8d07c15cb538a3b375a7f8f) Cc: stable@vger.kernel.org
2026-09-02drm/amd/display: Set gpuvm min page size to 4K on dcn35/36Roman Li
[WHY] Splash screen corruption on some 8K monitors. [HOW] Set GPUVM min page size to 4K for DCN35/36 to use the correct DML2 calculations, avoiding the corruption path observed during splash. Fixes: 115009d11ccf ("drm/amd/display: Add DCN35 DML2 support") Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Roman Li <Roman.Li@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 2cbfb03dead5088a7bdfe2ce392a5caa3d1b3719) Cc: stable@vger.kernel.org
2026-09-02drm/amd/display: Fix DCN5/6 DML2 compilation warningsIvan Lipski
[WHY] A kernel compilation warning was reported caused by upstream of DCN5/6. [HOW] Using plain integer as NULL pointer. Assign NULL to the VActiveLatencyHidingMargin/VActiveLatencyHidingUs pointer members in dml2_core_dcn5_funcs_mode_programming.c, and pass NULL for the pointer arguments to calculate_first_second_splitting() in dml2_pmo_dcn6_stage_optimizers.c. Fixes: 7f7d7ea1fa51 ("drm/amd/display: Add new sources for DCN6") Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit d96880560e9f35ba7f8de1b3f90032c8c3eaea88)
2026-09-02drm/amdgpu: fix Idle BOs list in VM debugfs status infoSunil Khatri
amdgpu_debugfs_vm_bo_status_info() prints the "Idle BOs" section by iterating lists->needs_update, the same list already printed just above under "Moved BOs". struct amdgpu_vm_bo_status has a dedicated idle list, populated whenever a BO's state machine settles, but it was never read here, so genuinely idle BOs never show up in the debugfs output and the "Idle BOs" section duplicates "Moved BOs" instead. Iterate lists->idle for the "Idle BOs" section. Fixes: 4cdbba5a16aa ("drm/amdgpu: restructure VM state machine v4") 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> (cherry picked from commit 451bfc778a8c364841837def00ba15936f72762b) Cc: stable@vger.kernel.org
2026-09-02drm/amdgpu: use AMDGPU_GPU_PAGE_SHIFT instead of PAGE_SHIFTSunil Khatri
For different address types the variable PAGE_SHIFT might not work well and it's better to use the GPU specific one 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> (cherry picked from commit 3494b77d10375e0f9ab784e9b20763339844b55b) Cc: stable@vger.kernel.org
2026-09-02drm/amdgpu: Update queue reset support versionAmber Lin
Update queue reset required MES version for MES 12.1 to 0x7b since we change the implementation from detect-and-reset method to per-queue-reset method. Signed-off-by: Amber Lin <amber.lin@amd.com> Reviewed-by: Michael Chen <michael.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 2160a5cbf0b7917adce4b55421306b614b4a2c8f)
2026-09-02drm/amdgpu/gfx8: only apply compute quantums to KCQsAlex Deucher
Don't apply to KIQ. Seems to cause problems on KIQ on some ARM platforms. Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5658 Fixes: 91cf34bc5a55 ("drm/amdgpu/gfx8: align mqd settings with KFD") Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Kent Russell <kent.russell@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 6aae7bab029cdccae9a7157facfe36bfc35fc940) Cc: stable@vger.kernel.org
2026-09-02drm/amdgpu: restrict BAR0 fallback read to SR-IOV VFs onlyMario Limonciello
The BAR0 fallback read path was introduced as a workaround for SR-IOV VFs where the VRAM aperture is not available during early init. Restrict this workaround to only SR-IOV VFs where it's needed. Reported-by: gloveless@jqluv.com Fixes: cba4928cdffa ("drm/amdgpu: reduce early full GPU access during SR-IOV init") Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260826185102.2269511-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit d8a0affd207c813bd063fa2c27786f449eaf92b8)
2026-09-02drm/amdkfd: Add TLB flush after MES queue eviction/suspensionPriya Hosur
MES (Micro Engine Scheduler) does not perform heavy-weight TLB invalidation after unmapping queues, unlike HWS which does this automatically. This causes a race condition where in-flight DMA descriptors can access memory that has been unmapped, leading to page faults and GPU queue hangs during SVM page migration. The issue manifests as KFDSVMRangeTest.MultiThreadMigrationTest failures on gfx1151 (Strix Point) with XNACK mode 1 enabled - the GPU compute queue hangs with packets submitted but never consumed. Add kfd_flush_tlb() calls after MES queue removal in two locations: - evict_process_queues_cpsch(): after all queues removed during eviction - suspend_queues(): after debug/criu queue suspension (with mem_fence barrier) This ensures all in-flight memory accesses from unmapped queues are flushed before memory is freed or migrated. Signed-off-by: Priya Hosur <Priya.Hosur@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit f5c4f88e0f9c45a8fb9dfac0c1df726c95e41b77) Cc: stable@vger.kernel.org
2026-09-02drm/amdgpu: Add ioctl infra for exporting/importing UALink handlesMukul Joshi
Add the ioctl infrastructure to support exporting and importing BOs to facilitate NPA based memory sharing across GPUs in a rack scale setup. Proposed userspace: https://github.com/ROCm/rocm-systems/blob/35959f8e1260c7cee3e51a740e320be3856ee4ff/projects/rocr-runtime/libhsakmt/src/memory.c#L971 https://github.com/ROCm/rocm-systems/blob/35959f8e1260c7cee3e51a740e320be3856ee4ff/projects/rocr-runtime/libhsakmt/src/memory.c#L1036 v2: Move the ioctl wire-up to the end of the series. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Horatio Zhang <hongkun.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/gem: Add callback for when handle count goes to 0Mukul Joshi
Add an optional callback for driver-specific cleanup when the GEM handle of an object is freed. This will be used by AMDGPU to enable freeing of memory exported to other nodes in a UALink pod once all user mode references are gone. The callback is called outside the object_name_lock and before releasing the reference count on the GEM object Suggested-by: Christian König <christian.koenig@amd.com> 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: Honor mtype overrides for NPA remote memoryMukul Joshi
Derive mtype_remote in gmc_v12_1_get_npa_flags() from gmc_v12_1_get_mtypes() so the module-parameter override and ASIC defaults are honored instead of recomputing with hard-coded values. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: add mtype_remote module parameterMukul Joshi
Add an amdgpu_mtype_remote module parameter so the MTYPE used for remote memory accesses can be overridden. For now only MTYPE_NC and MTYPE_UC are selectable (0 = MTYPE_NC, 1 = MTYPE_UC); it defaults to the ASIC-dependent value. Currently, it is used only for GFX 12.1. The MTYPEs resolved for both local and remote memory are logged once. 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: create UALink NPA import BO directly in the NPA domainMukul Joshi
amdgpu_ualink_map_npa_to_dmabuf() created the NPA import BO in the CPU/SYSTEM domain and then moved it to NPA. SYSTEM is use_tt=true, so TTM attaches a host-page ttm_tt that the null move to NPA leaves behind. On dma-buf export, ttm_bo_populate() then fills that ttm_tt with system pages, spiking host RAM by the entire NPA window size. Create the BO directly in the NPA domain (use_tt=false) so no ttm_tt is ever attached, and relocate it to the exact remote window. 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: Handle concurrent UALINK handle import raceMukul Joshi
When two threads import the same UALINK handle concurrently, the first xa_insert() succeeds and the second gets -EBUSY. Convert -EBUSY to -EAGAIN so user-space retries instead of seeing a spurious error. 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: Expose ualink info under each xcpLijo Lazar
Mirror the read-only ualink info attributes on each secondary compute partition as a per-partition ualink node, so a partition-scoped consumer (e.g. a container that only sees its partition's device node) can read the ualink identity and state. Partition 0 shares the primary device, which already exposes that node, so it is skipped. An inactive partition device won't be having any attributes listed under ualink node. The per-partition attributes are served by thin wrappers that delegate to the existing device-level info show functions. A reference on the info kobject is held for the node's lifetime so it cannot be freed while a partition still uses it. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Assisted-by: Claude (claude-opus-4.7) Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add hw_fini for ualinkLijo Lazar
Deactivate accelerator from vpod during hw_fini sequence. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Move ualink ip version related changesLijo Lazar
Move more IP version specific related things to ualink version file. Use soc v1.0 IH client id defintion and define mpnht interrupt source id in ivsrcid header. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Cleanup UALink XA entries on manager stopMukul Joshi
amdgpu_ualink_manager_stop() only called xa_destroy() on the exporter, importer and handle-invalid xarrays, which frees the internal tree but not the node objects. Entries still present at teardown thus leaked the nodes, left NPA addresses mapped and kept exported BOs pinned. Free the entries in all three xarrays explicitly, without exchanging any NPA protocol messages (the F/W is already halted by amdgpu_ualink_sw_fini()): mark connections down so the drained workers and teardown take the message-free path, drain in-flight exporter cleanup work to empty handle_invalid_xa, then free the remaining importer and exporter entries before the NPA allocator is torn down. Also factor the shared importer-node release into amdgpu_ualink_release_imp_xa_node(), drop/drain stale remote interrupts in the IRQ handler when the accelerator is not ACTIVE, and refuse outbound messages in amdgpu_ualink_send_command() when not ACTIVE so an in-flight cleanup worker cannot emit onto torn-down peer/SDMA state or block waiting for a response that will never arrive. 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 name for ualink ip blockLijo Lazar
Add namestring for ualink Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Handle UALink vPod reconfiguration while ACTIVEMukul Joshi
An already-ACTIVE accelerator with an unchanged vpod_id skipped re-activation, so growing or shrinking a live vPod left staying GPUs with links/GART built for the old member set. Detect membership changes (owned snapshot vs firmware read-back) and bounce affected ACTIVE peers once the integrity check passes. Firmware requires a full metadata reload while halted, so a full deactivate/activate is needed rather than per-peer deltas. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add UALink diagnostic logging for vpod commit/activationMukul Joshi
Add UALINK:-tagged dev_info/dev_warn logging along the vpod commit -> update_accel_state -> integrity -> activate path so failing and -EAGAIN peer-wait cases are visible without dynamic debug. Also fix a wrong print arg (vpod->id -> vpod->addr_mode) in the invalid addr mode message. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Fix GART and SDMA entity leak on vPod reconfigurationMukul Joshi
remote->active_accel_bits aliased info->vpod.active_accel_bits, which psp_ual_query_info() refreshes on every commit. Teardown (peer_remote_fini / gart unmap) then iterated the new set instead of the one sw_init mapped, orphaning drm_mm nodes in the shared GTT manager. Make active_accel_bits an owned snapshot copied at sw_init time. Drop the now-redundant not-initialised guard in metadata_npa_unmapping(), since the earlier remote->ring_bo NULL-check already covers that case. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Philip Yang <philip.yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Use uniform logic for inband/sidebandLijo Lazar
For updating the vpod configuration, use similar logic in both sideband and inband paths. In inband path, force the vpod id as invalid when ppod configuration is done. Remove the redundant query call after station configuration as it station configuration doesn't affect vpod configuration. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Improve ualink state transitionsLijo Lazar
Keep state transitions under lock. Validate the ppod/vpod config or both based on the state passed by ASP. When a config update is received, if the GPU is already active on a vpod, local vpod gpu integrity check is skipped to keep minimal disruption. A gpu removed from the vpod will get the new vpod id as 0. A GPU is not expected to transition directly from a valid/nonzero vpod id to another valid vpod id. It needs to be removed from the existing vpod first. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add handlers for ualink notificationsLijo Lazar
Add handlers for ualink notifications from ASP. Pause/Resume notifications are not handled currently. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Add support to send ASP completionLijo Lazar
Add interface to send completion command to ASPs after processing ualink notifications. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Drop duplicate vpod check functionsLijo Lazar
Use __check_local_vpod_integrity and __check_vpod_info for vpod validation checks. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Assign accel state based on ASP configLijo Lazar
Add explicit PPOD/VPOD states for clarity. Assign the state accordingly as received from ASP during initialization. UALink accel state transitions: UNCONFIGURED -> PPOD_CONFIGURED -> VPOD_CONFIGURED -> READY -> ACTIVE - PPOD: sysfs ppod commit/ ASP {UAL_CFG_PPOD} - VPOD: sysfs vpod commit/ ASP {UAL_CFG_VPOD} | {UAL_CFG_STATION} - READY: local vpod integrity + activate_accelerator() - ACTIVE: all local gpus belonging to one vpod are configured and ready. deactivate_accelerator(): READY -> PPOD_CONFIGURED invalid vpod: -> ERROR Query ualink info during late init phase. Add a local vpod integrity check before activating devices in the vpod. Move the devices to active state once integrity check passes. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/admgpu: Seggregate ualink nht messagingLijo Lazar
Message handshake with NHT firmware is IP specific. Separate that into IP specific file. Move ip block v1.0 definition also the version specific file. Signed-off-by: Lijo Lazar <lijo.lazar@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 as separate ip blockLijo Lazar
Manage ualink lifecycle as a separate IP block. For now, use GC version to add specific ualink ip block. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Acked-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Separate out ualink init sequencesLijo Lazar
Separate out sw_init and hw_init part of ualink. ualink init errors are ignored temporarily. Keep ualink sysfs init together with sysfs init sequence of other IPs. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdkfd: program compute MQD coherent_aql_mtype on GFX 12.1Mukul Joshi
Name the compute MQD dword at offset 509 (previously reserved_509) as coherent_aql_mtype in v12_1_compute_mqd and program it when initializing a compute queue MQD. The field must be set to 0 whenever the driver maps local or remote memory as MTYPE_NC, and to 1 in all other cases. Add a shared helper gmc_v12_1_get_mtypes() as the single source of truth for the local and remote MTYPE decision (used by both the PTE coherence flags and the MQD programming), and gmc_v12_1_get_coherent_aql_mtype() which derives the 0/1 value from it. 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: always use MTYPE_UC for remote memory on GFX 12.1Mukul Joshi
On GFX 12.1 remote (non-local / system) memory accesses should always be mapped as MTYPE_UC. 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: Initialize NPA PT/PDs to noretryFelix Kuehling
Unmapped NPA addresses should result in no-retry faults on the importer side. 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: Pin page tables in NPA VMsFelix Kuehling
With latest POR, remote importers aren't guaranteed to support instruction replay-on-fault. Therefore, we cannot support unpinned exports or unpinned page-tables in the exporter mappings into NPA space. 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: Use vm->last_update fence in UALink NPA unmap pathsMukul Joshi
amdgpu_ualink_map_npa_addr() already uses vm->last_update as the fence output for amdgpu_vm_update_range(), but the two unmap functions used a local fence variable instead. This is incorrect because amdgpu_vm_update_pdes() always commits into vm->last_update regardless of the fence passed to update_range(). As a result the PDE update job (submitted after the range update) would not wait before the TLB flush. As a result, switch both amdgpu_ualink_unmap_npa_addr() and amdgpu_ualink_unmap_all_npa_addr() to use vm->last_update fence. 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 uninitialized fence in UALink NPA unmapMukul Joshi
Initialize fence to NULL in UALink NPA unmap to make sure we don't end with a garbage value which then gets incorrectly dereferenced inside amdgpu_vm_tlb_flush(). Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Increase UALink soft ring sizePhilip Yang
The UALink soft ring overflows under bursts of interrupts from remote GPUs. Size it at 16x the default soft ring to absorb the burst. While here, read the source accel_id and context dwords before the delegate path and log them, so the originating GPU is recorded for every interrupt. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: fix dma_buf leak in UALink exporter cleanupMukul Joshi
At export time the driver code always builds a dma_buf for the BO which is then shared for local imports. During cleanup, if there are no importers, which is true for local imports, we never free the dma_buf thus causing the memory leak. Fix by dropping the dma_buf reference in the no-importers branch as well. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: Fix initialization flags for UALink XAsMukul Joshi
The UALink exp_xa, imp_xa and handle_invalid_xa xarrays are only ever accessed from process context: ioctls or workqueues. None of them run in softirq or hardirq context, so initializing the Xarray with BH flag is unnecessary. Drop XA_FLAGS_LOCK_BH and use the default plain-spinlock locking (xa_init() and the plain xa_* accessors). Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-09-02drm/amdgpu: initialize UALink importer node list headMukul Joshi
Initialize the list head at node creation so list_del_init() is safe on a node that has not yet been added to imp_handles_list. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>