linux_dsm_epyc7002/drivers/gpu/drm
Chris Wilson ca1711d199 drm/i915/gt: Close race between engine_park and intel_gt_retire_requests
The general concept was that intel_timeline.active_count was locked by
the intel_timeline.mutex. The exception was for power management, where
the engine->kernel_context->timeline could be manipulated under the
global wakeref.mutex.

This was quite solid, as we always manipulated the timeline only while
we held an engine wakeref.

And then we started retiring requests outside of struct_mutex, only
using the timelines.active_list and the timeline->mutex. There we
started manipulating intel_timeline.active_count outside of an engine
wakeref, and so introduced a race between __engine_park() and
intel_gt_retire_requests(), a race that could result in the
engine->kernel_context not being added to the active timelines and so
losing requests, which caused us to keep the system permanently powered
up [and unloadable].

The race would be easy to close if we could take the engine wakeref for
the timeline before we retire -- except timelines are not bound to any
engine and so we would need to keep all active engines awake. The
alternative is to guard intel_timeline_enter/intel_timeline_exit for use
outside of the timeline->mutex.

Fixes: e5dadff4b0 ("drm/i915: Protect request retirement with timeline->mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191120165514.3955081-1-chris@chris-wilson.co.uk
(cherry picked from commit a6edbca74b)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-11-25 15:29:42 +02:00
..
amd Merge tag 'drm-next-5.5-2019-11-08' of git://people.freedesktop.org/~agd5f/linux into drm-next 2019-11-14 08:43:07 +10:00
arc Merge tag 'arcpgu-updates-2019.07.18' of github.com:abrodkin/linux into drm-next 2019-11-14 09:28:46 +10:00
arm Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
armada
aspeed
ast drm/vram: drop DRM_VRAM_MM_FILE_OPERATIONS 2019-10-17 13:59:16 +02:00
atmel-hlcdc drm/atmel-hlcdc: Use swap() where appropriate 2019-10-11 18:22:50 +03:00
bochs drm/bochs: Replace prepare_fb()/cleanup_fb() with GEM VRAM helpers 2019-10-24 16:12:30 +02:00
bridge drm/bridge: tc358767: Use DP nomenclature 2019-10-23 18:20:05 +02:00
cirrus drm/simple-kms: Standardize arguments for callbacks 2019-10-24 13:55:56 +02:00
etnaviv Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
exynos drm/exynos: Move static keyword to the front of declaration 2019-10-28 21:12:27 +09:00
fsl-dcu
gma500 drm: Spelling s/connet/connect/ 2019-10-24 17:59:45 +02:00
hisilicon drm/hisilicon/hibmc: Use GEM VRAM's prepare_fb() and cleanup_fb() helpers 2019-10-24 16:12:36 +02:00
i2c drm: tda998x: use cec_notifier_conn_(un)register 2019-10-21 14:23:25 +02:00
i810 drm/i810: Prevent underflow in ioctl 2019-10-04 17:04:05 +01:00
i915 drm/i915/gt: Close race between engine_park and intel_gt_retire_requests 2019-11-25 15:29:42 +02:00
imx Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
ingenic
lib
lima drm/lima: add __GFP_NOWARN flag to all dma_alloc_wc 2019-10-17 23:42:02 +08:00
mcde Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
mediatek Mediatek DRM next for Linux 5.5 - 2 2019-11-08 13:19:55 +10:00
meson drm/meson: Enable DRM InfoFrame support on GXL, GXM and G12A 2019-10-10 12:50:02 +02:00
mga
mgag200 drm/vram: drop DRM_VRAM_MM_FILE_OPERATIONS 2019-10-17 13:59:16 +02:00
msm drm/msm: fix memleak on release 2019-11-13 15:34:15 -05:00
mxsfb drm/mxsfb: Read bus flags from bridge if present 2019-10-14 22:19:32 +02:00
nouveau drm/dp_mst: Add basic topology reprobing when resuming 2019-10-24 14:29:48 -04:00
omapdrm Merge drm/drm-next into drm-misc-next 2019-10-23 11:14:11 -04:00
panel Linux 5.4-rc4 2019-10-23 12:10:05 +02:00
panfrost Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
pl111 drm/simple-kms: Standardize arguments for callbacks 2019-10-24 13:55:56 +02:00
qxl drm/qxl: stop using TTM to call driver internal functions 2019-10-25 11:40:51 +02:00
r128
radeon Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
rcar-du drm: rcar-du: lvds: Add r8a774b1 support 2019-10-16 00:28:32 +03:00
rockchip drm/rockchip: Avoid drm_dp_link helpers 2019-10-23 18:21:01 +02:00
savage
scheduler drm/sched: Avoid job cleanup if sched thread is parked. 2019-11-07 18:08:07 -05:00
selftests drm/mm: Use helpers for drm_mm_node booleans 2019-10-04 13:42:33 +01:00
shmobile
sis
sti
stm
sun4i drm/sun4i: Enable DRM InfoFrame support on H6 2019-10-10 12:50:03 +02:00
tdfx
tegra drm/tegra: Unconditionally select IOMMU_IOVA 2019-11-01 10:49:29 +01:00
tilcdc drm-misc-next for 5.5: 2019-10-11 09:30:53 +10:00
tiny drm/shmem: drop DEFINE_DRM_GEM_SHMEM_FOPS 2019-10-17 13:59:16 +02:00
ttm drm/ttm, drm/vmwgfx: Use a configuration option for the TTM dma page pool 2019-11-14 08:41:23 +01:00
tve200
udl
v3d Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
vboxvideo drm/vboxvideo: Use drm_gem_fb_create_with_dirty instead of drm_gem_fb_create 2019-10-29 13:10:07 +01:00
vc4 Merge drm/drm-next into drm-misc-next 2019-10-23 11:14:11 -04:00
vgem
via
virtio drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function 2019-10-22 11:34:03 +02:00
vkms drm/vkms: Remove duplicated include from vkms_drv.c 2019-10-10 15:45:35 +02:00
vmwgfx drm/vmwgfx: remove set but not used variable 'srf' 2019-11-14 08:41:36 +01:00
xen drm/simple-kms: Standardize arguments for callbacks 2019-10-24 13:55:56 +02:00
zte
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c Linux 5.4-rc7 2019-11-14 05:53:10 +10:00
drm_atomic_state_helper.c
drm_atomic_uapi.c Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
drm_atomic.c
drm_auth.c
drm_blend.c drm: two planes with the same zpos have undefined ordering 2019-10-09 20:04:55 +02:00
drm_bridge.c
drm_bufs.c
drm_cache.c drm/gpu: Fix Memory barrier without comment Issue 2019-10-25 09:35:06 +02:00
drm_client_modeset.c Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
drm_client.c
drm_color_mgmt.c
drm_connector.c
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
drm_crtc_internal.h
drm_crtc.c
drm_damage_helper.c drm: damage_helper: Fix race checking plane->state->fb 2019-10-08 09:41:06 -04:00
drm_debugfs_crc.c drm: Fix return type of crc .poll() 2019-09-30 20:17:31 +03:00
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c drm_dp_cec: drop use of drmP.h 2019-10-08 18:29:00 +02:00
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/tegra: Move drm_dp_link helpers to Tegra DRM 2019-10-23 18:22:10 +02:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/mst: Fix up u64 division 2019-11-06 15:20:37 -05:00
drm_drv.c Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00
drm_dsc.c drm/dsc: Fix bogus cpu_to_be16() usage 2019-09-30 20:15:53 +03:00
drm_dumb_buffers.c
drm_edid_load.c drm/print: add drm_debug_enabled() 2019-10-02 16:28:55 +03:00
drm_edid.c Merge drm/drm-next into drm-misc-next 2019-10-23 11:14:11 -04:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: Remove drm_fb_helper_defio_init() and update docs 2019-10-28 10:07:54 +01:00
drm_file.c
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap 2019-10-29 13:29:21 -05:00
drm_gem_ttm_helper.c drm/ttm: add drm_gem_ttm_mmap() 2019-10-17 13:59:16 +02:00
drm_gem_vram_helper.c drm/ttm: remove pointers to globals 2019-10-25 11:40:51 +02:00
drm_gem.c drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap 2019-10-29 13:29:21 -05:00
drm_hashtab.c
drm_hdcp.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy_misc.c
drm_legacy.h
drm_lock.c
drm_memory.c drm: Include prototype for drm_need_swiotlb() 2019-09-30 20:16:28 +03:00
drm_mipi_dbi.c drm/mipi_dbi: Use simple right shift instead of double negation 2019-10-22 15:09:15 +02:00
drm_mipi_dsi.c
drm_mm.c drm/mm: Use clear_bit_unlock() for releasing the drm_mm_node() 2019-10-04 13:43:43 +01:00
drm_mode_config.c drm/doc: Drop misleading comment on drm_mode_config_cleanup 2019-10-23 11:00:41 +02:00
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_pci.c
drm_plane_helper.c
drm_plane.c
drm_prime.c drm: add mmap() to drm_gem_object_funcs 2019-10-17 13:59:16 +02:00
drm_print.c drm/print: add drm_debug_enabled() 2019-10-02 16:28:55 +03:00
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c drm/atomic: fix self-refresh helpers crtc state dereference 2019-11-06 13:00:21 -05:00
drm_simple_kms_helper.c drm/simple-kms: Standardize arguments for callbacks 2019-10-24 13:55:56 +02:00
drm_syncobj.c drm/syncobj: extend syncobj query ability v3 2019-10-18 12:24:56 +02:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vblank.c drm/drm_vblank: Change EINVAL by the correct errno 2019-10-08 18:43:26 -04:00
drm_vm.c
drm_vma_manager.c
drm_vram_helper_common.c
drm_writeback.c
Kconfig drm/ttm, drm/vmwgfx: Use a configuration option for the TTM dma page pool 2019-11-14 08:41:23 +01:00
Makefile Merge drm/drm-next into drm-misc-next 2019-10-03 16:38:50 +02:00