linux/drivers/gpu/drm
Qiang Yu b74e2476ef drm/amdgpu: check vm ready by amdgpu_vm->evicting flag
Workstation application ANSA/META v21.1.4 get this error dmesg when
running CI test suite provided by ANSA/META:
[drm:amdgpu_gem_va_ioctl [amdgpu]] *ERROR* Couldn't update BO_VA (-16)

This is caused by:
1. create a 256MB buffer in invisible VRAM
2. CPU map the buffer and access it causes vm_fault and try to move
   it to visible VRAM
3. force visible VRAM space and traverse all VRAM bos to check if
   evicting this bo is valuable
4. when checking a VM bo (in invisible VRAM), amdgpu_vm_evictable()
   will set amdgpu_vm->evicting, but latter due to not in visible
   VRAM, won't really evict it so not add it to amdgpu_vm->evicted
5. before next CS to clear the amdgpu_vm->evicting, user VM ops
   ioctl will pass amdgpu_vm_ready() (check amdgpu_vm->evicted)
   but fail in amdgpu_vm_bo_update_mapping() (check
   amdgpu_vm->evicting) and get this error log

This error won't affect functionality as next CS will finish the
waiting VM ops. But we'd better clear the error log by checking
the amdgpu_vm->evicting flag in amdgpu_vm_ready() to stop calling
amdgpu_vm_bo_update_mapping() later.

Another reason is amdgpu_vm->evicted list holds all BOs (both
user buffer and page table), but only page table BOs' eviction
prevent VM ops. amdgpu_vm->evicting flag is set only for page
table BOs, so we should use evicting flag instead of evicted list
in amdgpu_vm_ready().

The side effect of this change is: previously blocked VM op (user
buffer in "evicted" list but no page table in it) gets done
immediately.

