mirror of
https://github.com/torvalds/linux.git
synced 2026-08-06 07:21:55 +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
|
||
|---|---|---|
| .. | ||
| amd | ||
| arm | ||
| armada | ||
| aspeed | ||
| ast | ||
| atmel-hlcdc | ||
| bridge | ||
| ci | ||
| display | ||
| etnaviv | ||
| exynos | ||
| fsl-dcu | ||
| gma500 | ||
| gud | ||
| hisilicon | ||
| hyperv | ||
| i2c | ||
| i915 | ||
| imagination | ||
| imx | ||
| ingenic | ||
| kmb | ||
| lib | ||
| lima | ||
| logicvc | ||
| loongson | ||
| mcde | ||
| mediatek | ||
| meson | ||
| mgag200 | ||
| msm | ||
| mxsfb | ||
| nouveau | ||
| omapdrm | ||
| panel | ||
| panfrost | ||
| panthor | ||
| pl111 | ||
| qxl | ||
| radeon | ||
| renesas | ||
| rockchip | ||
| scheduler | ||
| solomon | ||
| sprd | ||
| sti | ||
| stm | ||
| sun4i | ||
| tegra | ||
| tests | ||
| tidss | ||
| tilcdc | ||
| tiny | ||
| ttm | ||
| tve200 | ||
| udl | ||
| v3d | ||
| vboxvideo | ||
| vc4 | ||
| vgem | ||
| virtio | ||
| vkms | ||
| vmwgfx | ||
| xe | ||
| xen | ||
| xlnx | ||
| drm_aperture.c | ||
| drm_atomic_helper.c | ||
| drm_atomic_state_helper.c | ||
| drm_atomic_uapi.c | ||
| drm_atomic.c | ||
| drm_auth.c | ||
| drm_blend.c | ||
| drm_bridge_connector.c | ||
| drm_bridge.c | ||
| drm_buddy.c | ||
| drm_cache.c | ||
| drm_client_modeset.c | ||
| drm_client.c | ||
| drm_color_mgmt.c | ||
| drm_connector.c | ||
| drm_crtc_helper_internal.h | ||
| drm_crtc_helper.c | ||
| drm_crtc_internal.h | ||
| drm_crtc.c | ||
| drm_damage_helper.c | ||
| drm_debugfs_crc.c | ||
| drm_debugfs.c | ||
| drm_displayid_internal.h | ||
| drm_displayid.c | ||
| drm_drv.c | ||
| drm_dumb_buffers.c | ||
| drm_edid_load.c | ||
| drm_edid.c | ||
| drm_eld.c | ||
| drm_encoder_slave.c | ||
| drm_encoder.c | ||
| drm_exec.c | ||
| drm_fb_dma_helper.c | ||
| drm_fb_helper.c | ||
| drm_fbdev_dma.c | ||
| drm_fbdev_shmem.c | ||
| drm_fbdev_ttm.c | ||
| drm_file.c | ||
| drm_flip_work.c | ||
| drm_format_helper.c | ||
| drm_fourcc.c | ||
| drm_framebuffer.c | ||
| drm_gem_atomic_helper.c | ||
| drm_gem_dma_helper.c | ||
| drm_gem_framebuffer_helper.c | ||
| drm_gem_shmem_helper.c | ||
| drm_gem_ttm_helper.c | ||
| drm_gem_vram_helper.c | ||
| drm_gem.c | ||
| drm_gpuvm.c | ||
| drm_internal.h | ||
| drm_ioc32.c | ||
| drm_ioctl.c | ||
| drm_kms_helper_common.c | ||
| drm_lease.c | ||
| drm_managed.c | ||
| drm_mipi_dbi.c | ||
| drm_mipi_dsi.c | ||
| drm_mm.c | ||
| drm_mode_config.c | ||
| drm_mode_object.c | ||
| drm_modes.c | ||
| drm_modeset_helper.c | ||
| drm_modeset_lock.c | ||
| drm_of.c | ||
| drm_panel_orientation_quirks.c | ||
| drm_panel.c | ||
| drm_panic_qr.rs | ||
| drm_panic.c | ||
| drm_pci.c | ||
| drm_plane_helper.c | ||
| drm_plane.c | ||
| drm_prime.c | ||
| drm_print.c | ||
| drm_privacy_screen_x86.c | ||
| drm_privacy_screen.c | ||
| drm_probe_helper.c | ||
| drm_property.c | ||
| drm_rect.c | ||
| drm_self_refresh_helper.c | ||
| drm_simple_kms_helper.c | ||
| drm_suballoc.c | ||
| drm_syncobj.c | ||
| drm_sysfs.c | ||
| drm_trace_points.c | ||
| drm_trace.h | ||
| drm_vblank_work.c | ||
| drm_vblank.c | ||
| drm_vma_manager.c | ||
| drm_writeback.c | ||
| Kconfig | ||
| Makefile | ||