mirror of
https://github.com/torvalds/linux.git
synced 2026-08-04 22:38:46 +02:00
The current implementation of drm_sched_start uses a hardcoded
-ECANCELED to dispose of a job when the parent/hw fence is NULL.
This results in drm_sched_job_done being called with -ECANCELED for
each job with a NULL parent in the pending list, making it difficult
to distinguish between recovery methods, whether a queue reset or a
full GPU reset was used.
To improve this, we first try a soft recovery for timeout jobs and
use the error code -ENODATA. If soft recovery fails, we proceed with
a queue reset, where the error code remains -ENODATA for the job.
Finally, for a full GPU reset, we use error codes -ECANCELED or
-ETIME. This patch adds an error code parameter to drm_sched_start,
allowing us to differentiate between queue reset and GPU reset
failures. This enables user mode and test applications to validate
the expected correctness of the requested operation. After a
successful queue reset, the only way to continue normal operation is
to call drm_sched_job_done with the specific error code -ENODATA.
v1: Initial implementation by Jesse utilized amdgpu_device_lock_reset_domain
and amdgpu_device_unlock_reset_domain to allow user mode to track
the queue reset status and distinguish between queue reset and
GPU reset.
v2: Christian suggested using the error codes -ENODATA for queue reset
and -ECANCELED or -ETIME for GPU reset, returned to
amdgpu_cs_wait_ioctl.
v3: To meet the requirements, we introduce a new function
drm_sched_start_ex with an additional parameter to set
dma_fence_set_error, allowing us to handle the specific error
codes appropriately and dispose of bad jobs with the selected
error code depending on whether it was a queue reset or GPU reset.
v4: Alex suggested using a new name, drm_sched_start_with_recovery_error,
which more accurately describes the function's purpose.
Additionally, it was recommended to add documentation details
about the new method.
v5: Fixed declaration of new function drm_sched_start_with_recovery_error.(Alex)
v6 (chk): rebase on upstream changes, cleanup the commit message,
drop the new function again and update all callers,
apply the errno also to scheduler fences with hw fences
v7 (chk): rebased
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240826122541.85663-1-christian.koenig@amd.com
|
||
|---|---|---|
| .. | ||
| bridge | ||
| display | ||
| i2c | ||
| intel | ||
| ttm | ||
| amd_asic_type.h | ||
| drm_accel.h | ||
| drm_aperture.h | ||
| drm_atomic_helper.h | ||
| drm_atomic_state_helper.h | ||
| drm_atomic_uapi.h | ||
| drm_atomic.h | ||
| drm_audio_component.h | ||
| drm_auth.h | ||
| drm_blend.h | ||
| drm_bridge_connector.h | ||
| drm_bridge.h | ||
| drm_buddy.h | ||
| drm_cache.h | ||
| drm_client.h | ||
| drm_color_mgmt.h | ||
| drm_connector.h | ||
| drm_crtc_helper.h | ||
| drm_crtc.h | ||
| drm_damage_helper.h | ||
| drm_debugfs_crc.h | ||
| drm_debugfs.h | ||
| drm_device.h | ||
| drm_drv.h | ||
| drm_edid.h | ||
| drm_eld.h | ||
| drm_encoder_slave.h | ||
| drm_encoder.h | ||
| drm_exec.h | ||
| drm_fb_dma_helper.h | ||
| drm_fb_helper.h | ||
| drm_fbdev_dma.h | ||
| drm_fbdev_shmem.h | ||
| drm_fbdev_ttm.h | ||
| drm_file.h | ||
| drm_fixed.h | ||
| drm_flip_work.h | ||
| drm_format_helper.h | ||
| drm_fourcc.h | ||
| drm_framebuffer.h | ||
| drm_gem_atomic_helper.h | ||
| drm_gem_dma_helper.h | ||
| drm_gem_framebuffer_helper.h | ||
| drm_gem_shmem_helper.h | ||
| drm_gem_ttm_helper.h | ||
| drm_gem_vram_helper.h | ||
| drm_gem.h | ||
| drm_gpuvm.h | ||
| drm_ioctl.h | ||
| drm_kunit_helpers.h | ||
| drm_lease.h | ||
| drm_managed.h | ||
| drm_mipi_dbi.h | ||
| drm_mipi_dsi.h | ||
| drm_mm.h | ||
| drm_mode_config.h | ||
| drm_mode_object.h | ||
| drm_modes.h | ||
| drm_modeset_helper_vtables.h | ||
| drm_modeset_helper.h | ||
| drm_modeset_lock.h | ||
| drm_module.h | ||
| drm_of.h | ||
| drm_panel.h | ||
| drm_panic.h | ||
| drm_pciids.h | ||
| drm_plane_helper.h | ||
| drm_plane.h | ||
| drm_prime.h | ||
| drm_print.h | ||
| drm_privacy_screen_consumer.h | ||
| drm_privacy_screen_driver.h | ||
| drm_privacy_screen_machine.h | ||
| drm_probe_helper.h | ||
| drm_property.h | ||
| drm_rect.h | ||
| drm_self_refresh_helper.h | ||
| drm_simple_kms_helper.h | ||
| drm_suballoc.h | ||
| drm_syncobj.h | ||
| drm_sysfs.h | ||
| drm_util.h | ||
| drm_utils.h | ||
| drm_vblank_work.h | ||
| drm_vblank.h | ||
| drm_vma_manager.h | ||
| drm_writeback.h | ||
| gpu_scheduler.h | ||
| gud.h | ||
| spsc_queue.h | ||
| task_barrier.h | ||