linux/drivers/gpu/drm/i915
Lyude 1f7717552e drm/i915: Fix race condition in intel_dp_destroy_mst_connector()
After unplugging a DP MST display from the system, we have to go through
and destroy all of the DRM connectors associated with it since none of
them are valid anymore. Unfortunately, intel_dp_destroy_mst_connector()
doesn't do a good enough job of ensuring that throughout the destruction
process that no modesettings can be done with the connectors. As it is
right now, intel_dp_destroy_mst_connector() works like this:

* Take all modeset locks
* Clear the configuration of the crtc on the connector, if there is one
* Drop all modeset locks, this is required because of circular
  dependency issues that arise with trying to remove the connector from
  sysfs with modeset locks held
* Unregister the connector
* Take all modeset locks, again
* Do the rest of the required cleaning for destroying the connector
* Finally drop all modeset locks for good

This only works sometimes. During the destruction process, it's very
possible that a userspace application will attempt to do a modesetting
using the connector. When we drop the modeset locks, an ioctl handler
such as drm_mode_setcrtc has the oppurtunity to take all of the modeset
locks from us. When this happens, one thing leads to another and
eventually we end up committing a mode with the non-existent connector:

	[drm:intel_dp_link_training_clock_recovery [i915]] *ERROR* failed to enable link training
	[drm:intel_dp_aux_ch] dp_aux_ch timeout status 0x7cf0001f
	[drm:intel_dp_start_link_train [i915]] *ERROR* failed to start channel equalization
	[drm:intel_dp_aux_ch] dp_aux_ch timeout status 0x7cf0001f
	[drm:intel_mst_pre_enable_dp [i915]] *ERROR* failed to allocate vcpi

And in some cases, such as with the T460s using an MST dock, this
results in breaking modesetting and/or panicking the system.

To work around this, we now unregister the connector at the very
beginning of intel_dp_destroy_mst_connector(), grab all the modesetting
locks, and then hold them until we finish the rest of the function.

CC: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
Signed-off-by: Rob Clark <rclark@redhat.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1458155884-13877-1-git-send-email-cpaul@redhat.com
2016-03-17 09:12:28 +01:00
..
dvo.h
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
i915_cmd_parser.c drm/i915: Rename intel_engine_cs function parameters 2016-03-16 15:33:10 +00:00
i915_debugfs.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
i915_dma.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +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/bios: drop has_mipi in favor of intel_bios_is_dsi_present 2016-03-16 18:28:57 +02:00
i915_gem.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
i915_gem_batch_pool.c
i915_gem_batch_pool.h
i915_gem_context.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00:00
i915_gem_debug.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
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: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
i915_gem_fence.c
i915_gem_gtt.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00: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: Rename intel_engine_cs struct members 2016-03-16 15:33:17 +00:00
i915_gem_render_state.h drm/i915: Rename intel_engine_cs function parameters 2016-03-16 15:33:10 +00:00
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
i915_gem_userptr.c drm/i915: Avoid snooping with userptr where not supported 2016-03-02 13:46:21 +00:00
i915_gpu_error.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00:00
i915_guc_reg.h
i915_guc_submission.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00:00
i915_ioc32.c
i915_irq.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
i915_params.c drm/i915: add module param "enable_dp_mst" 2016-03-16 16:40:50 +01:00
i915_params.h drm/i915: add module param "enable_dp_mst" 2016-03-16 16:40:50 +01:00
i915_reg.h drm/i915/bxt: fix dsi hw state pipe readout 2016-03-16 18:10:54 +02:00
i915_suspend.c drm/i915/bxt: Don't save/restore eDP panel power during suspend (v3) 2016-02-08 11:32:32 +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.h drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00:00
i915_trace_points.c
i915_vgpu.c
i915_vgpu.h
intel_acpi.c
intel_atomic.c drm/i915: Remove some post-commit members from intel_crtc->atomic, v3. 2016-03-16 14:50:25 +01:00
intel_atomic_plane.c drm/i915: Pass the correct crtc state to .update_plane() 2016-03-10 13:49:31 +02:00
intel_audio.c drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW 2016-03-07 18:45:49 +02:00
intel_bios.c drm/i915/bios: drop has_mipi in favor of intel_bios_is_dsi_present 2016-03-16 18:28:57 +02:00
intel_bios.h
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/csr: Allow matching unknown HW steppings with generic firmware 2016-03-16 17:53:00 +02:00
intel_ddi.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_display.c drm/i915: make transcoder_name return a string 2016-03-16 18:09:53 +02:00
intel_dp.c drm/i915: move VBT based eDP port check to intel_bios.c 2016-03-16 18:28:36 +02:00
intel_dp_link_training.c drm/i915/dp: reduce missing TPS3 support errors to debug logging 2016-02-08 11:37:17 +02:00
intel_dp_mst.c drm/i915: Fix race condition in intel_dp_destroy_mst_connector() 2016-03-17 09:12:28 +01:00
intel_dpll_mgr.c drm/i915/bxt: Fix off-by-one error in Broxton PLL IDs 2016-03-16 16:08:44 +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: Nuke fbc members from intel_crtc->atomic, v4. 2016-03-16 14:50:43 +01:00
intel_dsi.c drm/i915: move VBT based DSI presence check to intel_bios.c 2016-03-16 18:28:43 +02:00
intel_dsi.h drm/i915: add for_each_port_masked macro 2016-03-16 18:08:48 +02:00
intel_dsi_panel_vbt.c drm/i915/dsi: start using enum mipi_dsi_pixel_format 2016-03-16 17:55:52 +02:00
intel_dsi_pll.c drm/i915/dsi: start using enum mipi_dsi_pixel_format 2016-03-16 17:55:52 +02:00
intel_dvo.c
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: make transcoder_name return a string 2016-03-16 18:09:53 +02:00
intel_frontbuffer.c
intel_guc.h drm/i915/guc: Decouple GuC engine id from ring id 2016-01-25 10:56:30 +00:00
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: Support GuC SKL v6.1 2016-03-16 15:26:58 -07:00
intel_hdmi.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_hotplug.c
intel_i2c.c drm/i915: Actually retry with bit-banging after GMBUS timeout 2016-03-11 10:23:28 +02:00
intel_lrc.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
intel_lrc.h drm/i915: Rename intel_engine_cs function parameters 2016-03-16 15:33:10 +00:00
intel_lvds.c drm/i915: move VBT based LVDS presence check to intel_bios.c 2016-03-16 18:28:26 +02:00
intel_mocs.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
intel_mocs.h
intel_modes.c
intel_opregion.c
intel_overlay.c drm/i915: Rename intel_engine_cs struct members 2016-03-16 15:33:17 +00:00
intel_panel.c drm/i915/panel: setup pwm backlight based on connector type 2016-03-16 18:28:50 +02:00
intel_pm.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00: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.h
intel_renderstate_gen6.c
intel_renderstate_gen7.c
intel_renderstate_gen8.c
intel_renderstate_gen9.c
intel_ringbuffer.c drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
intel_ringbuffer.h drm/i915: More renaming of rings to engines 2016-03-16 15:33:30 +00:00
intel_runtime_pm.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10: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_sdvo_regs.h
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: move VBT based TV presence check to intel_bios.c 2016-03-16 18:28:07 +02:00
intel_uncore.c drm/i915: More intel_engine_cs renaming 2016-03-16 15:33:24 +00: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