aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-06 06:37:15 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-06 07:41:15 -0500
commit1fe7841d892925aff10c3b070937e974d7835d2b (patch)
treed6583207eae0d63583ed099e399cf33652bc5b94
parentd5264ed3823abb0513cbdc5dd7444d4f61954409 (diff)
drm: Don't block the kworker waiting for mode_config.mutex in output_poll()
If we cannot acquire the mode_config.mutex immediately, just back off and queue a new attempt after the poll interval. This is mostly to stop the hung task spam when the system is deadlocked, but it will also lessen the load (in such extreme cases). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> [danvet:s/lock/mutex/ per Eric's comment.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161206113715.30382-1-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 078d9703a4fe..ac953f037be7 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -392,7 +392,11 @@ static void output_poll_execute(struct work_struct *work)
392 if (!drm_kms_helper_poll) 392 if (!drm_kms_helper_poll)
393 goto out; 393 goto out;
394 394
395 mutex_lock(&dev->mode_config.mutex); 395 if (!mutex_trylock(&dev->mode_config.mutex)) {
396 repoll = true;
397 goto out;
398 }
399
396 drm_for_each_connector(connector, dev) { 400 drm_for_each_connector(connector, dev) {
397 401
398 /* Ignore forced connectors. */ 402 /* Ignore forced connectors. */