Linux kernel source tree
Go to file
Jesse.Zhang 290f46cf57 drm/amdgpu: Implement user queue reset functionality
This patch adds robust reset handling for user queues (userq) to improve
recovery from queue failures. The key components include:

1. Queue detection and reset logic:
   - amdgpu_userq_detect_and_reset_queues() identifies failed queues
   - Per-IP detect_and_reset callbacks for targeted recovery
   - Falls back to full GPU reset when needed

2. Reset infrastructure:
   - Adds userq_reset_work workqueue for async reset handling
   - Implements pre/post reset handlers for queue state management
   - Integrates with existing GPU reset framework

3. Error handling improvements:
   - Enhanced state tracking with HUNG state
   - Automatic reset triggering on critical failures
   - VRAM loss handling during recovery

4. Integration points:
   - Added to device init/reset paths
   - Called during queue destroy, suspend, and isolation events
   - Handles both individual queue and full GPU resets

The reset functionality works with both gfx/compute and sdma queues,
providing better resilience against queue failures while minimizing
disruption to unaffected queues.

v2: add detection and reset calls when preemption/unmaped fails.
    add a per device userq counter for each user queue type.(Alex)
v3: make sure we hold the adev->userq_mutex when we call amdgpu_userq_detect_and_reset_queues. (Alex)
   warn if the adev->userq_mutex is not held.
v4: make sure we have all of the uqm->userq_mutex held.
   warn if the uqm->userq_mutex is not held.

v5: Use array for user queue type counters.(Alex)
    all of the uqm->userq_mutex need to be held when calling detect and reset.  (Alex)

v6: fix lock dep warning in amdgpu_userq_fence_dence_driver_process

v7: add the queue types in an array and use a loop in amdgpu_userq_detect_and_reset_queues (Lijo)
v8: remove atomic_set(&userq_mgr->userq_count[i], 0).
   it should already be 0 since we kzalloc the structure (Alex)
v9: For consistency with kernel queues, We may want something like:
   amdgpu_userq_is_reset_type_supported (Alex)

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2025-11-04 11:53:05 -05:00
arch - Reset the why-the-system-rebooted register on AMD to avoid stale bits 2025-10-19 04:41:27 -10:00
block block-6.18-20251016 2025-10-17 08:31:26 -07:00
certs
crypto This push contains the following changes: 2025-10-10 08:56:16 -07:00
Documentation dt-bindings: gpu: img,powervr-rogue: Document GX6250 GPU in Renesas R-Car M3-W/M3-W+ 2025-10-27 14:44:30 +00:00
drivers drm/amdgpu: Implement user queue reset functionality 2025-11-04 11:53:05 -05:00
fs Description for this pull request: 2025-10-18 07:23:59 -10:00
include Merge tag 'drm-misc-next-2025-10-28' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next 2025-10-31 18:47:17 +01:00
init
io_uring io_uring/rw: check for NULL io_br_sel when putting a buffer 2025-10-15 13:38:53 -06:00
ipc
kernel drm-misc-next for v6.19: 2025-10-24 13:25:20 +02:00
lib
LICENSES
mm slab: reset slab->obj_ext when freeing and it is OBJEXTS_ALLOC_FAIL 2025-10-16 15:16:45 +02:00
net bpf-fixes 2025-10-18 08:00:43 -10:00
rust rust: bitmap: fix formatting 2025-10-17 13:02:22 +02:00
samples
scripts Kbuild fixes for 6.18 #1 2025-10-11 15:47:12 -07:00
security
sound ALSA: hda/realtek: Fix mute led for HP Omen 17-cb0xxx 2025-10-17 16:37:21 +02:00
tools hid-for-linus-2025101701 2025-10-18 08:18:18 -10:00
usr
virt KVM x86 fixes for 6.18: 2025-10-18 10:25:43 +02:00
.clang-format Merge tag 'drm-misc-next-2025-10-02' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next 2025-10-21 10:16:34 +02:00
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap Merge drm/drm-next into drm-misc-next 2025-10-24 14:45:08 +02:00
.pylintrc
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: adjust file entry in AMD DISPLAY CORE - DML 2025-11-04 11:52:47 -05:00
Makefile Linux 6.18-rc2 2025-10-19 15:19:16 -10:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.