Bug 58732 - [GM965] compiz terminates with "intel_do_flush_locked failed: Device or resource busy"
Summary: [GM965] compiz terminates with "intel_do_flush_locked failed: Device or resou...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-25 01:08 UTC by Daniel Gnoutcheff
Modified: 2017-07-24 22:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg from 2012-12-24 occurrence (242.28 KB, text/plain)
2012-12-25 01:08 UTC, Daniel Gnoutcheff
no flags Details
compiz output from 2012-12-24 occurrence (3.82 KB, text/plain)
2012-12-25 01:09 UTC, Daniel Gnoutcheff
no flags Details
Xorg log from 2012-12-24 occurrence (67.79 KB, text/plain)
2012-12-25 01:09 UTC, Daniel Gnoutcheff
no flags Details
intel_reg_dumper output after 2012-12-24 occurrence (13.48 KB, text/plain)
2012-12-25 01:10 UTC, Daniel Gnoutcheff
no flags Details

Description Daniel Gnoutcheff 2012-12-25 01:08:54 UTC
Created attachment 72086 [details]
dmesg from 2012-12-24 occurrence

I use Ubuntu's compiz-based Unity desktop. Occasionally, compiz will terminate with

  intel_do_flush_locked failed: Device or resource busy

If I then attempt to restart compiz, it initially starts up successfully, but if I "use" it a little (e.g. if I open a new window or move an existing window around), then within a second or so it terminates again with the same error.  Every attempt to restart compiz fails in this way, and it continues to fail even if I restart the xserver.  However, once I reboot the system, compiz runs normally again.  

I'm attaching dmesg output, Xorg log, compiz stderr+stdout with LIBGL_DEBUG=verbose, and intel_reg_dumper output.  dmesg contains interesting-looking stack traces, the rest looks unenlightening.

System environment: 
-- chipset: GM965
-- system architecture: x86_64
-- xf86-video-intel: 2.20.9 (Ubuntu package version 2:2.20.9-0ubuntu2)
-- xserver: 1.13.0 (Ubuntu package version 2:1.13.0-0ubuntu6.1)
-- mesa: 9.0 (Ubuntu package version 9.0-0ubuntu1)
-- libdrm: 2.4.39 (Ubuntu package version 2.4.39-0ubuntu)
-- kernel: 3.5.? (Ubuntu package version 3.5.0-21-generic)
-- Linux distribution: Ubuntu 12.10
-- Machine or mobo model: Lenovo ThinkPad R61 7733A82
-- Display connector: internal LVDS

