Bug 111215

Summary: [CI][DRMTIP] Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38
Product: DRI Reporter: Lakshmi <lakshminarayana.vudum>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: chris, intel-gfx-bugs
Version: DRI git   
Hardware: Other   
OS: All   
Whiteboard: ReadyForDev
i915 platform: BSW/CHT i915 features: GEM/Other

Description Lakshmi 2019-07-25 12:12:46 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@i915_hangman@error-state-capture-vcs0.html

<6> [265.962783] Console: switching to colour dummy device 80x25
<6> [265.962911] [IGT] i915_hangman: executing
<5> [265.988758] Setting dangerous option reset - tainting kernel
<6> [265.990284] [IGT] i915_hangman: starting subtest error-state-capture-vcs0
<7> [265.990769] [drm:error_state_write [i915]] Resetting error state
<7> [268.591175] [drm:edp_panel_vdd_off_sync [i915]] Turning eDP port C VDD off
<7> [268.591785] [drm:edp_panel_vdd_off_sync [i915]] PP_STATUS: 0x80000008 PP_CONTROL: 0xabcd0007
<7> [279.599038] hangcheck vcs0
<7> [279.599166] hangcheck 	Awake? 2
<7> [279.599224] hangcheck 	Hangcheck: 12033 ms ago
<7> [279.599288] hangcheck 	Reset count: 0 (global 0)
<7> [279.599352] hangcheck 	Requests:
<7> [279.599424] hangcheck 		active  56:2*-  prio=3 @ 13606ms: i915_hangman[1030]
<7> [279.599514] hangcheck 		ring->start:  0x00411000
<7> [279.599578] hangcheck 		ring->head:   0x00000000
<7> [279.599641] hangcheck 		ring->tail:   0x000000d8
<7> [279.599705] hangcheck 		ring->emit:   0x000000e0
<7> [279.599768] hangcheck 		ring->space:  0x00003ee0
<7> [279.599832] hangcheck 		ring->hwsp:   0x3fffe100
<7> [279.599901] hangcheck [head 0000, postfix 00b0, tail 00e0, batch 0x00000000_00040000]:
<7> [279.600065] hangcheck [0000] 13204002 00000204 00000000 00000000 13244082 00000204 00000000 00000000
<7> [279.600189] hangcheck [0020] 1100100f 0001228c 00000001 00012288 6003a000 00012284 00000001 00012280
<7> [279.600309] hangcheck [0040] 6003a000 0001227c 00000001 00012278 6003a000 00012274 00000001 00012270
<7> [279.600429] hangcheck [0060] 5e4bf000 00000000 13204002 00000204 00000000 00000000 13244082 00000204
<7> [279.600549] hangcheck [0080] 00000000 00000000 02800000 00000000 10400002 3fffe100 00000000 00000001
<7> [279.600668] hangcheck [00a0] 04000000 18800101 00040000 00000000 13004002 3fffe104 00000000 00000002
<7> [279.600788] hangcheck [00c0] 01000000 04000001 0e40c002 00000000 0040b0c8 00000000 02800000 00000000
<7> [279.601117] hangcheck 	RING_START: 0x00411000
<7> [279.601193] hangcheck 	RING_HEAD:  0x000000b0
<7> [279.601261] hangcheck 	RING_TAIL:  0x000000d8
<7> [279.601339] hangcheck 	RING_CTL:   0x00003001
<7> [279.601423] hangcheck 	RING_MODE:  0x00000000
<7> [279.601492] hangcheck 	RING_IMR: fffffefe
<7> [279.601562] hangcheck 	ACTHD:  0x00000000_00040724
<7> [279.601668] hangcheck 	BBADDR: 0x00000000_00040409
<7> [279.601748] hangcheck 	DMA_FADDR: 0x00000000_00041040
<7> [279.601834] hangcheck 	IPEIR: 0x00000008
<7> [279.601899] hangcheck 	IPEHR: 0x00000000
<7> [279.601966] hangcheck 	Execlist status: 0x00054032 00000001, entries 6
<7> [279.602135] hangcheck 	Execlist CSB read 2, write 2, tasklet queued? no (enabled)
<7> [279.602255] hangcheck 		Active[0: ring:{start:00411000, hwsp:3fffe100, seqno:00000001}, rq:  56:2*-  prio=3 @ 13609ms: i915_hangman[1030]
<7> [279.602413] hangcheck 		E  56:2*-  prio=3 @ 13609ms: i915_hangman[1030]
<7> [279.602499] hangcheck HWSP:
<7> [279.602558] hangcheck [0000] 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<7> [279.602667] hangcheck *
<7> [279.602722] hangcheck [0040] 00000001 00000000 00000818 00000000 00000001 00000000 00000818 00000000
<7> [279.602841] hangcheck [0060] 00000001 00000000 00000818 00000001 00000000 00000000 00000000 00000002
<7> [279.602960] hangcheck [0080] 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<7> [279.603141] hangcheck *
<7> [279.603217] hangcheck Idle? no
<7> [279.603270] hangcheck Signals:
<7> [279.603343] hangcheck 	[56:2*] @ 13610ms
<3> [279.621888] BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38
<3> [279.621913] in_atomic(): 1, irqs_disabled(): 1, pid: 12, name: kworker/0:1
<4> [279.621929] INFO: lockdep is turned off.
<4> [279.621940] irq event stamp: 1696404
<4> [279.621957] hardirqs last  enabled at (1696403): [<ffffffff8c9da444>] _raw_spin_unlock_irq+0x24/0x30
<4> [279.621981] hardirqs last disabled at (1696404): [<ffffffff8c9d38b2>] __schedule+0xc2/0x890
<4> [279.622003] softirqs last  enabled at (1695454): [<ffffffff8cc002eb>] __do_softirq+0x2eb/0x465
<4> [279.622025] softirqs last disabled at (1695447): [<ffffffff8c0ba04e>] irq_exit+0xae/0xc0
<4> [279.622046] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G     U            5.3.0-rc1-gef1bb6d271fa-drmtip_334+ #1
<4> [279.622069] Hardware name: GOOGLE Kefka/Kefka, BIOS MrChromebox 02/04/2018
<4> [279.622197] Workqueue: events_long hangcheck_elapsed [i915]
<4> [279.622213] Call Trace:
<4> [279.622226]  dump_stack+0x67/0x9b
<4> [279.622240]  ___might_sleep+0x144/0x230
<4> [279.622338]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.622354]  cpus_read_lock+0x13/0xc0
<4> [279.622368]  stop_machine+0x12/0x30
<4> [279.622461]  bxt_vtd_ggtt_insert_page__BKL+0x37/0x60 [i915]
<4> [279.622559]  i915_error_object_create+0x14d/0x440 [i915]
<4> [279.622657]  i915_capture_gpu_state+0xcbb/0x1640 [i915]
<4> [279.622765]  i915_capture_error_state+0x2e/0x230 [i915]
<4> [279.622857]  intel_gt_handle_error+0x34d/0x370 [i915]
<4> [279.622874]  ? string+0x40/0x50
<4> [279.622969]  hangcheck_elapsed+0x3d3/0x530 [i915]
<4> [279.622985]  ? __drm_printfn_info+0x20/0x20
<4> [279.623000]  ? update_curr+0x178/0x410
<4> [279.623017]  ? debug_object_deactivate+0x8f/0x190
<4> [279.623036]  ? process_one_work+0x1bf/0x5f0
<4> [279.623052]  process_one_work+0x245/0x5f0
<4> [279.623068]  worker_thread+0x37/0x380
<4> [279.623082]  ? process_one_work+0x5f0/0x5f0
<4> [279.623094]  kthread+0x119/0x130
<4> [279.623105]  ? kthread_park+0xa0/0xa0
<4> [279.623118]  ret_from_fork+0x3a/0x50
<3> [279.623181] BUG: scheduling while atomic: kworker/0:1/12/0x00000002
<4> [279.623198] INFO: lockdep is turned off.
<4> [279.623208] Modules linked in: vgem snd_hda_codec_hdmi coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 asix usbnet mii btusb btrtl btbcm btintel snd_hda_intel bluetooth snd_hda_codec snd_hwdep snd_hda_core ecdh_generic ecc snd_pcm lpc_ich pinctrl_cherryview prime_numbers
<4> [279.623280] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G     U  W         5.3.0-rc1-gef1bb6d271fa-drmtip_334+ #1
<4> [279.623303] Hardware name: GOOGLE Kefka/Kefka, BIOS MrChromebox 02/04/2018
<4> [279.623403] Workqueue: events_long hangcheck_elapsed [i915]
<4> [279.623418] Call Trace:
<4> [279.623430]  dump_stack+0x67/0x9b
<4> [279.623442]  __schedule_bug+0x58/0x80
<4> [279.623456]  __schedule+0x701/0x890
<4> [279.623468]  ? trace_hardirqs_on_thunk+0x1a/0x20
<4> [279.623484]  ? wait_for_common+0x116/0x1f0
<4> [279.623497]  schedule+0x2b/0xb0
<4> [279.623508]  schedule_timeout+0x219/0x3c0
<4> [279.623524]  ? _raw_spin_unlock_irq+0x24/0x30
<4> [279.623538]  ? wait_for_common+0x116/0x1f0
<4> [279.623551]  wait_for_common+0x13a/0x1f0
<4> [279.623565]  ? wake_up_q+0x80/0x80
<4> [279.623578]  ? stop_machine_yield+0x10/0x10
<4> [279.623591]  __stop_cpus+0x52/0x80
<4> [279.623606]  ? stop_machine_yield+0x10/0x10
<4> [279.623619]  stop_cpus+0x29/0x40
<4> [279.623710]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.623725]  stop_machine_cpuslocked+0xe5/0xf0
<4> [279.623819]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.623916]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.623930]  stop_machine+0x20/0x30
<4> [279.624023]  bxt_vtd_ggtt_insert_page__BKL+0x37/0x60 [i915]
<4> [279.624119]  i915_error_object_create+0x14d/0x440 [i915]
<4> [279.624217]  i915_capture_gpu_state+0xcbb/0x1640 [i915]
<4> [279.624324]  i915_capture_error_state+0x2e/0x230 [i915]
<4> [279.624417]  intel_gt_handle_error+0x34d/0x370 [i915]
<4> [279.624434]  ? string+0x40/0x50
<4> [279.624528]  hangcheck_elapsed+0x3d3/0x530 [i915]
<4> [279.624543]  ? __drm_printfn_info+0x20/0x20
<4> [279.624557]  ? update_curr+0x178/0x410
<4> [279.624573]  ? debug_object_deactivate+0x8f/0x190
<4> [279.624592]  ? process_one_work+0x1bf/0x5f0
<4> [279.624608]  process_one_work+0x245/0x5f0
<4> [279.624624]  worker_thread+0x37/0x380
<4> [279.624638]  ? process_one_work+0x5f0/0x5f0
<4> [279.624650]  kthread+0x119/0x130
<4> [279.624661]  ? kthread_park+0xa0/0xa0
<4> [279.624673]  ret_from_fork+0x3a/0x50
<3> [279.629931] BUG: scheduling while atomic: kworker/0:1/12/0x00000000
<4> [279.629953] INFO: lockdep is turned off.
<4> [279.629964] Modules linked in: vgem snd_hda_codec_hdmi coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 asix usbnet mii btusb btrtl btbcm btintel snd_hda_intel bluetooth snd_hda_codec snd_hwdep snd_hda_core ecdh_generic ecc snd_pcm lpc_ich pinctrl_cherryview prime_numbers
<4> [279.630035] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G     U  W         5.3.0-rc1-gef1bb6d271fa-drmtip_334+ #1
<4> [279.630058] Hardware name: GOOGLE Kefka/Kefka, BIOS MrChromebox 02/04/2018
<4> [279.630184] Workqueue: events_long hangcheck_elapsed [i915]
<4> [279.630199] Call Trace:
<4> [279.630212]  dump_stack+0x67/0x9b
<4> [279.630227]  __schedule_bug+0x58/0x80
<4> [279.630241]  __schedule+0x701/0x890
<4> [279.630256]  ? wait_for_common+0x116/0x1f0
<4> [279.630269]  schedule+0x2b/0xb0
<4> [279.630280]  schedule_timeout+0x219/0x3c0
<4> [279.630294]  ? wait_for_common+0x48/0x1f0
<4> [279.630310]  ? wait_for_common+0x116/0x1f0
<4> [279.630322]  wait_for_common+0x13a/0x1f0
<4> [279.630336]  ? wake_up_q+0x80/0x80
<4> [279.630350]  ? stop_machine_yield+0x10/0x10
<4> [279.630363]  __stop_cpus+0x52/0x80
<4> [279.630379]  ? stop_machine_yield+0x10/0x10
<4> [279.630391]  stop_cpus+0x29/0x40
<4> [279.630483]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.630498]  stop_machine_cpuslocked+0xe5/0xf0
<4> [279.630592]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.630688]  ? gen8_ggtt_insert_page+0x90/0x90 [i915]
<4> [279.630703]  stop_machine+0x20/0x30
<4> [279.630795]  bxt_vtd_ggtt_insert_page__BKL+0x37/0x60 [i915]
<4> [279.630892]  i915_error_object_create+0x14d/0x440 [i915]
<4> [279.630989]  i915_capture_gpu_state+0xf27/0x1640 [i915]
<4> [279.631097]  i915_capture_error_state+0x2e/0x230 [i915]
<4> [279.631189]  intel_gt_handle_error+0x34d/0x370 [i915]
<4> [279.631206]  ? string+0x40/0x50
<4> [279.631300]  hangcheck_elapsed+0x3d3/0x530 [i915]
<4> [279.631315]  ? __drm_printfn_info+0x20/0x20
<4> [279.631330]  ? update_curr+0x178/0x410
<4> [279.631347]  ? debug_object_deactivate+0x8f/0x190
<4> [279.631366]  ? process_one_work+0x1bf/0x5f0
<4> [279.631382]  process_one_work+0x245/0x5f0
<4> [279.631398]  worker_thread+0x37/0x380
<4> [279.631412]  ? process_one_work+0x5f0/0x5f0
<4> [279.631424]  kthread+0x119/0x130
<4> [279.631435]  ? kthread_park+0xa0/0xa0
<4> [279.631448]  ret_from_fork+0x3a/0x50
<6> [279.638450] i915 0000:00:02.0: GPU HANG: ecode 8:4:0x00000000, in i915_hangman [1030], no progress on vcs0
<6> [279.638479] [drm] GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.
<6> [279.638501] [drm] Please file a _new_ bug report on bugs.freedesktop.org against DRI -> DRM/Intel
<6> [279.638521] [drm] drm/i915 developers can then reassign to the right component if it's not a kernel issue.
<6> [279.638543] [drm] The gpu crash dump is required to analyze gpu hangs, so please always attach it.
<6> [279.638564] [drm] GPU crash dump saved to /sys/class/drm/card0/error
<5> [279.638607] i915 0000:00:02.0: Resetting vcs0 for no progress on vcs0
<7> [279.640045] [drm:error_state_write [i915]] Resetting error state
<6> [279.640386] [IGT] i915_hangman: exiting, ret=0
<5> [279.640742] Setting dangerous option reset - tainting kernel
<6> [279.665095] Console: switching to colour frame buffer device 170x48
Comment 1 CI Bug Log 2019-07-25 12:14:57 UTC
The CI Bug Log issue associated to this bug has been updated.

