drm: Don't block the kworker waiting for mode_config.mutex in output_poll()
authorChris Wilson <[email protected]>
Tue, 6 Dec 2016 11:37:15 +0000 (11:37 +0000)
committerDaniel Vetter <[email protected]>
Tue, 6 Dec 2016 12:41:15 +0000 (13:41 +0100)
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 <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
[danvet:s/lock/mutex/ per Eric's comment.]
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_probe_helper.c

index 078d9703a4fe337c264cd768f297bf40264bacda..ac953f037be7efb7edac1c67d43e46b20b3be365 100644 (file)
@@ -392,7 +392,11 @@ static void output_poll_execute(struct work_struct *work)
        if (!drm_kms_helper_poll)
                goto out;
 
-       mutex_lock(&dev->mode_config.mutex);
+       if (!mutex_trylock(&dev->mode_config.mutex)) {
+               repoll = true;
+               goto out;
+       }
+
        drm_for_each_connector(connector, dev) {
 
                /* Ignore forced connectors. */