OpenCloudOS-Kernel/drivers/gpu/drm
Chris Wilson 1d9221e9d3 drm/i915: Skip signaling a signaled request
Preempt-to-busy introduces various fascinating complications in that the
requests may complete as we are unsubmitting them from HW. As they may
then signal after unsubmission, we may find ourselves having to cleanup
the signaling request from within the signaling callback. This causes us
to recurse onto the same i915_request.lock.

However, if the request is already signaled (as it will be before we
enter the signal callbacks), we know we can skip the signaling of that
request during submission, neatly evading the spinlock recursion.

unsubmit(ve.rq0) # timeslice expiration or other preemption
 -> virtual_submit_request(ve.rq0)
dma_fence_signal(ve.rq0) # request completed before preemption ack
 -> submit_notify(ve.rq1)
   -> virtual_submit_request(ve.rq1) # sees that we have completed ve.rq0
      -> __i915_request_submit(ve.rq0)

[  264.210142] BUG: spinlock recursion on CPU#2, sample_multi_tr/2093
[  264.210150]  lock: 0xffff9efd6ac55080, .magic: dead4ead, .owner: sample_multi_tr/2093, .owner_cpu: 2
[  264.210155] CPU: 2 PID: 2093 Comm: sample_multi_tr Tainted: G     U
[  264.210158] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWR1.R00.X212.B01.1909060036 09/06/2019
[  264.210160] Call Trace:
[  264.210167]  dump_stack+0x98/0xda
[  264.210174]  spin_dump.cold+0x24/0x3c
[  264.210178]  do_raw_spin_lock+0x9a/0xd0
[  264.210184]  _raw_spin_lock_nested+0x6a/0x70
[  264.210314]  __i915_request_submit+0x10a/0x3c0 [i915]
[  264.210415]  virtual_submit_request+0x9b/0x380 [i915]
[  264.210516]  submit_notify+0xaf/0x14c [i915]
[  264.210602]  __i915_sw_fence_complete+0x8a/0x230 [i915]
[  264.210692]  i915_sw_fence_complete+0x2d/0x40 [i915]
[  264.210762]  __dma_i915_sw_fence_wake+0x19/0x30 [i915]
[  264.210767]  dma_fence_signal_locked+0xb1/0x1c0
[  264.210772]  dma_fence_signal+0x29/0x50
[  264.210871]  i915_request_wait+0x5cb/0x830 [i915]
[  264.210876]  ? dma_resv_get_fences_rcu+0x294/0x5d0
[  264.210974]  i915_gem_object_wait_fence+0x2f/0x40 [i915]
[  264.211084]  i915_gem_object_wait+0xce/0x400 [i915]
[  264.211178]  i915_gem_wait_ioctl+0xff/0x290 [i915]