Here's the interesting-looking dmesg stacktrace:

  [210169.687137] ------------[ cut here ]------------
  [210169.687186] WARNING: at /build/buildd/linux-3.5.0/drivers/gpu/drm/i915/i915
  _gem.c:3047 i915_gem_object_pin+0x15d/0x1b0 [i915]()
  [210169.687189] Hardware name: 7733A82
  [210169.687190] Modules linked in: hid_generic usbhid hid mmc_block usblp snd_seq_dummy snd_hrtimer nls_iso8859_1 cdc_ether cdc_phonet usbnet phonet cdc_acm usb_storage pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) deflate zlib_deflate twofish_generic ctr twofish_x86_64_3way twofish_x86_64 twofish_common camellia_generic camellia_x86_64 serpent_sse2_x86_64 cryptd lrw serpent_generic xts gf128mul blowfish_generic blowfish_x86_64 blowfish_common cast5 nfsd des_generic xcbc nfs rmd160 sha512_generic crypto_null af_key lockd xfrm_algo fscache auth_rpcgss bnep nfs_acl rfcomm parport_pc sunrpc bluetooth ppdev binfmt_misc dm_crypt arc4 snd_hda_codec_analog snd_hda_intel joydev snd_hda_codec coretemp thinkpad_acpi snd_hwdep snd_pcm ath5k r852 kvm_intel snd_seq_midi sm_common snd_rawmidi nand ath snd_seq_midi_event nand_ids snd_seq mtd kvm nand_bch snd_timer tp_smapi(O) bch r592 thinkpad_ec(O) mac80211 snd_seq_device pcmcia firewire_sbp2 memstick nand_ecc psmouse cfg80211 yenta_socket dm_multipath pcmcia_rsrc snd pcmcia_core scsi_dh snd_page_alloc microcode mac_hid soundcore serio_raw lp nvram lpc_ich tpm_tis parport sdhci_pci sdhci firewire_ohci firewire_core crc_itu_t i915 drm_kms_helper drm i2c_algo_bit e1000e video wmi
  [210169.687280] Pid: 2911, comm: compiz Tainted: G           O 3.5.0-21-generic #32-Ubuntu
  [210169.687282] Call Trace:
  [210169.687290]  [<ffffffff81051c1f>] warn_slowpath_common+0x7f/0xc0
  [210169.687294]  [<ffffffff81051c7a>] warn_slowpath_null+0x1a/0x20
  [210169.687308]  [<ffffffffa00da93d>] i915_gem_object_pin+0x15d/0x1b0 [i915]
  [210169.687329]  [<ffffffffa006094b>] ? drm_mm_put_block+0x5b/0x80 [drm]
  [210169.687343]  [<ffffffffa00dd530>] pin_and_fence_object.isra.5+0xa0/0x140 [i915]
  [210169.687357]  [<ffffffffa00dd796>] i915_gem_execbuffer_reserve.isra.6+0x1c6/0x420 [i915]
  [210169.687372]  [<ffffffffa00de027>] i915_gem_do_execbuffer.isra.9+0x5a7/0x1450 [i915]
  [210169.687377]  [<ffffffff8141372b>] ? intel_gtt_chipset_flush+0x1b/0x20
  [210169.687391]  [<ffffffffa00d942f>] ? i915_gem_shmem_pwrite.isra.25+0x34f/0x530 [i915]
  [210169.687405]  [<ffffffffa00df3ac>] ? i915_gem_execbuffer2+0x5c/0x290 [i915]
  [210169.687419]  [<ffffffffa00df3ac>] ? i915_gem_execbuffer2+0x5c/0x290 [i915]
  [210169.687434]  [<ffffffffa00df401>] i915_gem_execbuffer2+0xb1/0x290 [i915]
  [210169.687446]  [<ffffffffa00556d3>] drm_ioctl+0x4d3/0x580 [drm]
  [210169.687461]  [<ffffffffa00df350>] ? i915_gem_execbuffer+0x480/0x480 [i915]
  [210169.687466]  [<ffffffff8155ef7c>] ? sys_recvfrom+0x12c/0x170
  [210169.687470]  [<ffffffff8108a89f>] ? __dequeue_entity+0x2f/0x50
  [210169.687474]  [<ffffffff81193bd9>] do_vfs_ioctl+0x99/0x590
  [210169.687479]  [<ffffffff8168207f>] ? __schedule+0x3cf/0x7c0
  [210169.687483]  [<ffffffff81194169>] sys_ioctl+0x99/0xa0
  [210169.687487]  [<ffffffff8168b969>] system_call_fastpath+0x16/0x1b
  [210169.687490] ---[ end trace 26e0b7909e6d35b8 ]---
  [210186.317236] ------------[ cut here ]------------
Comment 1 Daniel Gnoutcheff 2012-12-25 01:09:33 UTC
Created attachment 72087 [details]
compiz output from 2012-12-24 occurrence
Comment 2 Daniel Gnoutcheff 2012-12-25 01:09:59 UTC
Created attachment 72088 [details]
Xorg log from 2012-12-24 occurrence
Comment 3 Daniel Gnoutcheff 2012-12-25 01:10:43 UTC
Created attachment 72089 [details]
intel_reg_dumper output after 2012-12-24 occurrence
Comment 4 Chris Wilson 2012-12-25 01:34:55 UTC
Should be fixed in 3.7:

