Bug 93258 - [SKL] WARN_ON(ret < 0) drivers/gpu/drm/i915/intel_display.c:13696 intel_prepare_plane_fb
Summary: [SKL] WARN_ON(ret < 0) drivers/gpu/drm/i915/intel_display.c:13696 intel_prepa...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Maarten Lankhorst
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-05 02:47 UTC by Joseph Yasi
Modified: 2016-10-10 13:08 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Show the error returned. (434 bytes, patch)
2015-12-07 09:50 UTC, Maarten Lankhorst
no flags Details | Splinter Review
widen ret to long (802 bytes, text/plain)
2015-12-08 08:48 UTC, Maarten Lankhorst
no flags Details

Description Joseph Yasi 2015-12-05 02:47:24 UTC
I've seen a couple of these warnings in the kernel log with the new fence patches: 3c28ff22f6e20cc946cb5a2b77d14862999f7ba0.

System Environment:
Motherboard: Asus Z170-DELUXE
CPU: Intel i7-6700K
BIOS: 1302
Kernel: drm-intel-nightly from 2015-12-03

The display is a 4k monitor connected on DP1.

I can trigger the warning by putting the monitor in power suspend:
xset dpms force suspend

PID 17293 is X.org.

[75381.483794] ------------[ cut here ]------------
[75381.483835] WARNING: CPU: 0 PID: 17293 at drivers/gpu/drm/i915/intel_display.c:13696 intel_prepare_plane_fb+0x258/0x2b0 [i915]()
[75381.483839] WARN_ON(ret < 0)
[75381.483841] Modules linked in:
[75381.483844]  hfsplus msdos jfs xfs fuse nfsv3 nfs fscache rfcomm ip6table_filter ip6_tables iptable_filter ip_tables x_tables tun pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) binfmt_misc bnep vboxdrv(O) snd_hda_codec_hdmi vfat fat snd_hda_codec_realtek snd_hda_codec_generic mxm_wmi snd_usb_audio snd_usbmidi_lib snd_pcm_oss snd_mixer_oss snd_hda_intel btusb snd_hda_codec uvcvideo btrtl snd_hwdep btbcm videobuf2_vmalloc snd_hda_core videobuf2_v4l2 btintel snd_seq_oss videobuf2_core videobuf2_memops v4l2_common videodev wl(PO) intel_rapl bluetooth media snd_pcm input_leds snd_seq_midi iosf_mbi x86_pkg_temp_thermal intel_powerclamp snd_rawmidi crct10dif_pclmul crc32_pclmul snd_seq_midi_event crc32c_intel snd_seq aesni_intel snd_seq_device aes_x86_64 efi_pstore lrw snd_timer glue_helper ablk_helper
[75381.483929]  cryptd snd soundcore efivars cfg80211 rfkill sg battery acpi_als wmi kfifo_buf industrialio intel_lpss_acpi intel_lpss mfd_core tpm_tis tpm acpi_pad processor nfsd auth_rpcgss oid_registry nfs_acl lockd grace sunrpc coretemp loop efivarfs ipv6 hid_generic usbhid uas usb_storage igb hwmon e1000e dca ptp bcache psmouse i915 pps_core intel_gtt i2c_algo_bit xhci_pci drm_kms_helper syscopyarea sysfillrect xhci_hcd sysimgblt fb_sys_fops sr_mod drm cdrom usbcore usb_common i2c_core fan thermal video button
[75381.483996] CPU: 0 PID: 17293 Comm: Xorg Tainted: P        W  O    4.4.0-rc3+git20151203-customskl-drmnightly #1
[75381.484000] Hardware name: System manufacturer System Product Name/Z170-DELUXE, BIOS 1302 11/09/2015
[75381.484003]  ffffffffc02783a8 ffffffff8132a58e ffff88044d243bb0 ffffffff81049153
[75381.484033]  ffff88045deb0240 ffff88044d243c00 ffff88045c8bc800 ffff88045deb0240
[75381.484039]  ffff8801a27bf180 ffffffff810491c7 ffffffffc028634e ffff880100000020
[75381.484045] Call Trace:
[75381.484054]  [<ffffffff8132a58e>] ? dump_stack+0x47/0x69
[75381.484062]  [<ffffffff81049153>] ? warn_slowpath_common+0x73/0xa0
[75381.484085]  [<ffffffff810491c7>] ? warn_slowpath_fmt+0x47/0x50
[75381.484119]  [<ffffffffc021f1f8>] ? intel_prepare_plane_fb+0x258/0x2b0 [i915]
[75381.484136]  [<ffffffffc017264b>] ? drm_atomic_helper_prepare_planes+0x4b/0xc0 [drm_kms_helper]
[75381.484168]  [<ffffffffc0216c04>] ? intel_atomic_commit+0x224/0x1690 [i915]
[75381.484195]  [<ffffffffc00adcf0>] ? drm_atomic_check_only+0x190/0x580 [drm]
[75381.484203]  [<ffffffff810f3ddd>] ? kmemdup+0x2d/0x40
[75381.484213]  [<ffffffffc0173289>] ? __drm_atomic_helper_crtc_duplicate_state+0x29/0x40 [drm_kms_helper]
[75381.484222]  [<ffffffffc0173e63>] ? drm_atomic_helper_connector_dpms+0xe3/0x190 [drm_kms_helper]
[75381.484237]  [<ffffffffc00a3b21>] ? drm_mode_obj_set_property_ioctl+0x231/0x240 [drm]
[75381.484249]  [<ffffffffc00a3b59>] ? drm_mode_connector_property_set_ioctl+0x29/0x30 [drm]
[75381.484262]  [<ffffffffc0095b9c>] ? drm_ioctl+0x12c/0x4b0 [drm]
[75381.484276]  [<ffffffffc00a3b30>] ? drm_mode_obj_set_property_ioctl+0x240/0x240 [drm]
[75381.484283]  [<ffffffff81331ee4>] ? timerqueue_add+0x54/0xa0
[75381.484289]  [<ffffffff81099476>] ? hrtimer_start_range_ns+0x1a6/0x300
[75381.484296]  [<ffffffff81149183>] ? do_vfs_ioctl+0x293/0x470
[75381.484303]  [<ffffffff814e4368>] ? __sys_recvmsg+0x58/0x70
[75381.484328]  [<ffffffff8115234b>] ? __fget+0x6b/0xb0
[75381.484350]  [<ffffffff811493cf>] ? SyS_ioctl+0x6f/0x80
[75381.484366]  [<ffffffff815a069b>] ? entry_SYSCALL_64_fastpath+0x16/0x6e
[75381.484375] ---[ end trace 31684214f36947a8 ]---
[75404.355720] [drm:gen8_irq_handler [i915]] *ERROR* CPU pipe A FIFO underrun
Comment 1 Jani Nikula 2015-12-07 09:44:54 UTC
commit 3c28ff22f6e20cc946cb5a2b77d14862999f7ba0
Author: Alex Goins <agoins@nvidia.com>
Date:   Wed Nov 25 18:43:39 2015 -0800

    i915: wait for fence in prepare_plane_fb
