Bug 98579 - [BDW] GEM_BUG_ON(view && !i915_vma_is_ggtt(vma))
Summary: [BDW] GEM_BUG_ON(view && !i915_vma_is_ggtt(vma))
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-03 17:47 UTC by mwa
Modified: 2016-11-04 14:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description mwa 2016-11-03 17:47:07 UTC
On the latest -nightly, when X is starting up, the cursor freezes and we hit the following:

[   80.997420] ------------[ cut here ]------------
[   80.998591] kernel BUG at drivers/gpu/drm/i915/i915_gem_gtt.c:3428!
[   80.999740] invalid opcode: 0000 [#1] SMP
[   81.000874] Modules linked in: rfcomm fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_REJECT nf_reject_ipv6 xt_conntrack ip6t_rpfilter ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_raw ip6table_mangle ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_raw iptable_mangle iptable_security ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep arc4 iwlmvm intel_rapl x86_pkg_temp_thermal coretemp mac80211 kvm_intel kvm iwlwifi irqbypass iTCO_wdt intel_cstate iTCO_vendor_support mei_wdt intel_uncore cfg80211 snd_hda_codec_realtek snd_hda_codec_hdmi intel_rapl_perf snd_hda_codec_generic snd_hda_intel snd_hda_codec
[   81.004764]  rtsx_pci_ms i2c_i801 memstick snd_hwdep intel_pch_thermal lpc_ich i2c_smbus btusb snd_hda_core btrtl btbcm btintel bluetooth snd_seq joydev snd_seq_device snd_pcm mei_me nfsd mei snd_timer thinkpad_acpi shpchp snd tpm_tis soundcore wmi intel_rst tpm_tis_core rfkill tpm auth_rpcgss nfs_acl lockd grace sunrpc binfmt_misc dm_crypt hid_logitech_hidpp hid_logitech_dj hid_microsoft i915 i2c_algo_bit drm_kms_helper rtsx_pci_sdmmc mmc_core drm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel serio_raw rtsx_pci ptp pps_core video fjes
[   81.011741] CPU: 2 PID: 1562 Comm: Xorg Tainted: G        W       4.9.0-rc3-drm-intel+ #119
[   81.014157] Hardware name: LENOVO 20BW000FUK/20BW000FUK, BIOS JBET54WW (1.19 ) 11/06/2015
[   81.016587] task: ffff8905ab790000 task.stack: ffffa3ae817f4000
[   81.019010] RIP: 0010:[<ffffffffc03e5ee7>]  [<ffffffffc03e5ee7>] i915_gem_obj_to_vma+0xd7/0xe0 [i915]
[   81.021495] RSP: 0018:ffffa3ae817f7b48  EFLAGS: 00010246
[   81.023960] RAX: ffffa3ae817f7c48 RBX: ffff8905a9952c90 RCX: ffffa3ae817f7c50
[   81.026416] RDX: ffffa3ae817f7c48 RSI: ffff8905a81ab898 RDI: ffff8905a8182c00
[   81.028846] RBP: ffffa3ae817f7b78 R08: 0000000000000003 R09: 0000000000000002
[   81.031254] R10: 0000000000000000 R11: 0000000000000033 R12: ffff8905a81ab898
[   81.033523] R13: ffffa3ae817f7c48 R14: ffff8905a9952ac0 R15: cfdcfdcfdcfdcfdd
[   81.034858] FS:  00007f9ba8d11a40(0000) GS:ffff8905bd880000(0000) knlGS:0000000000000000
[   81.036561] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   81.039012] CR2: 00000000026c92d0 CR3: 0000000232e96000 CR4: 00000000003406e0
[   81.041481] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   81.043599] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   81.045350] Stack:
[   81.046985]  ffffffffc02ebbd0 ffff8905a81ab898 ffff8905a8182c00 ffffa3ae817f7c48
[   81.048343]  0000000000000000 0000000000000001 ffffa3ae817f7ba8 ffffffffc03e5f63
[   81.049706]  0000000000000003 ffff8905a8182c00 ffff8905a81a8000 0000000000000000
[   81.051064] Call Trace:
[   81.052427]  [<ffffffffc02ebbd0>] ? drm_clflush_page+0x50/0xa0 [drm]
[   81.053805]  [<ffffffffc03e5f63>] i915_gem_obj_lookup_or_create_vma+0x23/0x70 [i915]
[   81.055214]  [<ffffffffc03eb919>] i915_gem_object_ggtt_pin+0x39/0x200 [i915]
[   81.056592]  [<ffffffffc03ec1da>] i915_gem_object_pin_to_display_plane+0x15a/0x190 [i915]
[   81.057969]  [<ffffffffc0424c83>] intel_pin_and_fence_fb_obj+0xa3/0x140 [i915]
[   81.059353]  [<ffffffffc042f73f>] intel_crtc_page_flip+0x2cf/0xc60 [i915]
[   81.060696]  [<ffffffffc030a232>] drm_mode_page_flip_ioctl+0x372/0x420 [drm]
[   81.062041]  [<ffffffffc02eee29>] drm_ioctl+0x1f9/0x480 [drm]
[   81.063398]  [<ffffffffc0309ec0>] ? drm_mode_cursor2_ioctl+0x10/0x10 [drm]
[   81.064831]  [<ffffffff831f866c>] ? handle_mm_fault+0x96c/0x1660
[   81.066167]  [<ffffffff83113e0d>] ? enqueue_hrtimer+0x3d/0x90
[   81.067503]  [<ffffffff83268c73>] do_vfs_ioctl+0xa3/0x5e0
[   81.068794]  [<ffffffff830a64b0>] ? wait_consider_task+0x640/0xc20
[   81.070044]  [<ffffffff830b0c1c>] ? __set_task_blocked+0x3c/0xa0
[   81.071264]  [<ffffffff83269229>] SyS_ioctl+0x79/0x90
[   81.072483]  [<ffffffff838047b7>] entry_SYSCALL_64_fastpath+0x1a/0xa9
[   81.073871] Code: 85 c0 75 88 eb c5 49 8d be 90 01 00 00 48 89 ce ba 20 00 00 00 48 89 4d d0 e8 96 da 00 c3 48 8b 4d d0 48 98 eb 92 8b 43 b8 eb d4 <0f> 0b 0f 1f 80 00 00 00 00 0f 1f 44 00 00 48 85 d2 75 31 55 48 
[   81.075906] RIP  [<ffffffffc03e5ee7>] i915_gem_obj_to_vma+0xd7/0xe0 [i915]
[   81.077306]  RSP <ffffa3ae817f7b48>
[   81.085563] ---[ end trace bb86d852464aea3b ]---
Comment 1 Chris Wilson 2016-11-03 18:33:15 UTC
Whoops, wrote the test wrong:

Can you quickly test:

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 7a6a7454f321..dd6df1af25a1 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3425,7 +3425,7 @@ static inline long vma_compare(struct i915_vma *vma,
                               struct i915_address_space *vm,
                               const struct i915_ggtt_view *view)
 {
-       GEM_BUG_ON(view && !i915_vma_is_ggtt(vma));
+       GEM_BUG_ON(view && !i915_is_ggtt(vm));
 
        if (vma->vm != vm)
                return vma->vm - v
Comment 2 mwa 2016-11-03 19:03:38 UTC
Ah, yup that fixes it. Thanks.
Comment 3 Chris Wilson 2016-11-03 21:03:36 UTC
commit a44342acde304425fa70fd4f06c0e662a79ba5aa
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Nov 3 20:08:52 2016 +0000

    drm/i915: Fix test on inputs for vma_compare()
    
    When supplying a view to vma_compare() it is required that the supplied
    i915_address_space is the global GTT. I tested the VMA instead (which is
    the current position in the rbtree and maybe from any address space).
Comment 4 yann 2016-11-04 14:07:47 UTC
Merged upstream and verified => closing


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.