1
0
Fork 0
alistair23-linux/drivers/gpu/drm/i915
Chris Wilson ad1df24b37 drm/i915/gt: Prevent use of engine->wa_ctx after error
commit 488751a0ef upstream.

On error we unpin and free the wa_ctx.vma, but do not clear any of the
derived flags. During lrc_init, we look at the flags and attempt to
dereference the wa_ctx.vma if they are set. To protect the error path
where we try to limp along without the wa_ctx, make sure we clear those
flags!

Reported-by: Matt Roper <matthew.d.roper@intel.com>
Fixes: 604a8f6f1e ("drm/i915/lrc: Only enable per-context and per-bb buffers if set")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.15+
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210108204026.20682-1-chris@chris-wilson.co.uk
(cherry-picked from 5b4dc95cf7)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210118095332.458813-1-chris@chris-wilson.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-27 11:47:42 +01:00
..
display drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence 2021-01-19 18:26:18 +01:00
gem drm/i915: clear the gpu reloc batch 2021-01-12 20:16:23 +01:00
gt drm/i915/gt: Prevent use of engine->wa_ctx after error 2021-01-27 11:47:42 +01:00
gvt drm/i915/gvt: do not check len & max_len for lri 2020-09-17 13:47:53 +02:00
oa drm/i915/perf: Refactor oa object to better manage resources 2019-08-07 20:34:39 +01:00
selftests drm/i915: Add missing include file <linux/math64.h> 2020-01-23 08:22:38 +01:00
Kconfig drm/i915: Update drm/i915 bug filing URL 2020-02-28 17:22:21 +01:00
Kconfig.debug kbuild: remove header compile test 2020-03-05 16:43:47 +01:00
Kconfig.profile
Makefile Kbuild updates for v5.4 2019-09-20 08:36:47 -07:00
i915_active.c drm/i915: Fix ref->mutex deadlock in i915_active_wait() 2020-04-13 10:48:15 +02:00
i915_active.h drm/i915: Fix ref->mutex deadlock in i915_active_wait() 2020-04-13 10:48:15 +02:00
i915_active_types.h drm/i915: Markup expected timeline locks for i915_active 2019-08-16 18:02:07 +01:00
i915_buddy.c drm/i915/buddy: use kmemleak_update_trace 2019-08-16 16:28:41 +01:00
i915_buddy.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_cmd_parser.c drm/i915: Fix cmd parser desc matching with masks 2020-09-03 11:27:09 +02:00
i915_debugfs.c drm/i915: Pull obj->userfault tracking under the ggtt->mutex 2019-08-22 08:53:41 +01:00
i915_debugfs.h
i915_drv.c drm fixes for 5.4-rc8 2019-11-15 08:47:34 -08:00
i915_drv.h drm/i915: Force VT'd workarounds when running as a guest OS 2020-11-05 11:43:29 +01:00
i915_fixed.h
i915_gem.c drm/i915: Wean off drm_pci_alloc/drm_pci_free 2020-02-28 17:22:21 +01:00
i915_gem.h drm/i915/gt: execlists->active is serialised by the tasklet 2019-10-09 14:39:31 -07:00
i915_gem_evict.c drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_gem_fence_reg.c drm/i915: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
i915_gem_fence_reg.h drm/i915: Track ggtt fence reservations under its own mutex 2019-08-22 08:53:40 +01:00
i915_gem_gtt.c drm/i915/userptr: fix size calculation 2020-01-29 16:45:31 +01:00
i915_gem_gtt.h drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_getparam.c drm/i915: Disable Secure Batches for gen6+ 2019-11-05 11:34:08 -08: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: Break up error capture compression loops with cond_resched() 2020-11-10 12:37:23 +01:00
i915_gpu_error.h drm/i915: Only include active engines in the capture state 2019-08-08 21:54:08 +01:00
i915_ioc32.c
i915_irq.c drm/i915/icl+: Fix hotplug interrupt disabling after storm detection 2020-06-24 17:50:51 +02:00
i915_irq.h drm/i915: Extract general GT interrupt handlers 2019-08-12 15:36:13 +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
i915_params.h
i915_pci.c drm/i915/gtt: disable 2M pages for pre-gen11 2019-08-10 13:19:00 +01:00
i915_perf.c drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_perf.h drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_pmu.c drm/i915/pmu: "Frequency" is reported as accumulated cycles 2019-11-18 09:20:38 -08:00
i915_pmu.h
i915_priolist_types.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
i915_pvinfo.h
i915_query.c drm/i915/gt: Move the [class][inst] lookup for engines onto the GT 2019-08-06 15:00:43 +01:00
i915_query.h
i915_reg.h drm/i915: Add Wa_1407352427:icl,ehl 2020-01-14 20:08:26 +01:00
i915_request.c drm/i915: Propagate error from completed fences 2020-05-27 17:46:43 +02:00
i915_request.h drm/i915: Defer semaphore priority bumping to a workqueue 2020-03-18 07:17:50 +01:00
i915_scatterlist.c
i915_scatterlist.h
i915_scheduler.c drm/i915/gt: Protect defer_request() from new waiters 2020-02-28 17:22:25 +01:00
i915_scheduler.h
i915_scheduler_types.h
i915_selftest.h drm/i915: make i915_selftest.h self-contained 2019-07-30 13:41:35 -07:00
i915_suspend.c drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03: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 drm/i915: Filter wake_flags passed to default_wake_function 2020-09-23 12:40:43 +02: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_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03: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: rename intel_drv.h to display/intel_display_types.h 2019-08-07 12:43:50 +03:00
i915_trace_points.c
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: Update drm/i915 bug filing URL 2020-02-28 17:22:21 +01:00
i915_utils.h drm/i915: be more solid in checking the alignment 2020-03-18 07:17:50 +01: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: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
i915_vma.h drm/i915: Replace i915_vma_put_fence() 2019-08-22 08:53:42 +01:00
intel_csr.c drm/i915/tgl: update DMC firmware to 2.04 2019-08-20 12:49:29 -07:00
intel_csr.h
intel_device_info.c drm/i915/tgl: add support for reading the timestamp frequency 2019-08-20 12:48:57 -07:00
intel_device_info.h drm/i915/tgl: Tigerlake only has global MOCS registers 2019-07-31 07:40:32 -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
intel_pch.c drm/i915/cml: Add second PCH ID for CMP 2019-10-09 13:00:56 -07:00
intel_pch.h drm/i915/cml: Add second PCH ID for CMP 2019-10-09 13:00:56 -07:00
intel_pm.c drm/i915: Don't enable WaIncreaseLatencyIPCEnabled when IPC is disabled 2020-05-20 08:20:20 +02:00
intel_pm.h drm/i915/gen8+: Add RC6 CTX corruption WA 2019-11-05 11:43:07 -08:00
intel_runtime_pm.c drm/i915: avoid including intel_drv.h via i915_drv.h->i915_trace.h 2019-08-07 12:43:14 +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: Drop runtime-pm assert from vgpu io accessors 2020-11-10 12:37:23 +01:00
intel_uncore.h drm/i915: split out uncore_mmio_debug 2019-08-09 20:25:24 +01:00
intel_wakeref.c drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
intel_wakeref.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01: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