• Ville Syrjälä's avatar
    drm/i915: Fix locking for intel_enable_pipe_a() · ecc68a4b
    Ville Syrjälä authored
    commit 208bf9fd upstream.
    
    intel_enable_pipe_a() gets called with all the modeset locks already
    held (by drm_modeset_lock_all()), so trying to grab the same
    locks using another drm_modeset_acquire_ctx is going to fail miserably.
    
    Move most of the drm_modeset_acquire_ctx handling (init/drop/fini)
    out from intel_{get,release}_load_detect_pipe() into the callers
    (intel_{crt,tv}_detect()). Only the actual locking and backoff
    handling is left in intel_get_load_detect_pipe(). And in
    intel_enable_pipe_a() we just share the mode_config.acquire_ctx from
    drm_modeset_lock_all() which is already holding all the relevant locks.
    
    It's perfectly legal to lock the same ww_mutex multiple times using the
    same ww_acquire_ctx. drm_modeset_lock() will convert the returned
    -EALREADY into 0, so the caller doesn't need to do antyhing special.
    
    Fixes a hang on resume on my 830.
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ecc68a4b
intel_drv.h 33 KB