Bug 22822

Summary: BUG in i915 GEM on resume from suspend
Product: Drivers Reporter: Sarah Sharp (sarah)
Component: Video(DRI - Intel)Assignee: drivers_video-dri-intel (drivers_video-dri-intel)
Status: CLOSED CODE_FIX    
Severity: high CC: chris, florian, maciej.rutecki, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.37-rc1 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 21782    
Attachments: dmesg
xorg log
lspci for the crashed box

Description Sarah Sharp 2010-11-12 16:18:36 UTC
Blank screen on resume from suspend to ram, with this in the dmesg:

[  473.680734] ------------[ cut here ]------------
[  473.680737] kernel BUG at drivers/gpu/drm/i915/i915_gem.c:4568!
[  473.680740] invalid opcode: 0000 [#1] SMP 
[  473.680744] last sysfs file: /sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sda/sda1/stat
[  473.680746] CPU 0 
[  473.680748] Modules linked in: netconsole configfs i915 drm_kms_helper binfmt_misc drm i2c_algo_bit ppdev bridge stp bnep video output lp parport snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer usbhid snd_seq_device snd pcspkr intel_agp iTCO_wdt iTCO_vendor_support shpchp intel_gtt soundcore snd_page_alloc uhci_hcd ehci_hcd usbcore r8169 floppy mii
[  473.680856] 
[  473.680915] Pid: 2583, comm: Xorg Not tainted 2.6.37-rc1+ #104 P5Q-EM/System Product Name
[  473.680917] RIP: 0010:[<ffffffffa0291b28>]  [<ffffffffa0291b28>] i915_gem_entervt_ioctl+0x1d8/0x1e0 [i915]
[  473.680930] RSP: 0018:ffff88021c5b5d68  EFLAGS: 00010283
[  473.680932] RAX: ffff88022762d530 RBX: ffff88022762c000 RCX: 0000000000000000
[  473.680935] RDX: 000000000001fff8 RSI: 000000000001f001 RDI: ffff8802276b2000
[  473.680937] RBP: ffff88021c5b5d88 R08: 0000000000000000 R09: ffff880000000000
[  473.680939] R10: 0000000000000001 R11: 0000000000000020 R12: 0000000000000000
[  473.680941] R13: ffff8802276b2000 R14: ffff8802276b2020 R15: 0000000000000000
[  473.680943] FS:  00007f8713efd700(0000) GS:ffff8800cda00000(0000) knlGS:0000000000000000
[  473.681002] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  473.681004] CR2: 00007ff81e576000 CR3: 000000021c507000 CR4: 00000000000406b0
[  473.681007] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  473.681009] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  473.681011] Process Xorg (pid: 2583, threadinfo ffff88021c5b4000, task ffff88021c6cc3b0)
[  473.681013] Stack:
[  473.681015]  0000000000000059 0000000000000000 ffff88021d0d9000 ffff8802276b2000
[  473.681020]  ffff88021c5b5ea8 ffffffffa01da8a7 ffff880200000059 000000000000e200
[  473.681640]  ffff880200000001 0000000000005f33 ffff88021c5b5df8 ffffffffa02ce678
[  473.681903] Call Trace:
[  473.681966]  [<ffffffffa01da8a7>] drm_ioctl+0x3c7/0x460 [drm]
[  473.681973]  [<ffffffffa0291950>] ? i915_gem_entervt_ioctl+0x0/0x1e0 [i915]
[  473.682184]  [<ffffffff81128e91>] ? do_sync_write+0xd1/0x120
[  473.682188]  [<ffffffff8115ee6d>] ? fsnotify+0x11d/0x2f0
[  473.682191]  [<ffffffff81139671>] do_vfs_ioctl+0xb1/0x6d0
[  473.682194]  [<ffffffff81139d29>] sys_ioctl+0x99/0xa0
[  473.682454]  [<ffffffff811295d0>] ? sys_write+0x50/0x90
[  473.682458]  [<ffffffff8100b002>] system_call_fastpath+0x16/0x1b
[  473.682460] Code: 1f 40 00 0f 0b eb fe 0f 1f 40 00 0f 0b eb fe 0f 1f 40 00 0f 0b eb fe 0f 1f 40 00 0f 0b eb fe 0f 1f 40 00 0f 0b eb fe 0f 1f 40 00 <0f> 0b eb fe 0f 1f 40 00 55 48 89 e5 48 83 ec 30 48 89 5d d8 4c 
[  473.684006] RIP  [<ffffffffa0291b28>] i915_gem_entervt_ioctl+0x1d8/0x1e0 [i915]
[  473.684006]  RSP <ffff88021c5b5d68>
[  473.687993] ---[ end trace 95914a5179441380 ]---

Full dmesg and Xorg.log.0 will be attached.
Comment 1 Sarah Sharp 2010-11-12 16:19:37 UTC
Created attachment 37172 [details]
dmesg
Comment 2 Sarah Sharp 2010-11-12 16:24:22 UTC
Created attachment 37182 [details]
xorg log
Comment 3 Sarah Sharp 2010-11-12 16:26:52 UTC
Created attachment 37192 [details]
lspci for the crashed box
Comment 4 Sarah Sharp 2010-11-12 16:31:28 UTC
Last known working kernel was 2.6.36-rc5.
Comment 5 Chris Wilson 2010-11-12 16:53:17 UTC
commit 395b70be54bed5fdf6c4173c78e8a49f960f241d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 28 21:28:46 2010 +0100

    drm/i915: Flush read-only buffers from the active list upon idle as well
    
    It is possible for the active list to only contain a read-only buffer so
    that the ring->gpu_write_list remains entry. This leads to an
    inconsistency between i915_gpu_is_active() and i915_gpu_idle() causing
    an infinite spin during the shrinker and an assertion failure that
    i915_gpu_idle() does indeed flush all buffers from the active lists.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Patch has been included in a pull request to Linus.
Comment 6 Rafael J. Wysocki 2010-11-18 23:06:35 UTC
Fixed by commit 395b70be54bed5fdf6c4173c78e8a49f960f241d .