Someone mentioned on irc that intel_crtc_wait_for_pending_flips() was getting stuck in some cases. This rang a bell since I was poking around that stuff last year. The issue that I'm trying to fix here is processes getting stuck in D state when a GPU reset happens while page flips have been scheduled. Testing is easy 1) fire up 'glxgears -fullscreen', run 'gem_hang 0', try to VT switch. Without this series X and some kworker soon get stuck in D state and you're left with a useless box. With the patch set, you wait a while, the GPU hangcheck kicks in, and you get your console back. The irc discussion was apparently about [1], but since the dmesg there doesn't show a GPU hang, I don't see this patch set fixing it. Frankly, I have no idea what's happening there. Additional work after this would involve sending out pending page flip events. Currently if you don't do the VT switch after a hang, glxgears remains stuck because the X server didn't get the page flip event from the kernel. Also we should probably do an explicit intel_pipe_set_base() with the current fb, to make sure we show the correct fb after the hang. But I'm not going to touch these right now. Actually I'm hoping someone else will volunteer for these tasks ;) [1] https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1097315