linux_dsm_epyc7002/drivers/gpu/drm/i915
Maarten Lankhorst 842e03076f drm/i915: Update state before setting watermarks, v2.
When intel_update_watermarks is called on skylake from the hw
state readout disable function it calls intel_update_watermarks.
intel_update_watermarks inspects crtc->state, which should be
set to disabled.

This wasn't the case, and this resulted in a divide-by-zero in
skl_update_wm when intel_update_watermarks got called.

 ------------[ cut here ]------------
 WARNING: CPU: 1 PID: 295 at drivers/gpu/drm/i915/intel_pm.c:2834
skl_update_pipe_wm+0x102/0x8c0 [i915]()
 WARN_ON(!config->num_pipes_active)
 Modules linked in: coretemp i915(+)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 CPU: 1 PID: 295 Comm: systemd-udevd Tainted: G     U  W       4.5.0-rc4
-xxxxxx #25
 Hardware name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  0000000000000000 ffff88003777f5a8 ffffffff813485c2 ffff88003777f5f0
  ffffffffa0236240 ffff88003777f5e0 ffffffff81050fce ffff8800aa420000
  ffff8800aba18000 ffff8800aba18000 ffff880037304c00 ffff8800aa420000
 Call Trace:
  [<ffffffff813485c2>] dump_stack+0x67/0x95
  [<ffffffff81050fce>] warn_slowpath_common+0x9e/0xc0
  [<ffffffff8105103c>] warn_slowpath_fmt+0x4c/0x50
  [<ffffffff8106945e>] ? flush_work+0x8e/0x280
  [<ffffffff810693d5>] ? flush_work+0x5/0x280
  [<ffffffffa016add2>] skl_update_pipe_wm+0x102/0x8c0 [i915]
  [<ffffffffa016b96f>] skl_update_wm+0xff/0x5f0 [i915]
  [<ffffffff810928ee>] ? trace_hardirqs_on_caller+0x15e/0x1d0
  [<ffffffff8109296d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffffa016ce6e>] intel_update_watermarks+0x1e/0x30 [i915]
  [<ffffffffa01d3ee2>] intel_crtc_disable_noatomic+0xd2/0x150 [i915]
  [<ffffffffa01dd3d2>] intel_modeset_setup_hw_state+0xdd2/0xde0 [i915]
  [<ffffffffa01dfd83>] intel_modeset_init+0x15a3/0x1950 [i915]
  [<ffffffffa02160b6>] i915_driver_load+0x13c6/0x1720 [i915]
  [<ffffffff81522160>] ? add_sysfs_fw_map_entry+0x9b/0x9b
  [<ffffffffa00b15ef>] drm_dev_register+0x6f/0xb0 [drm]
  [<ffffffffa00b3b3a>] drm_get_pci_dev+0x10a/0x1d0 [drm]
  [<ffffffffa01582d9>] i915_pci_probe+0x49/0x50 [i915]
  [<ffffffff8138ae30>] pci_device_probe+0x80/0xf0
  [<ffffffff8143e2ac>] driver_probe_device+0x1bc/0x3d0
  [<ffffffff8143e526>] __driver_attach+0x66/0x90
  [<ffffffff8143e4c0>] ? driver_probe_device+0x3d0/0x3d0
  [<ffffffff8143be3b>] bus_for_each_dev+0x5b/0xa0
  [<ffffffff8143db3e>] driver_attach+0x1e/0x20
  [<ffffffff8143d461>] bus_add_driver+0x151/0x270
  [<ffffffff8143eabc>] driver_register+0x8c/0xd0
  [<ffffffff8138a2ed>] __pci_register_driver+0x5d/0x60
  [<ffffffffa00b3c58>] drm_pci_init+0x58/0xf0 [drm]
  [<ffffffff8109296d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffffa02aa000>] ? 0xffffffffa02aa000
  [<ffffffffa02aa094>] i915_init+0x94/0x9b [i915]
  [<ffffffff81000423>] do_one_initcall+0x113/0x1f0
  [<ffffffff810a4b21>] ? rcu_read_lock_sched_held+0x61/0x90
  [<ffffffff811601dc>] ? kmem_cache_alloc_trace+0x1cc/0x280
  [<ffffffff8111110a>] do_init_module+0x60/0x1c8
  [<ffffffff810c731b>] load_module+0x1ceb/0x2410
  [<ffffffff810c3a60>] ? store_uevent+0x40/0x40
  [<ffffffff811763d1>] ? kernel_read+0x41/0x60
  [<ffffffff810c7c1d>] SYSC_finit_module+0x8d/0xa0
  [<ffffffff810c7c4e>] SyS_finit_module+0xe/0x10
  [<ffffffff815f1e97>] entry_SYSCALL_64_fastpath+0x12/0x6f
 ---[ end trace 1149e9ab3695a423 ]---
 ------------[ cut here ]------------

