Revert "drm/i915: Hold reference to intel_context over life of i915_request"
authorNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Tue, 14 Jun 2022 18:43:47 +0000 (00:13 +0530)
committerRamalingam C <ramalingam.c@intel.com>
Mon, 27 Jun 2022 18:17:26 +0000 (23:47 +0530)
commitbcb9aa45d5a0e11ef91245330c53cde214d15e8d
tree631e13bea111579a43959da6bdaa7b6120765194
parent7307e91bfcd0e3f123aab01b30557f93923b6d73
Revert "drm/i915: Hold reference to intel_context over life of i915_request"

This reverts commit 1e98d8c52ed5dfbaf273c4423c636525c2ce59e7.

The problem with this patch is that it makes i915_request to hold a
reference to intel_context, which in turn holds a reference on the VM.
This strong back referencing can lead to reference loops which leads
to resource leak.

An example is the upcoming VM_BIND work which requires VM to hold
a reference to some shared VM specific BO. But this BO's dma-resv
fences holds reference to the i915_request thus leading to reference
loop.

v2:
  Do not use reserved requests for virtual engines

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Mathew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614184348.23746-3-ramalingam.c@intel.com
drivers/gpu/drm/i915/i915_request.c