linux/drivers/gpu/drm/amd
Lukas Wunner aa0aad5790 drm/amdgpu: Fix deadlock on runtime suspend
amdgpu's ->runtime_suspend hook calls drm_kms_helper_poll_disable(),
which waits for the output poll worker to finish if it's running.

The output poll worker meanwhile calls pm_runtime_get_sync() in
amdgpu's ->detect hooks, which waits for the ongoing suspend to finish,
causing a deadlock.

Fix by not acquiring a runtime PM ref if the ->detect hooks are called
in the output poll worker's context.  This is safe because the poll
worker is only enabled while runtime active and we know that
->runtime_suspend waits for it to finish.

Fixes: d38ceaf99e ("drm/amdgpu: add core driver (v4)")
Cc: stable@vger.kernel.org # v4.2+: 27d4ee0307: workqueue: Allow retrieval of current task's work struct
Cc: stable@vger.kernel.org # v4.2+: 25c058ccaf: drm: Allow determining if current task is output poll worker
Cc: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://patchwork.freedesktop.org/patch/msgid/4c9bf72aacae1eef062bd134cd112e0770a7f121.1518338789.git.lukas@wunner.de
2018-02-16 22:40:23 +01:00
..
acp drm/amdgpu: add license to Makefiles 2017-12-04 11:47:55 -05:00
amdgpu drm/amdgpu: Fix deadlock on runtime suspend 2018-02-16 22:40:23 +01:00
amdkfd drm/amdgpu: add license to Makefiles 2017-12-04 11:47:55 -05:00
display drm/amd/display: call set csc_default if enable adjustment is false 2018-01-02 14:53:27 -05:00
include amdgpu DC display code for Vega. 2017-11-17 14:34:42 -08:00
lib drm/amdgpu: add license to Makefiles 2017-12-04 11:47:55 -05:00
powerplay drm/amdgpu: add license to files where it was missing 2017-12-04 11:48:24 -05:00
scheduler drm/amdgpu: add license to files where it was missing 2017-12-04 11:48:24 -05:00