v2: update commit comments.

Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Qiang Yu <qiang.yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-02-23 14:26:36 -05:00
..
amd drm/amdgpu: check vm ready by amdgpu_vm->evicting flag 2022-02-23 14:26:36 -05:00
arm drm/connector: Fix typo in output format 2022-01-25 10:01:44 +01:00
armada Char/Misc driver update for 5.16-rc1 2021-11-04 08:21:47 -07:00
aspeed Linux 5.16-rc5 2021-12-14 10:24:28 +01:00
ast Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
atmel-hlcdc drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
bridge Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
dp drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
etnaviv Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
exynos drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
fsl-dcu drm: fsl-dcu: select CONFIG_DRM_GEM_CMA_HELPER 2021-12-06 09:30:16 +01:00
gma500 drm/gma: Remove calls to kmap() 2022-01-24 17:02:43 +01:00
gud dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
hisilicon drm/hisilicon/hibmc: Replace module initialization with DRM helpers 2022-01-19 18:40:13 +01:00
hyperv dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
i2c
i810
i915 Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
imx drm/imx/dcss: Replace module initialization with DRM helpers 2022-01-19 18:40:23 +01:00
ingenic drm/ingenic: Add support for JZ4780 and HDMI output 2021-12-16 15:22:17 +00:00
kmb drm/kmb: Fix for build errors with Warray-bounds 2022-01-27 14:30:36 -08:00
lib
lima dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
mcde drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
mediatek dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
meson drm/meson: Fix error handling when afbcd.ops->init fails 2022-01-03 12:28:37 +01:00
mga
mgag200 Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
msm Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
mxsfb Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
nouveau Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
omapdrm drm: omapdrm: Fix implicit dma_buf fencing 2022-01-06 15:31:33 +02:00
panel Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
panfrost Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
pl111 drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
qxl dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
r128
radeon drm/radeon: Fix backlight control on iMac 12,1 2022-02-14 15:08:41 -05:00
rcar-du drm-misc-next for 5.17: 2021-12-10 15:08:21 +10:00
rockchip Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
savage
scheduler drm-misc-next for 5.17: 2021-11-23 09:38:55 +10:00
selftests drm/selftests/test-drm_dp_mst_helper: Fix memory leak in sideband_msg_req_encode_decode 2022-01-19 16:14:45 +01:00
shmobile drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
sis
sprd drm/sprd: add Unisoc's drm mipi dsi&dphy driver 2021-12-10 12:38:10 +01:00
sti drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
stm drm/stm: ltdc: Drop format_mod_supported function 2022-01-13 14:11:56 +01:00
sun4i Two DT bindings fixes for meson, a device refcounting fix for sun4i, a 2022-01-14 15:17:17 +01:00
tdfx
tegra Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
tidss drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
tilcdc drm/tilcdc: add const to of_device_id 2021-12-16 16:51:47 +02:00
tiny Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
ttm Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
tve200 drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
udl dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
v3d drm/v3d/v3d_drv: Check for error num after setting mask 2022-01-11 19:07:42 -01:00
vboxvideo dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
vc4 Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
vgem drm: Return error codes from struct drm_driver.gem_create_object 2021-12-02 11:12:39 +01:00
via
virtio drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
vkms Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
vmwgfx drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
xen dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
xlnx drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
drm_agpsupport.c
drm_aperture.c
drm_atomic.c Merge drm/drm-fixes into drm-misc-fixes 2022-01-26 09:40:24 +01:00
drm_atomic_helper.c drm: fix error found in some cases after the patch d1af5cd86997 2022-01-14 14:31:54 +01:00
drm_atomic_state_helper.c
drm_atomic_uapi.c drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c 2021-11-26 16:45:22 +01:00
drm_auth.c drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c 2021-11-26 16:45:22 +01:00
drm_blend.c
drm_bridge.c
drm_bridge_connector.c
drm_buddy.c drm: move the buddy allocator from i915 into common drm 2022-01-19 08:17:07 +01:00
drm_bufs.c
drm_cache.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_client.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_client_modeset.c
drm_color_mgmt.c drm/docs: Document where the C8 color lut is stored 2022-01-25 09:36:20 +01:00
drm_connector.c drm/connector: use drm_sysfs_connector_hotplug_event 2021-11-02 14:27:11 +01:00
drm_context.c
drm_crtc.c
drm_crtc_helper.c
drm_crtc_helper_internal.h drm/dp: Move DP declarations into separate header file 2022-01-17 11:25:44 +01:00
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_displayid.c
drm_dma.c
drm_drv.c
drm_dsc.c drm/dp: Move public DisplayPort headers into dp/ 2022-01-17 11:25:44 +01:00
drm_dumb_buffers.c
drm_edid.c drm/edid: Support type 7 timings 2022-01-25 13:09:22 +02:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_file.c
drm_flip_work.c
drm_format_helper.c drm/format-helper: Add drm_fb_xrgb8888_to_xrgb2101010_toio() 2021-12-16 11:06:30 +01:00
drm_fourcc.c drm/fourcc: Add packed 10bit YUV 4:2:0 format 2021-12-16 11:23:22 +01:00
drm_framebuffer.c
drm_gem.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_atomic_helper.c
drm_gem_cma_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_framebuffer_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_shmem_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_ttm_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_vram_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_hashtab.c drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_hdcp.c
drm_internal.h dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c drm/dp: Move DisplayPort helpers into separate helper module 2022-01-17 11:25:44 +01:00
drm_lease.c
drm_legacy.h drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_mipi_dsi.c
drm_mm.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_nomodeset.c drm: Fix build error caused by missing drm_nomodeset.o 2021-11-27 21:05:58 +01:00
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c Merge drm/drm-next into drm-intel-next 2022-01-31 13:19:33 -05:00
drm_pci.c
drm_plane.c drm/plane: Make format_mod_supported truly optional 2022-01-06 00:52:57 +01:00
drm_plane_helper.c
drm_prime.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_print.c
drm_privacy_screen.c Linux 5.17-rc4 2022-02-14 10:52:27 +10:00
drm_privacy_screen_x86.c drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
drm_probe_helper.c drm/probe-helper: use drm_kms_helper_connector_hotplug_event 2021-11-02 14:27:14 +01:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence. 2021-12-08 17:19:48 +01:00
drm_sysfs.c drm/sysfs: introduce drm_sysfs_connector_hotplug_event 2021-11-02 14:27:06 +01:00
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm/selftests: Select DRM_DP_HELPER 2022-01-19 11:15:05 +01:00
Makefile drm: move the buddy allocator from i915 into common drm 2022-01-19 08:17:07 +01:00