linux_dsm_epyc7002/drivers/gpu/drm
Chris Wilson 4676dc838b drm/i915: Use fence_write() from rpm resume
During rpm resume we restore the fences, but we do not have the
protection of struct_mutex. This rules out updating the activity
tracking on the fences, and requires us to rely on the rpm as the
serialisation barrier instead.

[  350.298052] [drm:intel_runtime_resume [i915]] Resuming device
[  350.308606]
[  350.310520] ===============================
[  350.315560] [ INFO: suspicious RCU usage. ]
[  350.320554] 4.8.0-rc8-bsw-rapl+ #3133 Tainted: G     U  W
[  350.327208] -------------------------------
[  350.331977] ../drivers/gpu/drm/i915/i915_gem_request.h:371 suspicious rcu_dereference_protected() usage!
[  350.342619]
[  350.342619] other info that might help us debug this:
[  350.342619]
[  350.351593]
[  350.351593] rcu_scheduler_active = 1, debug_locks = 0
[  350.358952] 3 locks held by Xorg/320:
[  350.363077]  #0:  (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffffa030589c>] drm_modeset_lock_all+0x3c/0xd0 [drm]
[  350.375162]  #1:  (crtc_ww_class_acquire){+.+.+.}, at: [<ffffffffa03058a6>] drm_modeset_lock_all+0x46/0xd0 [drm]
[  350.387022]  #2:  (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffffa0305056>] drm_modeset_lock+0x36/0x110 [drm]
[  350.398236]
[  350.398236] stack backtrace:
[  350.403196] CPU: 1 PID: 320 Comm: Xorg Tainted: G     U  W       4.8.0-rc8-bsw-rapl+ #3133
[  350.412457] Hardware name: Intel Corporation CHERRYVIEW C0 PLATFORM/Braswell CRB, BIOS BRAS.X64.X088.R00.1510270350 10/27/2015
[  350.425212]  0000000000000000 ffff8801680a78c8 ffffffff81332187 ffff88016c5c5000
[  350.433611]  0000000000000001 ffff8801680a78f8 ffffffff810ca6da ffff88016cc8b0f0
[  350.442012]  ffff88016cc80000 ffff88016cc80000 ffff880177ad0000 ffff8801680a7948
[  350.450409] Call Trace:
[  350.453165]  [<ffffffff81332187>] dump_stack+0x67/0x90
[  350.458931]  [<ffffffff810ca6da>] lockdep_rcu_suspicious+0xea/0x120
[  350.466002]  [<ffffffffa039e8dd>] fence_update+0xbd/0x670 [i915]
[  350.472766]  [<ffffffffa039efe2>] i915_gem_restore_fences+0x52/0x70 [i915]
[  350.480496]  [<ffffffffa0368f42>] vlv_resume_prepare+0x72/0x570 [i915]
[  350.487839]  [<ffffffffa0369802>] intel_runtime_resume+0x102/0x210 [i915]
[  350.495442]  [<ffffffff8137f26f>] pci_pm_runtime_resume+0x7f/0xb0
[  350.502274]  [<ffffffff8137f1f0>] ? pci_restore_standard_config+0x40/0x40
[  350.509883]  [<ffffffff814401c5>] __rpm_callback+0x35/0x70
[  350.516037]  [<ffffffff8137f1f0>] ? pci_restore_standard_config+0x40/0x40
[  350.523646]  [<ffffffff81440224>] rpm_callback+0x24/0x80
[  350.529604]  [<ffffffff8137f1f0>] ? pci_restore_standard_config+0x40/0x40
[  350.537212]  [<ffffffff814417bd>] rpm_resume+0x4ad/0x740
[  350.543161]  [<ffffffff81441aa1>] __pm_runtime_resume+0x51/0x80
[  350.549824]  [<ffffffffa03889c8>] intel_runtime_pm_get+0x28/0x90 [i915]
[  350.557265]  [<ffffffffa0388a53>] intel_display_power_get+0x23/0x50 [i915]
[  350.565001]  [<ffffffffa03ef23d>] intel_atomic_commit_tail+0xdfd/0x10b0 [i915]
[  350.573106]  [<ffffffffa034b2e9>] ? drm_atomic_helper_swap_state+0x159/0x300 [drm_kms_helper]
[  350.582659]  [<ffffffff81615091>] ? _raw_spin_unlock+0x31/0x50
[  350.589205]  [<ffffffffa034b2e9>] ? drm_atomic_helper_swap_state+0x159/0x300 [drm_kms_helper]
[  350.598787]  [<ffffffffa03ef8a5>] intel_atomic_commit+0x3b5/0x500 [i915]
[  350.606319]  [<ffffffffa03061dc>] ? drm_atomic_set_crtc_for_connector+0xcc/0x100 [drm]
[  350.615209]  [<ffffffffa0306b49>] drm_atomic_commit+0x49/0x50 [drm]
[  350.622242]  [<ffffffffa034dee8>] drm_atomic_helper_set_config+0x88/0xc0 [drm_kms_helper]
[  350.631419]  [<ffffffffa02f94ac>] drm_mode_set_config_internal+0x6c/0x120 [drm]
[  350.639623]  [<ffffffffa02fa94c>] drm_mode_setcrtc+0x22c/0x4d0 [drm]
[  350.646760]  [<ffffffffa02f0f19>] drm_ioctl+0x209/0x460 [drm]
[  350.653217]  [<ffffffffa02fa720>] ? drm_mode_getcrtc+0x150/0x150 [drm]
[  350.660536]  [<ffffffff810c984a>] ? __lock_is_held+0x4a/0x70
[  350.666885]  [<ffffffff81202303>] do_vfs_ioctl+0x93/0x6b0
[  350.672939]  [<ffffffff8120f843>] ? __fget+0x113/0x200
[  350.678797]  [<ffffffff8120f735>] ? __fget+0x5/0x200
[  350.684361]  [<ffffffff81202964>] SyS_ioctl+0x44/0x80
[  350.690030]  [<ffffffff81001deb>] do_syscall_64+0x5b/0x120
[  350.696184]  [<ffffffff81615ada>] entry_SYSCALL64_slow_path+0x25/0x25