### New filters associated

* BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@i915_hangman@error-state-capture-vcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@gem_exec_capture@capture-blt.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_vblank@pipe-b-wait-idle-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@gem_exec_capture@capture-vebox.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_busy@extended-modeset-hang-oldfb-with-reset-render-a.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@prime_busy@hang-bsd.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_busy@extended-modeset-hang-oldfb-render-b.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@i915_hangman@error-state-capture-rcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_vblank@pipe-b-ts-continuation-modeset-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_busy@extended-modeset-hang-oldfb-render-a.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@gem_busy@basic-hang-rcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_vblank@pipe-b-wait-forked-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@prime_busy@hang-bsd1.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_vblank@pipe-a-query-idle-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@kms_vblank@pipe-a-wait-idle-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@i915_hangman@error-state-capture-bcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@prime_busy@hang-render.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@prime_busy@wait-hang-default.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-kefka/igt@prime_busy@wait-hang-blt.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@i915_hangman@error-state-capture-vcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@wait-hang-render.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@gem_exec_capture@capture-blt.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_busy@extended-modeset-hang-oldfb-with-reset-render-c.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_vblank@pipe-c-wait-busy-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@gem_ctx_isolation@vecs0-reset.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@i915_hangman@error-state-capture-rcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_vblank@pipe-c-wait-forked-busy-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@gem_busy@basic-hang-rcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@wait-hang-bsd1.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_vblank@pipe-c-ts-continuation-modeset-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@hang-bsd1.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@i915_hangman@error-state-capture-vecs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_vblank@pipe-c-ts-continuation-idle-hang.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@gem_ctx_isolation@bcs0-reset.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@hang-blt.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@i915_hangman@error-state-capture-bcs0.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@wait-hang-default.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@prime_busy@wait-hang-blt.html
  - https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_334/fi-bsw-n3050/igt@kms_vblank@pipe-c-query-forked-hang.html