commit b4a98e57fc27854b5938fc8b08b68e5e68b91e1f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Nov 1 09:26:26 2012 +0000

    drm/i915: Flush outstanding unpin tasks before pageflipping
Comment 5 Daniel Gnoutcheff 2012-12-26 03:33:42 UTC
> Should be fixed in 3.7:
>
> commit b4a98e57fc27854b5938fc8b08b68e5e68b91e1f

Thanks, I see that commit is in kernel 3.8-rc1, though I can't find it 
in 3.7.1 or in the stable-queue for 3.7.2.  Are there any plans to 
include that commit in stable kernels?

In any case, I've cherry-picked that commit on top of 3.5.7.2 (from 
Ubuntu's extended longterm series), and I'm running that now.  I'll keep 
running it for a month or so to verify that it fixes this bug.
Comment 6 Chris Wilson 2012-12-26 11:43:57 UTC
Sigh, that is one that Daniel should have earmarked for stable. Can you please test the patch with 3.7 and if it works send an email to stable@vger.kernel.org containing the commit id, a reference to this bugzilla and a tested-by.
Comment 7 Daniel Gnoutcheff 2012-12-27 04:35:01 UTC
> Sigh, that is one that Daniel should have earmarked for stable. Can you please
> test the patch with 3.7 and if it works send an email to stable@vger.kernel.org
> containing the commit id, a reference to this bugzilla and a tested-by.

OK, applied on 3.7 and verified that nothing blows up.  It'll be a while 
longer before I can be sure that it fixes this bug, but since it's 
already known to fix other bugs, I've submitted it to stable.

I'll follow up with the Ubuntu kernel team about getting it included in 
their extended stable kernel as well.
Comment 8 Daniel Gnoutcheff 2012-12-28 02:31:57 UTC
Reported to Ubuntu kernel team at:
https://bugs.launchpad.net/linux/+bug/1094173
Comment 9 Daniel Vetter 2013-01-07 15:40:29 UTC
On Fri, Dec 28, 2012 at 3:31 AM,  <bugzilla-daemon@freedesktop.org> wrote:
> --- Comment #8 from Daniel Gnoutcheff <daniel@gnoutcheff.name> ---
> Reported to Ubuntu kernel team at:
> https://bugs.launchpad.net/linux/+bug/1094173

If the patch works on 3.7 you only need to send the commit sha1 (in
the 3.8-rc upstream) of it with a link to this bugzilla and a
tested-by to stable@vger.kernel.org It will the automatically trickle
down to stable kernels and distro kernel builds.
Comment 10 Daniel Gnoutcheff 2013-01-09 04:50:48 UTC
> If the patch works on 3.7 you only need to send the commit sha1 (in
> the 3.8-rc upstream) of it with a link to this bugzilla and a
> tested-by to stable@vger.kernel.org It will the automatically trickle
> down to stable kernels and distro kernel builds.

Thanks for the advice.  I have had an experience, though, with a stable 
kernel maintainer who wanted the submitted patches to apply with no 
manual effort, not even trivial context changes.  The patch in question 
wouldn't apply to 3.5.7.y without context changes, so I wanted to be safe.

BTW, is this patch relevant for kernels 3.4 and older?  The linked 
bugzillas gave me the impression that the bugs addressed by this commit 
have only been witnessed in kernels 3.5 and later, and of those, it 
appears that only 3.7 is maintained on kernel.org.  (3.5.7.y comes from 
Ubuntu's "extended longterm kernel" effort).
Comment 11 Daniel Gnoutcheff 2013-02-12 00:38:00 UTC
Alright, I am officially convinced that the aforementioned commit does indeed fix this bug.  During the past month and a half, I made sure that I was always running a kernel that included that patch, and I have not seen this bug in that time.

For the record, the patch was released in longterm kernel v3.7.3 as commit
  41c8765e911cf54ad0c71bf3a1642b918af937e8
and in Ubuntu's extended longterm kernel v3.5.7.3 as commit
  13938a31f36fa72027928eddb159327ab5568a46

Thanks!


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.