Changes since v1:
- Clear state before calling any function after .crtc_disable.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/56D6FD21.7020907@linux.intel.com
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-03-10 14:17:01 +01:00
..
dvo_ch7xxx.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ch7017.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ivch.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ns2501.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_sil164.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_tfp410.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo.h drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
i915_cmd_parser.c drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
i915_debugfs.c drm/i915/hangcheck: Prevent long walks across full-ppgtt 2016-03-04 15:17:14 +02:00
i915_dma.c drm/i915: Avoid snooping with userptr where not supported 2016-03-02 13:46:21 +00:00
i915_drv.c drm/i915: Use atomic helpers for suspend, v2. 2016-02-16 11:23:46 +01:00
i915_drv.h drm/i915: Refactor platform specifics out of intel_get_shared_dpll() 2016-03-09 11:55:31 +02:00
i915_gem_batch_pool.c
i915_gem_batch_pool.h
i915_gem_context.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_debug.c
i915_gem_dmabuf.c drm/i915: Use CPU mapping for userspace dma-buf mmap() 2016-02-09 11:21:03 +01:00
i915_gem_evict.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_execbuffer.c drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_gem_fence.c Linux 4.4-rc4 2015-12-08 11:04:26 +10:00
i915_gem_gtt.c drm/i915: Move the NULL sg handling out from rotate_pages() 2016-03-01 12:48:09 +02:00
i915_gem_gtt.h drm/i915: Reorganize intel_rotation_info 2016-03-01 12:48:09 +02:00
i915_gem_render_state.c drm/i915: mark GEM object pages dirty when mapped & written by the CPU 2015-12-11 18:11:53 +01:00
i915_gem_render_state.h
i915_gem_shrinker.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_stolen.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_tiling.c drm/i915: get runtime PM reference around GEM set_tiling IOCTL 2015-11-17 18:43:30 +02:00
i915_gem_userptr.c drm/i915: Avoid snooping with userptr where not supported 2016-03-02 13:46:21 +00:00
i915_gem.c drm/i915: Avoid snooping with userptr where not supported 2016-03-02 13:46:21 +00:00
i915_gpu_error.c drm/i915/hangcheck: Prevent long walks across full-ppgtt 2016-03-04 15:17:14 +02:00
i915_guc_reg.h drm/i915/guc: Add GuC ADS (Addition Data Structure) - allocation 2016-01-05 11:33:34 +01:00
i915_guc_submission.c drm/i915/guc: Decouple GuC engine id from ring id 2016-01-25 10:56:30 +00:00
i915_ioc32.c
i915_irq.c drm/i915/hangcheck: Prevent long walks across full-ppgtt 2016-03-04 15:17:14 +02:00
i915_params.c drm/i915: drop unused i915.disable_vtd_wa module parameter 2016-02-19 17:27:15 +02:00
i915_params.h drm/i915: drop unused i915.disable_vtd_wa module parameter 2016-02-19 17:27:15 +02:00
i915_reg.h drm/i915: Read out hrawclk from CCK on vlv/chv 2016-03-04 14:44:09 +02:00
i915_suspend.c drm/i915/bxt: Don't save/restore eDP panel power during suspend (v3) 2016-02-02 20:12:05 +02:00
i915_sysfs.c drm/i915: Hold RPM reference while setting freq limits through sysfs 2016-03-02 18:50:47 +02:00
i915_trace_points.c
i915_trace.h drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_vgpu.c
i915_vgpu.h drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
intel_acpi.c
intel_atomic_plane.c drm/i915: Pass the correct crtc state to .update_plane() 2016-03-10 13:49:31 +02:00
intel_atomic.c drm/i915: Fix watermarks for VLV/CHV 2016-03-10 14:02:03 +02:00
intel_audio.c drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW 2016-03-07 17:51:28 +02:00
intel_bios.c drm/i915/bios: Fix the sequence size calculations for MIPI seq v3 2016-01-15 11:38:11 +02:00
intel_bios.h drm/i915/bios: add defines for v3 sequence block 2016-01-11 19:16:19 +02:00
intel_crt.c drm/i915: Move HSW/BDW pll selection logic to intel_dpll_mgr.c 2016-03-09 11:55:31 +02:00
intel_csr.c drm/i915/gen9: Fix DMC firmware initialization 2016-03-07 15:15:29 +02:00
intel_ddi.c drm/i915: Make SKL/KBL DPLL0 managed by the shared dpll code 2016-03-09 11:55:32 +02:00
intel_display.c drm/i915: Update state before setting watermarks, v2. 2016-03-10 14:17:01 +01:00
intel_dp_link_training.c drm/i915/dp: reduce missing TPS3 support errors to debug logging 2016-02-05 14:46:27 +02:00
intel_dp_mst.c drm/i915: Manage HSW/BDW LCPLLs with the shared dpll interface 2016-03-09 11:55:32 +02:00
intel_dp.c drm/i915: Make SKL/KBL DPLL0 managed by the shared dpll code 2016-03-09 11:55:32 +02:00
intel_dpll_mgr.c drm/i915: Make SKL/KBL DPLL0 managed by the shared dpll code 2016-03-09 11:55:32 +02:00
intel_dpll_mgr.h drm/i915: Make SKL/KBL DPLL0 managed by the shared dpll code 2016-03-09 11:55:32 +02:00
intel_drv.h drm/i915: Fix watermarks for VLV/CHV 2016-03-10 14:02:03 +02:00
intel_dsi_panel_vbt.c drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dsi_pll.c drm/i915/bxt: Additional MIPI clock divider form B0 stepping onwards 2016-03-03 15:05:52 +02:00
intel_dsi.c drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dsi.h drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dvo.c drm: Pass 'name' to drm_encoder_init() 2015-12-11 09:13:20 +01:00
intel_fbc.c drm/i915/fbc: enable FBC by default on HSW and BDW 2016-02-19 18:06:16 -02:00
intel_fbdev.c drm/i915: Don't pass plane+plane_state to intel_pin_and_fence_fb_obj() 2016-03-01 12:48:09 +02:00
intel_fifo_underrun.c drm/i915: Introduce bdw_{update,enable,disable}_pipe_irq() 2015-11-26 18:55:39 +02:00
intel_frontbuffer.c
intel_guc_fwif.h drm/i915/guc: Decouple GuC engine id from ring id 2016-01-25 10:56:30 +00:00
intel_guc_loader.c drm/i915/guc: Do not wait for firmware load atomically 2016-02-15 16:10:19 +00:00
intel_guc.h drm/i915/guc: Decouple GuC engine id from ring id 2016-01-25 10:56:30 +00:00
intel_hdmi.c drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW 2016-03-07 17:51:28 +02:00
intel_hotplug.c drm/i915: intel_hpd_init(): Fix suspend/resume reprobing 2016-01-13 10:49:42 +02:00
intel_i2c.c drm/i915: Actually retry with bit-banging after GMBUS timeout 2016-03-09 17:06:50 +02:00
intel_lrc.c drm/i915/lrc: Do not wait atomically when stopping engines 2016-03-03 17:26:51 +00:00
intel_lrc.h drm/i915: Make LRC (un)pinning work on context and engine 2016-01-28 17:23:15 +00:00
intel_lvds.c drm/i915: Store a direct pointer to shared dpll in intel_crtc_state 2016-03-09 11:55:30 +02:00
intel_mocs.c drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
intel_mocs.h
intel_modes.c
intel_opregion.c drm/i915/opregion: handle VBT sizes bigger than 6 KB 2015-12-17 11:40:57 +02:00
intel_overlay.c drm/i915: simplify allocation of driver-internal requests 2016-01-21 09:21:29 +01:00
intel_panel.c drm/i915: Use DIV_ROUND_CLOSEST for PWM calculations 2016-03-04 14:46:52 +02:00
intel_pm.c drm/i915: Only use sanitized values for ILK watermarks 2016-03-09 10:05:46 +01:00
intel_psr.c Revert "drm/i915: Enable PSR by default on Valleyview and Cherryview." 2016-03-10 13:49:22 +02:00
intel_renderstate_gen6.c
intel_renderstate_gen7.c
intel_renderstate_gen8.c
intel_renderstate_gen9.c
intel_renderstate.h
intel_ringbuffer.c drm/i915: Don't ERROR for an expected intel_rcs_ctx_init() interruption 2016-02-15 10:48:08 +01:00
intel_ringbuffer.h drm/i915/hangcheck: Prevent long walks across full-ppgtt 2016-03-04 15:17:14 +02:00
intel_runtime_pm.c drm/i915/bxt: add missing DSI power domain to power well 1 2016-03-09 09:59:17 +02:00
intel_sdvo_regs.h drm/i915/sdvo: revert bogus kernel-doc comments to normal comments 2016-01-20 10:21:34 +02:00
intel_sdvo.c drm/i915: Move the encoder vs. FDI dotclock check out from encoder .get_config() 2016-03-01 13:04:04 +02:00
intel_sideband.c drm/i915: Extend gpio read/write to other cores 2016-02-04 19:11:17 +02:00
intel_sprite.c drm/i915: Pass drm_frambuffer to intel_compute_page_offset() 2016-03-01 12:48:09 +02:00
intel_tv.c drm/i915: remove dead code 2016-02-29 17:58:09 +01:00
intel_uncore.c drm/i915: Generalise common GPU engine reset request/unrequest code 2016-03-04 15:17:05 +02:00
Kconfig drm/i915: Kconfig for extra driver debugging 2016-03-03 17:26:57 +00:00
Kconfig.debug drm/i915: Kconfig for extra driver debugging 2016-03-03 17:26:57 +00:00
Makefile drm/i915: Move shared dpll code to a new file 2016-03-09 11:55:29 +02:00