drm/helper: lock all around force mode restore
authorDave Airlie <airlied@redhat.com>
Fri, 21 Mar 2014 00:45:40 +0000 (10:45 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 21 Mar 2014 22:05:32 +0000 (08:05 +1000)
Since Daniel documented things with a sledge hammer, we got lots of
nice backtraces in suspend/resume operations, I've check the callers
of this and they all seems safe to me,

This fixes one set of warns I reported.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc_helper.c

index 5d2b7a5716e6981e23e00f7401d1ef8b4a5eefe1..c0f2d626607045ece3189955c8894d2d5c114a7b 100644 (file)
@@ -983,6 +983,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
        int encoder_dpms;
        bool ret;
 
+       drm_modeset_lock_all(dev);
        list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 
                if (!crtc->enabled)
@@ -1017,6 +1018,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
 
        /* disable the unused connectors while restoring the modesetting */
        __drm_helper_disable_unused_functions(dev);
+       drm_modeset_unlock_all(dev);
 }
 EXPORT_SYMBOL(drm_helper_resume_force_mode);