Note we also have to remember the lesson from commit 4fc788f5ee
("drm/i915: Flush delayed fence releases after reset") where we have to
flush any changes to the fence on restore.

v2: Replace call to release user mmaps with an assertion that they have
already been zapped.

Fixes: 49ef5294cd ("drm/i915: Move fence tracking from object to vma")
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161012114827.17031-1-chris@chris-wilson.co.uk
2016-10-12 16:27:14 +01:00
..
amd Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-10-10 16:40:16 +10:00
arc drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
arm drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
armada drm/prime: Take a ref on the drm_dev when exporting a dma_buf 2016-10-05 15:30:32 +02:00
ast drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
atmel-hlcdc Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
bochs bugfixes for qemu (bochs, qxl and virtio-gpu) drm drivers 2016-09-28 13:23:07 +10:00
bridge drm/bridge: Drop drm_connector_unregister and call drm_connector_cleanup directly 2016-10-10 11:19:42 +02:00
cirrus drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
etnaviv Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux into drm-next 2016-09-28 11:24:05 +10:00
exynos drm/exynos: g2d: simplify g2d_free_runqueue_node() 2016-10-01 00:39:42 +09:00
fsl-dcu Merge tag 'topic/drm-misc-2016-09-25' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-09-28 10:28:23 +10:00
gma500 drm/gma500: remove unnecessary config_enabled() guard 2016-08-24 07:43:42 +02:00
hisilicon drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
i2c Revert "drm/i2c: tda998x: don't register the connector" 2016-09-23 03:29:50 -07:00
i810
i915 drm/i915: Use fence_write() from rpm resume 2016-10-12 16:27:14 +01:00
imx Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
mediatek drm/mediatek: mark symbols static where possible 2016-10-04 08:23:01 +02:00
mga
mgag200 drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
msm Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
nouveau Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
omapdrm drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag support for plane commit 2016-08-29 11:29:37 +02:00
panel drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel 2016-09-16 17:32:48 +02:00
qxl bugfixes for qemu (bochs, qxl and virtio-gpu) drm drivers 2016-09-28 13:23:07 +10:00
r128
radeon Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-10-10 16:40:16 +10:00
rcar-du drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
rockchip drm/rockchip: analogix_dp: Refuse to enable PSR if panel doesn't support it 2016-10-04 08:23:17 +02:00
savage GPU-DRM-Savage: Use memdup_user() rather than duplicating 2016-08-19 10:58:55 +02:00
shmobile
sis
sti Merge branch 'sti-drm-next-2016-09-20' of https://github.com/vinceab/linux into drm-next 2016-09-28 11:14:58 +10:00
sun4i Allwinner sun4i DRM fixes for 4.9 2016-09-28 11:23:15 +10:00
tdfx
tegra drm/prime: Take a ref on the drm_dev when exporting a dma_buf 2016-10-05 15:30:32 +02:00
tilcdc Second attempt for 3rd drm/tilcdc pull request for v4.9. 2016-09-28 11:17:26 +10:00
ttm drm/ttm: remove cpu_address member from ttm_tt 2016-09-16 15:53:05 -04:00
udl drm/prime: Take a ref on the drm_dev when exporting a dma_buf 2016-10-05 15:30:32 +02:00
vc4 drm/vc4: Add support for double-clocked modes. 2016-10-06 11:58:28 -07:00
vgem drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
via
virtio drm: virtio: reinstate drm_virtio_set_busid() 2016-10-04 13:10:30 +10:00
vmwgfx Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-09-20 06:17:38 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c drm/atomic-helper: Fix sparse warnings 2016-09-19 16:44:36 +02:00
drm_atomic.c Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
drm_auth.c
drm_blend.c drm/doc: Polish plane composition property docs 2016-09-22 00:04:02 -07:00
drm_bridge.c drm: Extract drm_bridge.h 2016-09-19 15:04:15 +02:00
drm_bufs.c GPU-DRM: Replace a kzalloc() call by kcalloc() in drm_legacy_addbufs_sg() 2016-09-21 13:24:27 +02:00
drm_cache.c
drm_color_mgmt.c drm/doc: Document color space handling 2016-09-22 00:04:03 -07:00
drm_connector.c drm: Release resources with a safer function 2016-10-10 11:20:48 +02:00
drm_context.c
drm_crtc_helper_internal.h drm/fb-helper: Fix sparse warnings 2016-09-19 16:45:15 +02:00
drm_crtc_helper.c drm/kms-helpers: Extract drm_modeset_helper.[hc] 2016-08-16 16:10:19 +02:00
drm_crtc_internal.h drm: Extract drm_color_mgmt.[hc] 2016-09-22 00:04:02 -07:00
drm_crtc.c drm: Extract drm_color_mgmt.[hc] 2016-09-22 00:04:02 -07:00
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c drm: Don't export dp-aux devnode functions 2016-08-16 18:49:26 +02:00
drm_dp_dual_mode_helper.c
drm_dp_helper.c Merge tag 'topic/drm-misc-2016-09-25' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-09-28 10:28:23 +10:00
drm_dp_mst_topology.c
drm_drv.c drm: Simplify drm_printk to reduce object size quite a bit 2016-10-04 08:23:14 +02:00
drm_edid_load.c
drm_edid.c drm/edid: Move dvi_dual/max_tmds_clock parsing out from drm_edid_to_eld() 2016-10-04 08:23:12 +02:00
drm_encoder_slave.c
drm_encoder.c drm: Fix typo in encoder docs 2016-09-21 13:33:50 +02:00
drm_fb_cma_helper.c
drm_fb_helper.c Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
drm_flip_work.c
drm_fops.c drm: remove redundant drm_file->uid 2016-09-19 11:21:42 +02:00
drm_fourcc.c drm: move drm_mode_legacy_fb_format to drm_fourcc.c 2016-08-29 15:37:28 +02:00
drm_framebuffer.c drm: Extract drm_plane.[hc] 2016-09-22 00:01:56 -07:00
drm_gem_cma_helper.c
drm_gem.c drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
drm_global.c drm: modify drm_global_item_ref to avoid two times of writing ref->object 2016-09-14 15:10:29 -04:00
drm_hashtab.c drm: fix signed integer overflow 2016-09-06 13:56:41 -04:00
drm_info.c drm: remove redundant drm_file->uid 2016-09-19 11:21:42 +02:00
drm_internal.h drm: drop obsolete drm_core.h 2016-09-19 13:57:38 +02:00
drm_ioc32.c drm: drop obsolete drm_core.h 2016-09-19 13:57:38 +02:00
drm_ioctl.c drm: drop obsolete drm_core.h 2016-09-19 13:57:38 +02:00
drm_irq.c drm: Document caveats around atomic event handling 2016-10-04 08:23:15 +02:00
drm_kms_helper_common.c drm: Don't export dp-aux devnode functions 2016-08-16 18:49:26 +02:00
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/dsi: Implement DCS set/get display brightness 2016-08-24 13:34:00 +02:00
drm_mm.c
drm_mode_object.c drm: Move property validation to a helper, v2. 2016-09-12 10:32:49 -04:00
drm_modes.c drm: update kerneldoc for changes introduced by commits "16fadc2568e9" and "9671e228fb78" 2016-08-16 17:32:08 +02:00
drm_modeset_helper.c drm/kms-helpers: Extract drm_modeset_helper.[hc] 2016-08-16 16:10:19 +02:00
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_pci.c drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
drm_plane_helper.c drm: Fix kerneldoc in drm_plane_helper.c 2016-08-16 18:50:04 +02:00
drm_plane.c drm: Undo damage to page_flip_ioctl 2016-10-04 12:53:12 +10:00
drm_platform.c drm: Don't swallow error codes in drm_dev_alloc() 2016-09-22 04:03:48 -07:00
drm_prime.c drm: Fix up kerneldoc for new drm_gem_dmabuf_export() 2016-10-10 11:19:42 +02:00
drm_probe_helper.c drm: drm_probe_helper: Fix output_poll_work scheduling 2016-08-31 13:23:30 +02:00
drm_property.c Revert "drm: Unify handling of blob and object properties" 2016-09-07 13:24:22 +03:00
drm_rect.c drm: Warn about negative sizes when calculating scale factor 2016-08-08 14:17:56 -04:00
drm_scatter.c
drm_simple_kms_helper.c drm: simple_kms_helper: Add prepare_fb and cleanup_fb hooks 2016-10-05 15:18:02 +02:00
drm_sysfs.c drm: drop obsolete drm_core.h 2016-09-19 13:57:38 +02:00
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
Kconfig Revert "drm: make DRI1 drivers depend on BROKEN" 2016-09-01 06:16:12 +10:00
Makefile drm: Extract drm_color_mgmt.[hc] 2016-09-22 00:04:02 -07:00