Comment 2 Chris Wilson 2019-07-25 12:25:22 UTC
I re-enabled bsw error capturing forgetting that the stop_machine() is still inside the spinlock critical section. Have a start of an idea to pin the vma in place under the spinlock for capture outside of the spinlock. Should be a nice overall improvement.
Comment 3 Chris Wilson 2019-07-25 18:28:14 UTC
https://patchwork.freedesktop.org/series/64256/
Comment 4 Chris Wilson 2019-07-26 00:16:27 UTC
commit 79c7a28e1f3a74b95ae2eae36ed0046fc8e6c7fd (HEAD -> drm-intel-next-queued, drm-intel/for-linux-next, drm-intel/drm-intel-next-queued)
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 25 23:38:43 2019 +0100

    drm/i915: Capture vma contents outside of spinlock
    
    Currently we use the engine->active.lock to ensure that the request is
    not retired as we capture the data. However, we only need to ensure that
    the vma are not removed prior to use acquiring their contents, and
    since we have already relinquished our stop-machine protection, we
    assume that the user will not be overwriting the contents before we are
    able to record them.
    
    In order to capture the vma outside of the spinlock, we acquire a
    reference and mark the vma as active to prevent it from being unbound.
    However, since it is tricky allocate an entry in the fence tree (doing
    so would require taking a mutex) while inside the engine spinlock, we
    use an atomic bit and special case the handling for i915_active_wait.
    
    The core benefit is that we can use some non-atomic methods for mapping
    the device pages, we can remove the slow compression phase out of atomic
    context (i.e. stop antagonising the nmi-watchdog), and no we longer need
    large reserves of atomic pages.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111215
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190725223843.8971-1-chris@chris-wilson.co.uk
Comment 5 CI Bug Log 2019-07-26 06:42:42 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 -}
{+ BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 +}

