OpenCloudOS-Kernel/drivers/gpu/drm/i915
Chris Wilson a6edbca74b 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
2019-11-20 16:57:33 +00:00
..
display drm/i915: Do not initialize display BW when display not available 2019-11-20 17:43:47 +02:00
gem drm/i915/selftests: Take a ref to the request we wait upon 2019-11-20 10:46:02 +00:00
gt drm/i915/gt: Close race between engine_park and intel_gt_retire_requests 2019-11-20 16:57:33 +00:00
gvt drm/i915: make more headers self-contained 2019-11-08 10:16:13 +00:00
oa drm/i915/tgl: Add perf support on TGL 2019-10-29 12:53:54 +02:00
selftests drm/i915/selftests: Be explicit in ERR_PTR handling 2019-11-20 10:37:43 +00:00
Kconfig drm/i915: Put future HW and their uAPIs under STAGING & BROKEN 2019-10-27 15:47:10 +00:00
Kconfig.debug Merge drm/drm-next into drm-intel-next-queued 2019-11-15 13:17:39 +02:00
Kconfig.profile drm/i915/gt: Make timeslice duration configurable 2019-10-29 16:23:55 +00:00
Kconfig.unstable drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
Makefile drm/i915/selftests: Wrap vm_mmap() around GEM objects 2019-11-07 21:22:58 +00:00
i915_active.c drm/i915: Mark up the calling context for intel_wakeref_put() 2019-11-20 15:59:23 +00:00
i915_active.h drm/i915/selftests: Flush all active callbacks 2019-11-02 08:34:53 +00:00
i915_active_types.h drm/i915: Split i915_active.mutex into an irq-safe spinlock for the rbtree 2019-11-14 17:43:41 +00:00
i915_buddy.c drm/i915/buddy: add missing call to i915_global_register 2019-09-09 10:58:20 +01:00
i915_buddy.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_cmd_parser.c drm/i915/cmdparser: Fix jump whitelist clearing 2019-11-11 08:13:49 -08:00
i915_debugfs.c drm/i915: Perform automated conversions for crtc uapi/hw split, base -> uapi. 2019-11-01 14:51:21 +01:00
i915_debugfs.h
i915_drv.c Skip MCHBAR queries when display is not available 2019-11-20 17:43:47 +02:00
i915_drv.h drm/i915: Change .crtc_enable/disable() calling convention 2019-11-20 17:43:47 +02:00
i915_fixed.h
i915_gem.c drm/i915/gem: Purge the sudden reappearance of i915_gem_object_pin() 2019-11-15 21:32:18 +00:00
i915_gem.h drm/i915/gem: Manually dump the debug trace on GEM_BUG_ON 2019-11-19 17:44:39 +00:00
i915_gem_evict.c drm/i915: Move request runtime management onto gt 2019-10-04 15:39:26 +01:00
i915_gem_fence_reg.c drm/i915: set num_fence_regs to 0 if there is no aperture 2019-10-29 10:35:47 +00:00
i915_gem_fence_reg.h drm/i915: Store i915_ggtt as the backpointer on fence registers 2019-10-16 19:41:36 +01:00
i915_gem_gtt.c drm/i915: Leave the aliasing-ppgtt size alone 2019-11-11 10:30:02 +02:00
i915_gem_gtt.h drm/i915: define i915_ggtt_has_aperture 2019-10-29 10:31:40 +00:00
i915_getparam.c Backmerge i915 security patches from commit 'ea0b163b13ff' into drm-next 2019-11-14 11:09:06 +10:00
i915_globals.c drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_globals.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_gpu_error.c drm/i915: Avoid atomic context for error capture 2019-11-13 23:20:48 +00:00
i915_gpu_error.h drm/i915/tgl: Add gam instdone 2019-10-30 09:15:27 +00:00
i915_ioc32.c
i915_irq.c drm/i915/tgl: Handle AUX interrupts for TC ports 2019-10-28 08:27:04 -07:00
i915_irq.h drm/i915: Extract the GuC interrupt handlers 2019-10-26 19:28:59 +01:00
i915_memcpy.c drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_memcpy.h drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_mm.c drm/i915: Drop expectations of VM_IO from our GGTT mmappings 2019-08-07 12:06:07 +01:00
i915_params.c drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
i915_params.h drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
i915_pci.c drm/i915/selftests: Perform some basic cycle counting of MI ops 2019-11-11 18:30:13 +00:00
i915_perf.c drm/i915/perf: Add preemption check while waiting for OA 2019-11-15 16:43:33 +00:00
i915_perf.h drm/i915/perf: introduce a versioning of the i915-perf uapi 2019-10-14 21:30:25 +01:00
i915_perf_types.h drm/i915/perf: Describe structure members in documentation 2019-10-24 15:01:35 +01:00
i915_pmu.c drm/i915: Mark up the calling context for intel_wakeref_put() 2019-11-20 15:59:23 +00:00
i915_pmu.h drm/i915/pmu: Support multiple GPUs 2019-10-17 10:50:47 +01:00
i915_priolist_types.h drm/i915/gt: Replace hangcheck by heartbeats 2019-10-23 23:52:10 +01:00
i915_pvinfo.h
i915_query.c drm/i915: add support for perf configuration queries 2019-10-14 21:30:26 +01:00
i915_query.h
i915_reg.h drm/i915: Fix frame start delay programming 2019-11-15 20:35:04 +02:00
i915_request.c drm/i915: Extract GT render power state management 2019-10-26 19:28:59 +01:00
i915_request.h drm/i915: Mark up "sentinel" requests 2019-10-12 08:51:17 +01:00
i915_scatterlist.c
i915_scatterlist.h drm/i915: s/for_each_sgt_dma/for_each_sgt_daddr/ 2019-08-29 21:59:16 +01:00
i915_scheduler.c drm/i915: Protect request peeking with RCU 2019-11-05 09:56:03 +02:00
i915_scheduler.h drm/i915/execlists: Don't merely skip submission if maybe timeslicing 2019-10-18 11:23:26 +01:00
i915_scheduler_types.h drm/i915: Note the addition of timeslicing to the pretend scheduler 2019-10-11 09:36:16 +01:00
i915_selftest.h drm/i915/selftests: Perform some basic cycle counting of MI ops 2019-11-11 18:30:13 +00:00
i915_suspend.c drm/i915: Drop struct_mutex from suspend state save/restore 2019-10-04 15:39:41 +01:00
i915_suspend.h drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03:00
i915_sw_fence.c Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
i915_sw_fence.h Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
i915_sw_fence_work.c drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_sw_fence_work.h drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_switcheroo.c drm/i915: split out i915_switcheroo.[ch] from i915_drv.c 2019-10-06 11:25:00 +03:00
i915_switcheroo.h drm/i915: split out i915_switcheroo.[ch] from i915_drv.c 2019-10-06 11:25:00 +03:00
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915: Extract GT render power state management 2019-10-26 19:28:59 +01:00
i915_sysfs.h drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03:00
i915_trace.h drm/i915: Move context management under GEM 2019-10-04 15:39:34 +01:00
i915_trace_points.c
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: Rename "inject_load_failure" module parameter 2019-10-29 15:37:57 +00:00
i915_utils.h drm/i915: Fix i915_inject_load_error() name to read *_probe_* 2019-10-29 15:37:57 +00:00
i915_vgpu.c drm/i915: to make vgpu ppgtt notificaiton as atomic operation 2019-09-06 09:53:12 -07:00
i915_vgpu.h
i915_vma.c drm/i915: Split detaching and removing the vma 2019-10-31 14:52:19 +00:00
i915_vma.h drm/i915: Lift i915_vma_parked() onto the gt 2019-10-21 21:07:56 +01:00
intel_csr.c drm/i915/dmc: Update ICL DMC version to v1.09 2019-09-27 10:20:39 -07:00
intel_csr.h
intel_device_info.c drm/i915/display/cnl+: Handle fused off DSC 2019-10-29 12:12:49 -07:00
intel_device_info.h drm/i915/display/cnl+: Handle fused off DSC 2019-10-29 12:12:49 -07:00
intel_gvt.c drm/i915: Add i915 to i915_inject_probe_failure 2019-08-02 21:14:29 +01:00
intel_gvt.h drm/i915: Propagate "_remove" function name suffix down 2019-07-12 13:05:08 +01:00
intel_memory_region.c drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
intel_memory_region.h drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
intel_pch.c drm/i915: Fix detection for a CMP-V PCH 2019-11-13 14:03:15 +02:00
intel_pch.h drm/i915: Fix detection for a CMP-V PCH 2019-11-13 14:03:15 +02:00
intel_pm.c drm/i915: Change watermark hook calling convention 2019-11-20 17:43:47 +02:00
intel_pm.h drm/i915/gen8+: Add RC6 CTX corruption WA 2019-11-05 11:43:07 -08:00
intel_region_lmem.c drm/i915/lmem: fixup fake lmem teardown 2019-11-06 14:34:10 +00:00
intel_region_lmem.h drm/i915/lmem: add the fake lmem region 2019-10-31 20:41:47 +00:00
intel_runtime_pm.c drm/i915/display: abstract all vgaarb access to intel_vga.[ch] 2019-10-02 13:31:54 +03:00
intel_runtime_pm.h Merge drm/drm-next into drm-intel-next-queued 2019-07-29 08:51:48 -07:00
intel_sideband.c drm/i915: remove unnecessary includes of intel_display_types.h header 2019-08-07 12:43:55 +03:00
intel_sideband.h
intel_uncore.c drm/i915/tgl: Introduce gen12 forcewake ranges 2019-09-13 20:07:36 +01:00
intel_uncore.h drm/i915: Only apply a rmw mmio update if the value changes 2019-09-17 15:25:40 +01:00
intel_wakeref.c drm/i915: Mark up the calling context for intel_wakeref_put() 2019-11-20 15:59:23 +00:00
intel_wakeref.h drm/i915: Mark up the calling context for intel_wakeref_put() 2019-11-20 15:59:23 +00:00
intel_wopcm.c drm/i915/wopcm: Fix SPDX tag location 2019-08-16 16:50:03 +01:00
intel_wopcm.h drm/i915/wopcm: Don't fail on WOPCM partitioning failure 2019-08-02 21:14:32 +01:00