Chris Wilson
36deeddcd3
drm/i915/gt: Save irqstate around virtual_context_destroy
As virtual_context_destroy() may be called from a request signal, it may
be called from inside an irq-off section, and so we need to do a full
save/restore of the irq state rather than blindly re-enable irqs upon
unlocking.
<4> [110.024262] WARNING: inconsistent lock state
<4> [110.024277] 5.4.0-rc8-CI-CI_DRM_7489+ #1 Tainted: G U
<4> [110.024292] --------------------------------
<4> [110.024305] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
<4> [110.024323] kworker/0:0/5 [HC0[0]:SC0[0]:HE1:SE1] takes:
<4> [110.024338] ffff88826a0c7a18 (&(&rq->lock)->rlock){?.-.}, at: i915_request_retire+0x221/0x930 [i915]
<4> [110.024592] {IN-HARDIRQ-W} state was registered at:
<4> [110.024612] lock_acquire+0xa7/0x1c0
<4> [110.024627] _raw_spin_lock_irqsave+0x33/0x50
<4> [110.024788] intel_engine_breadcrumbs_irq+0x38c/0x600 [i915]
<4> [110.024808] irq_work_run_list+0x49/0x70
<4> [110.024824] irq_work_run+0x26/0x50
<4> [110.024839] smp_irq_work_interrupt+0x44/0x1e0
<4> [110.024855] irq_work_interrupt+0xf/0x20
<4> [110.024871] __do_softirq+0xb7/0x47f
<4> [110.024885] irq_exit+0xba/0xc0
<4> [110.024898] do_IRQ+0x83/0x160
<4> [110.024910] ret_from_intr+0x0/0x1d
<4> [110.024922] irq event stamp: 172864
<4> [110.024938] hardirqs last enabled at (172863): [<ffffffff819ea214>] _raw_spin_unlock_irq+0x24/0x50
<4> [110.024963] hardirqs last disabled at (172864): [<ffffffff819e9fba>] _raw_spin_lock_irq+0xa/0x40
<4> [110.024988] softirqs last enabled at (172812): [<ffffffff81c00385>] __do_softirq+0x385/0x47f
<4> [110.025012] softirqs last disabled at (172797): [<ffffffff810b829a>] irq_exit+0xba/0xc0
<4> [110.025031]
other info that might help us debug this:
<4> [110.025049] Possible unsafe locking scenario:
<4> [110.025065] CPU0
<4> [110.025075] ----
<4> [110.025084] lock(&(&rq->lock)->rlock);
<4> [110.025099] <Interrupt>
<4> [110.025109] lock(&(&rq->lock)->rlock);
<4> [110.025124]
*** DEADLOCK ***
<4> [110.025144] 4 locks held by kworker/0:0/5:
<4> [110.025156] #0: ffff88827588f528 ((wq_completion)events){+.+.}, at: process_one_work+0x1de/0x620
<4> [110.025187] #1: ffffc9000006fe78 ((work_completion)(&engine->retire_work)){+.+.}, at: process_one_work+0x1de/0x620
<4> [110.025219] #2: ffff88825605e270 (&kernel#2){+.+.}, at: engine_retire+0x57/0xe0 [i915]
<4> [110.025405] #3: ffff88826a0c7a18 (&(&rq->lock)->rlock){?.-.}, at: i915_request_retire+0x221/0x930 [i915]
<4> [110.025634]
stack backtrace:
<4> [110.025653] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G U 5.4.0-rc8-CI-CI_DRM_7489+ #1
<4> [110.025675] Hardware name: /NUC7i5BNB, BIOS BNKBL357.86A.0054.2017.1025.1822 10/25/2017
<4> [110.025856] Workqueue: events engine_retire [i915]
<4> [110.025872] Call Trace:
<4> [110.025891] dump_stack+0x71/0x9b
<4> [110.025907] mark_lock+0x49a/0x500
<4> [110.025926] ? print_shortest_lock_dependencies+0x200/0x200
<4> [110.025946] mark_held_locks+0x49/0x70
<4> [110.025962] ? _raw_spin_unlock_irq+0x24/0x50
<4> [110.025978] lockdep_hardirqs_on+0xa2/0x1c0
<4> [110.025995] _raw_spin_unlock_irq+0x24/0x50
<4> [110.026171] virtual_context_destroy+0xc5/0x2e0 [i915]
<4> [110.026376] __active_retire+0xb4/0x290 [i915]
<4> [110.026396] dma_fence_signal_locked+0x9e/0x1b0
<4> [110.026613] i915_request_retire+0x451/0x930 [i915]
<4> [110.026766] retire_requests+0x4d/0x60 [i915]
<4> [110.026919] engine_retire+0x63/0xe0 [i915]
Fixes: b1e3177bd1
("drm/i915: Coordinate i915_active with its own mutex")
Fixes: 6d06779e86
("drm/i915: Load balancing across a virtual engine")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191205145934.663183-1-chris@chris-wilson.co.uk
(cherry picked from commit 6f7ac82853
)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-12-09 16:00:48 +02:00
..
2019-12-06 10:28:09 -08:00
2019-11-14 09:28:46 +10:00
2019-11-14 05:53:10 +10:00
2019-08-14 18:31:10 +02:00
2019-08-14 19:27:26 +02:00
2019-10-17 13:59:16 +02:00
2019-10-11 18:22:50 +03:00
2019-10-24 16:12:30 +02:00
2019-12-01 17:56:50 -08:00
2019-10-24 13:55:56 +02:00
2019-11-14 05:53:10 +10:00
2019-10-28 21:12:27 +09:00
2019-08-28 22:11:03 +02:00
2019-10-24 17:59:45 +02:00
2019-10-24 16:12:36 +02:00
2019-10-21 14:23:25 +02:00
2019-10-04 17:04:05 +01:00
2019-12-09 16:00:48 +02:00
2019-10-03 16:38:50 +02:00
2019-09-19 16:24:24 -07:00
2019-10-17 23:42:02 +08:00
2019-10-03 16:38:50 +02:00
2019-11-08 13:19:55 +10:00
2019-10-10 12:50:02 +02:00
2019-06-30 09:48:05 +02:00
2019-11-27 08:11:11 +01:00
2019-12-02 10:21:12 +10:00
2019-10-14 22:19:32 +02:00
2019-11-30 10:33:14 -08:00
2019-12-04 19:11:28 +02:00
2019-10-23 12:10:05 +02:00
2019-11-14 05:53:10 +10:00
2019-10-24 13:55:56 +02:00
2019-10-25 11:40:51 +02:00
2019-07-17 12:52:55 +02:00
2019-12-06 10:28:09 -08:00
2019-10-16 00:28:32 +03:00
2019-10-23 18:21:01 +02:00
2019-06-05 20:31:04 +02:00
2019-11-07 18:08:07 -05:00
2019-10-04 13:42:33 +01:00
2019-07-15 18:11:31 +02:00
2019-06-05 20:29:57 +02:00
2019-09-16 15:14:43 +02:00
2019-09-16 15:14:10 +02:00
2019-11-27 17:45:48 -08:00
2019-07-17 12:52:55 +02:00
2019-12-04 13:38:16 +01:00
2019-10-11 09:30:53 +10:00
2019-10-17 13:59:16 +02:00
2019-11-28 14:33:01 +10:00
2019-09-08 19:04:23 +02:00
2019-09-16 15:13:02 -07:00
2019-11-14 05:53:10 +10:00
2019-10-29 13:10:07 +01:00
2019-10-23 11:14:11 -04:00
2019-08-13 09:09:30 +02:00
2019-09-24 15:54:08 -07:00
2019-10-22 11:34:03 +02:00
2019-10-10 15:45:35 +02:00
2019-11-28 14:33:01 +10:00
2019-10-24 13:55:56 +02:00
2019-07-22 21:24:10 +02:00
2019-07-19 23:24:16 +02:00
2019-07-16 11:25:02 +02:00
2019-11-14 05:53:10 +10:00
2019-09-18 18:43:36 +02:00
2019-10-03 16:38:50 +02:00
2019-09-23 15:31:53 +08:00
2019-05-27 18:07:03 +02:00
2019-10-09 20:04:55 +02:00
2019-06-13 13:00:29 -04:00
2019-07-15 19:04:27 -07:00
2019-10-25 09:35:06 +02:00
2019-10-03 16:38:50 +02:00
2019-08-01 15:01:29 +02:00
2019-05-27 18:07:03 +02:00
2019-11-27 17:45:48 -08:00
2019-05-27 18:07:03 +02:00
2019-09-16 15:13:02 -07:00
2019-10-03 16:38:50 +02:00
2019-06-08 16:46:37 +02:00
2019-06-13 16:39:16 +02:00
2019-10-08 09:41:06 -04:00
2019-09-30 20:17:31 +03:00
2019-06-14 16:59:51 +02:00
2019-07-16 11:25:02 +02:00
2019-07-25 16:39:35 -04:00
2019-10-08 18:29:00 +02:00
2019-05-06 16:00:48 +03:00
2019-10-23 18:22:10 +02:00
2019-09-03 19:30:06 -04:00
2019-12-04 15:31:16 -05:00
2019-10-03 16:38:50 +02:00
2019-09-30 20:15:53 +03:00
2019-08-07 11:56:48 -04:00
2019-10-02 16:28:55 +03:00
2019-10-23 11:14:11 -04:00
2019-08-28 22:11:03 +02:00
2019-05-30 11:26:37 -07:00
2019-10-28 10:07:54 +01:00
2019-06-21 11:48:09 +02:00
2019-05-27 18:07:03 +02:00
2019-05-20 13:35:56 +02:00
2019-05-27 18:07:03 +02:00
2019-07-22 16:04:53 -04:00
2019-06-19 12:07:29 +02:00
2019-08-13 09:09:30 +02:00
2019-10-29 13:29:21 -05:00
2019-11-15 08:00:08 +01:00
2019-10-25 11:40:51 +02:00
2019-11-15 08:00:08 +01:00
2019-05-27 18:07:03 +02:00
2019-08-06 13:18:42 +05:30
2019-06-17 17:37:01 +02:00
2019-07-22 21:24:10 +02:00
2019-09-18 18:42:21 +02:00
2019-05-27 18:07:03 +02:00
2019-08-22 10:41:06 +03:00
2019-06-19 12:07:29 +02:00
2019-07-16 11:25:02 +02:00
2019-05-27 18:06:47 +02:00
2019-07-16 11:25:02 +02:00
2019-09-30 20:16:28 +03:00
2019-10-22 15:09:15 +02:00
2019-07-30 13:07:41 +02:00
2019-10-04 13:43:43 +01:00
2019-10-23 11:00:41 +02:00
2019-09-18 11:27:18 +02:00
2019-09-19 16:24:24 -07:00
2019-07-16 12:21:41 -07:00
2019-09-20 15:03:42 -04:00
2019-07-01 16:58:09 +02:00
2019-09-08 19:04:01 +02:00
2019-05-27 18:07:03 +02:00
2019-05-27 18:07:03 +02:00
2019-04-24 11:30:32 +02:00
2019-10-17 13:59:16 +02:00
2019-10-02 16:28:55 +03:00
2019-09-16 15:13:53 -07:00
2019-12-04 19:44:13 -08:00
2019-05-27 18:07:03 +02:00
2019-07-16 11:25:02 +02:00
2019-05-27 18:07:03 +02:00
2019-11-06 13:00:21 -05:00
2019-10-24 13:55:56 +02:00
2019-10-18 12:24:56 +02:00
2019-08-06 13:16:54 +05:30
2019-05-27 18:07:03 +02:00
2019-09-03 09:46:18 +02:00
2019-10-08 18:43:26 -04:00
2019-07-16 11:25:02 +02:00
2019-05-27 18:07:03 +02:00
2019-09-12 19:54:42 +02:00
2019-09-23 15:32:53 +08:00
2019-12-05 11:11:11 +10:00
2019-10-03 16:38:50 +02:00