Fixes: 22b7a426bb ("drm/i915/execlists: Preempt-to-busy")
References: 6d06779e86 ("drm/i915: Load balancing across a virtual engine")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: "Nayana, Venkata Ramana" <venkata.ramana.nayana@intel.com>
Cc: <stable@vger.kernel.org> # v5.4+
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200713141636.29326-1-chris@chris-wilson.co.uk
2020-07-13 17:57:54 +01:00
..
amd drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
arc drm/arc: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:02:03 +02:00
arm drm/malidp: convert platform driver to use dev_groups 2020-06-15 14:56:09 +01:00
armada drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
aspeed drm/cma-helper: Rename symbols from drm_cma_gem_ to drm_gem_cma_ 2020-06-10 09:01:38 +02:00
ast drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
atmel-hlcdc drm/atmel-hlcdc: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:02:34 +02:00
bochs drm/bochs: Remove explicit drm_connector_register 2020-04-28 16:14:17 +02:00
bridge drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
etnaviv drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
exynos drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
fsl-dcu drm/fsl-dcu: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:02:52 +02:00
gma500 drm/gma500: Stop using mode->private_flags 2020-05-27 14:31:42 +03:00
hisilicon drm/hisilicon/kirin: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:03:13 +02:00
i2c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
i810
i915 drm/i915: Skip signaling a signaled request 2020-07-13 17:57:54 +01:00
imx drm/imx: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:03:27 +02:00
ingenic drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
lib
lima drm/lima: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:33 +01:00
mcde drm/mcde: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:04:21 +02:00
mediatek drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
meson drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
mga
mgag200 drm/mgag200: Use managed device initialization 2020-06-11 10:06:14 +02:00
msm drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
mxsfb drm/mxsfb: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:04:51 +02:00
nouveau drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
omapdrm drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
panel drm/panel: simple: Add support for KOE TX26D202VM0BWA panel 2020-06-05 17:45:26 +02:00
panfrost drm/panfrost: Use kvfree() to free bo->sgts 2020-06-19 11:00:02 +01:00
pl111 drm: pl111: Move VExpress setup into versatile init 2020-04-28 14:06:20 -05:00
qxl drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
r128 drm: delete drm_pci.h 2020-04-03 17:11:41 +02:00
radeon drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
rcar-du drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
rockchip drm/rockchip: Add per-pixel alpha support for the PX30 VOP 2020-06-17 12:04:46 +02:00
savage
scheduler drm/scheduler: fix drm_sched_get_cleanup_job 2020-04-15 11:09:13 +02:00
selftests drm/kselftest: fix spellint typo in test-drm_mm.c 2020-06-16 14:13:04 +02:00
shmobile drm/shmobile: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:05:18 +02:00
sis
sti drm/sti: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:05:45 +02:00
stm drm/stm: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE 2020-06-10 09:05:32 +02:00
sun4i drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
tdfx
tegra drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
tidss drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
tilcdc drm/tilcdc: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:05:58 +02:00
tiny drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro 2020-06-10 09:01:41 +02:00
ttm mmap locking API: convert mmap_sem comments 2020-06-09 09:39:14 -07:00
tve200 drm/tve200: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:06:11 +02:00
udl drm/udl: Use GEM vmap/mmap function from SHMEM helpers 2020-06-10 10:17:21 +02:00
v3d drm/v3d: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:35 +01:00
vboxvideo drm/vboxvideo: Use devm_gen_pool_create 2020-04-28 15:08:51 +02:00
vc4 drm/vc4: crtc: Restrict HACT_ACT setup to DSI 2020-06-10 11:09:38 +02:00
vgem drm/vgem: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:36 +01:00
via
virtio drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
vkms drm/vkms: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:36 +01:00
vmwgfx drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
xen drm/xen: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:36 +01:00
zte drm/zte: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:06:23 +02:00
Kconfig drm pull for 5.8-rc1 2020-06-02 15:04:15 -07:00
Makefile drm/cirrus: Move to drm/tiny 2020-04-28 16:05:15 +02:00
drm_agpsupport.c
drm_atomic.c drm: convert .debugfs_init() hook to return void. 2020-03-18 17:53:28 +01:00
drm_atomic_helper.c drm: use drm_dev_has_vblank more 2020-05-29 12:58:11 +02:00
drm_atomic_state_helper.c drm/atomic-helper: fix kerneldoc 2020-02-15 13:21:22 +01:00
drm_atomic_uapi.c
drm_auth.c drm/auth: make drm_{set,drop}master_ioctl symmetrical 2020-06-15 14:49:50 +01:00
drm_blend.c drm: plane: Verify that no or all planes have a zpos property 2020-05-14 02:10:52 +03:00
drm_bridge.c drm: Add helper to create a connector for a chain of bridges 2020-02-26 13:31:41 +02:00
drm_bridge_connector.c drm: Add helper to create a connector for a chain of bridges 2020-02-26 13:31:41 +02:00
drm_bufs.c drm: delete drm_pci.h 2020-04-03 17:11:41 +02:00
drm_cache.c
drm_client.c drm/client: Add drm_client_framebuffer_flush() 2020-05-26 13:31:01 +02:00
drm_client_modeset.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
drm_color_mgmt.c
drm_connector.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_context.c drm: context: Clean up documentation 2020-03-16 09:23:55 +01:00
drm_crtc.c drm: add docs for standard CRTC properties 2020-06-01 16:13:20 +02:00
drm_crtc_helper.c drm: drop unused drm_crtc callback 2020-02-15 21:15:17 +01:00
drm_crtc_helper_internal.h
drm_crtc_internal.h drm: convert .debugfs_init() hook to return void. 2020-03-18 17:53:28 +01:00
drm_damage_helper.c
drm_debugfs.c drm/debugfs: fix plain echo to connector "force" attribute 2020-05-17 17:27:57 +01:00
drm_debugfs_crc.c
drm_dma.c drm: delete drm_pci.h 2020-04-03 17:11:41 +02:00
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_dp_mst_topology.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_dp_mst_topology_internal.h
drm_drv.c drm: Add devm_drm_dev_alloc macro 2020-04-28 15:05:19 +02:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c drm: encoder_slave: use new I2C API 2020-06-19 09:20:21 +02:00
drm_fb_cma_helper.c drm: Fix misspellings of "Analog Devices" 2020-04-21 08:15:03 +02:00
drm_fb_helper.c TTY/Serial driver updates for 5.8-rc1 2020-06-07 09:52:36 -07:00
drm_file.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_flip_work.c
drm_format_helper.c drm/format-helper: Add drm_fb_swab() 2020-05-26 13:33:08 +02:00
drm_fourcc.c
drm_framebuffer.c drm: convert .debugfs_init() hook to return void. 2020-03-18 17:53:28 +01:00
drm_gem.c drm: Remove struct drm_driver.gem_print_info 2020-06-10 09:06:30 +02:00
drm_gem_cma_helper.c drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro 2020-06-10 09:01:41 +02:00
drm_gem_framebuffer_helper.c drm: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:31 +01:00
drm_gem_shmem_helper.c drm/shmem-helper: Only dma-buf imports are private obj 2020-06-16 19:11:51 +02:00
drm_gem_ttm_helper.c drm: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:31 +01:00
drm_gem_vram_helper.c drm: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:31 +01:00
drm_hashtab.c
drm_hdcp.c drm: Fix HDCP failures when SRM fw is missing 2020-05-05 14:01:53 -04:00
drm_internal.h drm: Manage drm_vblank_cleanup with drmm_ 2020-03-26 15:38:17 +01:00
drm_ioc32.c drm: print the current->comm alongside the pid 2020-05-19 22:31:37 +01:00
drm_ioctl.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_irq.c drm: use drm_dev_has_vblank more 2020-05-29 12:58:11 +02:00
drm_kms_helper_common.c
drm_lease.c drm/lease: fix WARNING in idr_destroy 2020-03-18 14:42:18 +01:00
drm_legacy.h
drm_legacy_misc.c
drm_lock.c drm: lock: Clean up documentation 2020-03-16 09:27:09 +01:00
drm_managed.c drm: Include internal header for managed function declarations 2020-05-18 16:27:54 +01:00
drm_memory.c
drm_mipi_dbi.c drm/format-helper: Add drm_fb_swab() 2020-05-26 13:33:08 +02:00
drm_mipi_dsi.c
drm_mm.c drm/mm: remove invalid entry based optimization 2020-06-15 10:51:18 +02:00
drm_mode_config.c drm: Manage drm_mode_config_init with drmm_ 2020-03-26 15:45:43 +01:00
drm_mode_object.c drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers 2020-05-05 10:51:56 +02:00
drm_modes.c drm: Flatten drm_mode_vrefresh() 2020-05-27 14:31:42 +03:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c
drm_pci.c drm: delete drm_pci.h 2020-04-03 17:11:41 +02:00
drm_plane.c drm: plane: Verify that no or all planes have a zpos property 2020-05-14 02:10:52 +03:00
drm_plane_helper.c
drm_prime.c drm: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:31 +01:00
drm_print.c
drm_probe_helper.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
drm_property.c
drm_rect.c
drm_scatter.c gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc 2020-06-02 10:59:11 -07:00
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Fix documentation for drm_simple_encoder_init() 2020-03-06 09:24:29 +01:00
drm_syncobj.c
drm_sysfs.c drm/connector: notify userspace on hotplug after register complete 2020-06-03 10:24:23 +02:00
drm_trace.h
drm_trace_points.c
drm_vblank.c drm/vblank: use drm_WARN for all warnings 2020-05-31 22:34:21 +02:00
drm_vm.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_vma_manager.c
drm_writeback.c drm/writeback: don't set fence->ops to default 2020-05-20 20:03:45 +02:00