drm/amd/display: Fix system hang after multiple hotplugs (v3)

[Why]
mutex_lock() was introduced in dm_disable_vblank(), which could
be called in an IRQ context. Waiting in IRQ would cause issues
like kernel lockup, etc.

[How]
Handle code that requires mutex lock on a different thread.

v2: squash in compilation fix without CONFIG_DRM_AMD_DC_DCN (Alex)
v3: squash in warning fix (Wei)

Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
This commit is contained in:
Qingqing Zhuo
2021-02-09 16:36:41 -05:00
committed by Alex Deucher
parent 1e34891369
commit d7faf6f534
2 changed files with 92 additions and 13 deletions

View File

@@ -92,6 +92,20 @@ struct dm_compressor_info {
uint64_t gpu_addr;
};
/**
* struct vblank_workqueue - Works to be executed in a separate thread during vblank
* @mall_work: work for mall stutter
* @dm: amdgpu display manager device
* @otg_inst: otg instance of which vblank is being set
* @enable: true if enable vblank
*/
struct vblank_workqueue {
struct work_struct mall_work;
struct amdgpu_display_manager *dm;
int otg_inst;
bool enable;
};
/**
* struct amdgpu_dm_backlight_caps - Information about backlight
*
@@ -243,6 +257,15 @@ struct amdgpu_display_manager {
*/
struct mutex audio_lock;
/**
* @vblank_work_lock:
*
* Guards access to deferred vblank work state.
*/
#if defined(CONFIG_DRM_AMD_DC_DCN)
spinlock_t vblank_lock;
#endif
/**
* @audio_component:
*
@@ -321,6 +344,10 @@ struct amdgpu_display_manager {
struct hdcp_workqueue *hdcp_workqueue;
#endif
#if defined(CONFIG_DRM_AMD_DC_DCN)
struct vblank_workqueue *vblank_workqueue;
#endif
struct drm_atomic_state *cached_state;
struct dc_state *cached_dc_state;