New failures caught by the filter:

  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_335/fi-bsw-kefka/igt@kms_vblank@pipe-a-ts-continuation-modeset-hang.html
Comment 6 CI Bug Log 2019-07-29 07:40:26 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 -}
{+ BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 +}

New failures caught by the filter:

  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@perf_pmu@busy-hang-bcs0.html
Comment 7 Lakshmi 2019-07-29 07:44:18 UTC
(In reply to CI Bug Log from comment #6)
> A CI Bug Log filter associated to this bug has been updated:
> 
> {- BSW: Random tests - dmesg-warn - BUG: sleeping function called from
> invalid context at ./include/linux/percpu-rwsem.h:38 -}
> {+ BSW: Random tests - dmesg-warn - BUG: sleeping function called from
> invalid context at ./include/linux/percpu-rwsem.h:38 +}
> 
> New failures caught by the filter:
> 
>   *
> https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/
> igt@perf_pmu@busy-hang-bcs0.html

@Chris, a new failure is caught at the moment. Is it a different bug?
Comment 8 Lakshmi 2019-07-29 08:41:00 UTC
(In reply to Lakshmi from comment #7)
> (In reply to CI Bug Log from comment #6)
> > A CI Bug Log filter associated to this bug has been updated:
> > 
> > {- BSW: Random tests - dmesg-warn - BUG: sleeping function called from
> > invalid context at ./include/linux/percpu-rwsem.h:38 -}
> > {+ BSW: Random tests - dmesg-warn - BUG: sleeping function called from
> > invalid context at ./include/linux/percpu-rwsem.h:38 +}
> > 
> > New failures caught by the filter:
> > 
> >   *
> > https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/
> > igt@perf_pmu@busy-hang-bcs0.html
> 
> @Chris, a new failure is caught at the moment. Is it a different bug?

Is it that fix is not part of drmtip 336?
Comment 9 Chris Wilson 2019-07-29 08:44:03 UTC
No, it's not part of drmtip_336. Maybe 337, cerrtainly 338.
Comment 10 CI Bug Log 2019-07-29 09:31:25 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 -}
{+ BSW: Random tests - dmesg-warn - BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:38 +}

New failures caught by the filter:

  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_vblank@pipe-b-query-forked-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_flip@flip-vs-panning-vs-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@gem_request_retire@retire-vma-not-inactive.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@prime_busy@wait-hang-vebox.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_busy@extended-modeset-hang-oldfb-with-reset-render-b.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@prime_busy@wait-hang-bsd.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_vblank@pipe-b-query-idle-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@gem_ctx_exec@basic-norecovery.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_vblank@pipe-a-ts-continuation-idle-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_vblank@pipe-a-query-forked-busy-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@gem_exec_capture@capture-render.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_flip@flip-vs-modeset-vs-hang-interruptible.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-kefka/igt@kms_vblank@pipe-a-query-busy-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@kms_flip@flip-vs-panning-vs-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@gem_request_retire@retire-vma-not-inactive.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@prime_busy@wait-hang-vebox.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@gem_exec_capture@capture-bsd.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@kms_vblank@pipe-c-query-forked-busy-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@prime_busy@wait-hang-bsd.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@gem_ctx_isolation@rcs0-reset.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@gem_ctx_exec@basic-norecovery.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@kms_busy@extended-modeset-hang-oldfb-render-c.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@kms_vblank@pipe-c-query-busy-hang.html
  * https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_336/fi-bsw-n3050/igt@kms_flip@flip-vs-modeset-vs-hang-interruptible.html

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.