linux-stable/drivers/gpu/drm/i915/gem
Chris Wilson 47bf7b7a71 drm/i915/gem: Remove object_is_locked assertion from unpin_from_display_plane
Since moving the obj->vma.list to a spin_lock, and the vm->bound_list to
its vm->mutex, along with tracking shrinkable status under its own
spinlock, we no long require the object to be locked by the caller.

This is fortunate as it appears we can be called with the lock along an
error path in flipping:

<4> [139.942851] WARN_ON(debug_locks && !lock_is_held(&(&((obj)->base.resv)->lock.base)->dep_map))
<4> [139.943242] WARNING: CPU: 0 PID: 1203 at drivers/gpu/drm/i915/gem/i915_gem_domain.c:405 i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915]
<4> [139.943263] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_realtek snd_hda_codec_generic coretemp snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core r8169 lpc_ich snd_pcm realtek prime_numbers [last unloaded: i915]
<4> [139.943347] CPU: 0 PID: 1203 Comm: kms_flip Tainted: G     U            5.6.0-gd0fda5c2cf3f1-drmtip_474+ #1
<4> [139.943363] Hardware name:  /D510MO, BIOS MOPNV10J.86A.0311.2010.0802.2346 08/02/2010
<4> [139.943589] RIP: 0010:i915_gem_object_unpin_from_display_plane+0x70/0x130 [i915]
<4> [139.943589] Code: 85 28 01 00 00 be ff ff ff ff 48 8d 78 60 e8 d7 9b f0 e2 85 c0 75 b9 48 c7 c6 50 b9 38 c0 48 c7 c7 e9 48 3c c0 e8 20 d4 e9 e2 <0f> 0b eb a2 48 c7 c1 08 bb 38 c0 ba 0a 01 00 00 48 c7 c6 88 a3 35
<4> [139.943589] RSP: 0018:ffffb774c0603b48 EFLAGS: 00010282
<4> [139.943589] RAX: 0000000000000000 RBX: ffff9a142fa36e80 RCX: 0000000000000006
<4> [139.943589] RDX: 000000000000160d RSI: ffff9a142c1a88f8 RDI: ffffffffa434a64d
<4> [139.943589] RBP: ffff9a1410a513c0 R08: ffff9a142c1a88f8 R09: 0000000000000000
<4> [139.943589] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9a1436ee94b8
<4> [139.943589] R13: 0000000000000001 R14: 00000000ffffffff R15: ffff9a1410960000
<4> [139.943589] FS:  00007fc73a744e40(0000) GS:ffff9a143da00000(0000) knlGS:0000000000000000
<4> [139.943589] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4> [139.943589] CR2: 00007fc73997e098 CR3: 000000002f5fe000 CR4: 00000000000006f0
<4> [139.943589] Call Trace:
<4> [139.943589]  intel_pin_and_fence_fb_obj+0x1c9/0x1f0 [i915]
<4> [139.943589]  intel_plane_pin_fb+0x3f/0xd0 [i915]
<4> [139.943589]  intel_prepare_plane_fb+0x13b/0x5c0 [i915]
<4> [139.943589]  drm_atomic_helper_prepare_planes+0x85/0x110
<4> [139.943589]  intel_atomic_commit+0xda/0x390 [i915]
<4> [139.943589]  drm_atomic_helper_page_flip+0x9c/0xd0
<4> [139.943589]  ? drm_event_reserve_init+0x46/0x60
<4> [139.943589]  drm_mode_page_flip_ioctl+0x587/0x5d0

