Commit ba6f582606655754d9dfbfc9dffe75dcf806f1dd

Authored by Sergei Antonov
Committed by Dave Airlie
1 parent 3640da2faa

drm/crtc-helper: skip locking checks in panicking path

Skip locking checks in drm_helper_*_in_use() if they are called in panicking
path. See similar code in drm_warn_on_modeset_not_all_locked().

After panic information has been output, these WARN_ONs go off outputing a lot
of lines and scrolling the panic information out of the screen. Here is a
partial call trace showing how execution reaches them:

? drm_helper_crtc_in_use()
? __drm_helper_disable_unused_functions()
? several *_set_config functions
? drm_fb_helper_restore_fbdev_mode()

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

Showing 1 changed file with 15 additions and 2 deletions Side-by-side Diff

drivers/gpu/drm/drm_crtc_helper.c
... ... @@ -29,6 +29,7 @@
29 29 * Jesse Barnes <jesse.barnes@intel.com>
30 30 */
31 31  
  32 +#include <linux/kernel.h>
32 33 #include <linux/export.h>
33 34 #include <linux/moduleparam.h>
34 35  
... ... @@ -88,7 +89,13 @@
88 89 struct drm_connector *connector;
89 90 struct drm_device *dev = encoder->dev;
90 91  
91   - WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
  92 + /*
  93 + * We can expect this mutex to be locked if we are not panicking.
  94 + * Locking is currently fubar in the panic handler.
  95 + */
  96 + if (!oops_in_progress)
  97 + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
  98 +
92 99 list_for_each_entry(connector, &dev->mode_config.connector_list, head)
93 100 if (connector->encoder == encoder)
94 101 return true;
... ... @@ -112,7 +119,13 @@
112 119 struct drm_encoder *encoder;
113 120 struct drm_device *dev = crtc->dev;
114 121  
115   - WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
  122 + /*
  123 + * We can expect this mutex to be locked if we are not panicking.
  124 + * Locking is currently fubar in the panic handler.
  125 + */
  126 + if (!oops_in_progress)
  127 + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
  128 +
116 129 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
117 130 if (encoder->crtc == crtc && drm_helper_encoder_in_use(encoder))
118 131 return true;