Comment 2 Maarten Lankhorst 2015-12-07 09:50:05 UTC
Created attachment 120384 [details] [review]
Show the error returned.

Could you try the above patch and post the new WARN you get?
Comment 3 Joseph Yasi 2015-12-08 04:08:05 UTC
waiting returns -1

[   61.740959] ------------[ cut here ]------------
[   61.741000] WARNING: CPU: 0 PID: 2169 at drivers/gpu/drm/i915/intel_display.c:13696 intel_prepare_plane_fb+0x253/0x2b0 [i915]()
[   61.741047] waiting returns -1
[   61.741049] Modules linked in: nfsv3 nfs fscache rfcomm ip6table_filter ip6_tables iptable_filter ip_tables x_tables tun pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) binfmt_misc bnep vboxdrv(O) vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_usb_audio snd_usbmidi_lib mxm_wmi snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm_oss uvcvideo snd_mixer_oss videobuf2_vmalloc videobuf2_v4l2 videobuf2_core videobuf2_memops v4l2_common videodev btusb snd_pcm wl(PO) media snd_seq_oss btrtl btbcm snd_seq_midi btintel intel_rapl input_leds bluetooth snd_rawmidi iosf_mbi x86_pkg_temp_thermal snd_seq_midi_event intel_powerclamp snd_seq crct10dif_pclmul snd_seq_device crc32_pclmul efi_pstore snd_timer crc32c_intel cfg80211 aesni_intel rfkill snd aes_x86_64 lrw glue_helper
[   61.741140]  ablk_helper soundcore cryptd efivars sg wmi battery intel_lpss_acpi intel_lpss acpi_als mfd_core tpm_tis tpm kfifo_buf industrialio acpi_pad processor nfsd coretemp auth_rpcgss oid_registry nfs_acl lockd grace sunrpc loop efivarfs ipv6 hid_generic usbhid uas usb_storage i915 intel_gtt igb hwmon e1000e drm_kms_helper dca syscopyarea sysfillrect sysimgblt bcache fb_sys_fops psmouse ptp xhci_pci pps_core xhci_hcd i2c_algo_bit sr_mod drm cdrom usbcore i2c_core usb_common fan thermal video button
[   61.741210] CPU: 0 PID: 2169 Comm: Xorg Tainted: P           O    4.4.0-rc3+git20151204.1-customskl-drmnightly #1
[   61.741214] Hardware name: System manufacturer System Product Name/Z170-DELUXE, BIOS 1302 11/09/2015
[   61.741217]  ffffffffc03213e8 ffffffff8132a58e ffff88044bb93bb0 ffffffff81049153
[   61.741223]  ffff88045920fa80 ffff88044bb93c00 ffff88045c977800 ffff88045920fa80
[   61.741229]  ffff88040260f9c0 ffffffff810491c7 ffffffffc032fdf1 ffff880400000020
[   61.741234] Call Trace:
[   61.741253]  [<ffffffff8132a58e>] ? dump_stack+0x47/0x69
[   61.741260]  [<ffffffff81049153>] ? warn_slowpath_common+0x73/0xa0
[   61.741269]  [<ffffffff810491c7>] ? warn_slowpath_fmt+0x47/0x50
[   61.741295]  [<ffffffffc02c8043>] ? intel_prepare_plane_fb+0x253/0x2b0 [i915]
[   61.741306]  [<ffffffffc01dc65b>] ? drm_atomic_helper_prepare_planes+0x4b/0xc0 [drm_kms_helper]
[   61.741333]  [<ffffffffc02bfa54>] ? intel_atomic_commit+0x224/0x1690 [i915]
[   61.741347]  [<ffffffffc00bbd60>] ? drm_atomic_check_only+0x190/0x580 [drm]
[   61.741353]  [<ffffffff810f3ddd>] ? kmemdup+0x2d/0x40
[   61.741362]  [<ffffffffc01dd299>] ? __drm_atomic_helper_crtc_duplicate_state+0x29/0x40 [drm_kms_helper]
[   61.741375]  [<ffffffffc01dde73>] ? drm_atomic_helper_connector_dpms+0xe3/0x190 [drm_kms_helper]
[   61.741391]  [<ffffffffc00b1b91>] ? drm_mode_obj_set_property_ioctl+0x231/0x240 [drm]
[   61.741403]  [<ffffffffc00b1bc9>] ? drm_mode_connector_property_set_ioctl+0x29/0x30 [drm]
[   61.741414]  [<ffffffffc00a3bcc>] ? drm_ioctl+0x12c/0x4b0 [drm]
[   61.741425]  [<ffffffffc00b1ba0>] ? drm_mode_obj_set_property_ioctl+0x240/0x240 [drm]
[   61.741433]  [<ffffffff81331ee4>] ? timerqueue_add+0x54/0xa0
[   61.741438]  [<ffffffff81099476>] ? hrtimer_start_range_ns+0x1a6/0x300
[   61.741445]  [<ffffffff81149183>] ? do_vfs_ioctl+0x293/0x470
[   61.741452]  [<ffffffff814e4358>] ? __sys_recvmsg+0x58/0x70
[   61.741457]  [<ffffffff8115234b>] ? __fget+0x6b/0xb0
[   61.741462]  [<ffffffff811493cf>] ? SyS_ioctl+0x6f/0x80
[   61.741472]  [<ffffffff815a069b>] ? entry_SYSCALL_64_fastpath+0x16/0x6e
[   61.741476] ---[ end trace c6c72c216a8faf04 ]---
Comment 4 Maarten Lankhorst 2015-12-08 08:41:47 UTC
Ok so your fence wait function is busted.. Not a i915 bug but a bug in the driver implementing fence.
Comment 5 Maarten Lankhorst 2015-12-08 08:48:25 UTC
Created attachment 120411 [details]
widen ret to long

Just in case it is our bug, can you try this and see if you get an error other than -1?
Comment 6 Joseph Yasi 2015-12-08 13:12:30 UTC
(In reply to Maarten Lankhorst from comment #5)
> Created attachment 120411 [details]
> widen ret to long
> 
> Just in case it is our bug, can you try this and see if you get an error
> other than -1?

That fixed it. I don't get a warning anymore. Reading through the fence_default_wait, it can return the timeout back and MAX_SCHEDULE_TIMEOUT is LONG_MAX so it overflowed the int to -1.
Comment 7 Andreas Reis 2016-01-11 04:39:42 UTC
Same (or similar, and also since beginning of December) bug on HSW, fixed by this patch.

Didn't just get a few warnings but often dozens each second.
Comment 8 Maarten Lankhorst 2016-01-11 07:31:06 UTC
I wanted to close the bug, but seems I never sent the patch for it.

Hereby..

commit bcf8be279c79df6a8a17d9c3e1f9bc926444a87c
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Tue Dec 8 15:52:56 2015 +0100

    drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.
Comment 9 Jari Tahvanainen 2016-10-10 13:08:28 UTC
Closing resolved+fixed, verified by Josef, and after checking that code is in git tree (it is).


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.