This completes the symmetry lost in commit 8b1c78e06e ("drm/i915: Avoid
calling i915_gem_object_unbind holding object lock").

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1743
Fixes: 8b1c78e06e ("drm/i915: Avoid calling i915_gem_object_unbind holding object lock")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: <stable@vger.kernel.org> # v5.6+
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420125356.26614-1-chris@chris-wilson.co.uk
(cherry picked from commit a95f3ac21d)
(cherry picked from commit 2208b85fa1766ee4821a9435d548578b67090531)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2020-05-06 15:37:31 -07:00
..
selftests drm/i915/selftests: Fix i915_address_space refcnt leak 2020-04-27 09:47:33 -07:00
i915_gem_busy.c drm/i915: Align engine->uabi_class/instance with i915_drm.h 2020-01-20 09:13:01 +00:00
i915_gem_clflush.c drm/i915: Hold reference to intel_frontbuffer as we track activity 2019-12-18 12:09:57 +00:00
i915_gem_clflush.h
i915_gem_client_blt.c drm/i915: Apply i915_request_skip() on submission 2020-03-04 14:29:50 +00:00
i915_gem_client_blt.h
i915_gem_context.c drm/i915: Use explicit flag to mark unreachable intel_context 2020-03-26 10:21:04 -07:00
i915_gem_context.h drm/i915/gem: Check for a closed context when looking up an engine 2020-03-20 07:04:41 -07:00
i915_gem_context_types.h drm/i915/gem: use spinlock_t instead of struct spinlock 2020-02-19 15:08:49 +02:00
i915_gem_dmabuf.c drm/i915: Skip CPU synchronisation on dmabuf attachments 2020-02-11 00:16:15 +00:00
i915_gem_domain.c drm/i915/gem: Remove object_is_locked assertion from unpin_from_display_plane 2020-05-06 15:37:31 -07:00
i915_gem_execbuffer.c drm/i915/gem: Flush all the reloc_gpu batch 2020-04-06 10:31:38 -07:00
i915_gem_fence.c
i915_gem_internal.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
i915_gem_ioctls.h drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET 2019-12-04 15:11:44 +00:00
i915_gem_lmem.c drm/i915/gem: Support discontiguous lmem object maps 2020-01-03 11:26:01 +00:00
i915_gem_lmem.h drm/i915/gem: Support discontiguous lmem object maps 2020-01-03 11:26:01 +00:00
i915_gem_mman.c drm/i915/gem: Mark up the racy read of the mmap_singleton 2020-03-11 12:00:02 +00:00
i915_gem_mman.h drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET 2019-12-04 15:11:44 +00:00
i915_gem_object.c drm/i915/gem: Break up long lists of object reclaim 2020-02-21 17:32:17 +00:00
i915_gem_object.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
i915_gem_object_blt.c drm/i915: Add Wa_1209644611:icl,ehl 2020-03-13 08:59:01 -07:00
i915_gem_object_blt.h
i915_gem_object_types.h drm/i915: Never allow userptr into the new mapping types 2020-02-08 11:26:03 +00:00
i915_gem_pages.c drm/i915/gem: manual conversion to struct drm_device logging macros. 2020-01-27 11:07:06 +02:00
i915_gem_phys.c drm/i915/phys: unconditionally call release_memory_region 2020-03-06 10:05:17 +00:00
i915_gem_pm.c drm/i915/gem: Make WARN* drm specific where drm_priv ptr is available 2020-01-22 17:52:39 +02:00
i915_gem_pm.h drm/i915: Teach record_defaults to operate on the intel_gt 2019-10-22 20:43:07 +01:00
i915_gem_region.c drm/i915/gem: Single page objects are naturally contiguous 2020-01-02 21:21:17 +00:00
i915_gem_region.h drm/i915/region: support contiguous allocations 2019-10-08 20:50:01 +01:00
i915_gem_shmem.c drm/i915/gem: Make WARN* drm specific where drm_priv ptr is available 2020-01-22 17:52:39 +02:00
i915_gem_shrinker.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
i915_gem_shrinker.h
i915_gem_stolen.c drm/i915/vgpu: improve vgpu abstractions 2020-03-03 17:46:54 +02:00
i915_gem_stolen.h drm/i915/display: Be explicit in handling the preallocated vma 2020-02-05 09:20:39 +00:00
i915_gem_throttle.c
i915_gem_tiling.c drm/i915/gem: Hold obj->vma.lock over for_each_ggtt_vma() 2020-04-27 09:47:37 -07:00
i915_gem_userptr.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
i915_gem_wait.c
i915_gemfs.c
i915_gemfs.h