[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-28 Thread Chris Wilson
On Mon, Nov 28, 2016 at 08:26:07AM +0100, Daniel Vetter wrote: > On Wed, Nov 23, 2016 at 02:04:15PM +, Chris Wilson wrote: > > +#define drm_fb_helper_for_each_connector(fbh, i__) \ > > + for (({lockdep_assert_held(&(fbh)->dev->mode_config.mutex); 1;}), \ > > +i__ = 0; i__ < (fbh)->con

[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-28 Thread Daniel Vetter
On Wed, Nov 23, 2016 at 02:04:15PM +, Chris Wilson wrote: > The fb_helper->connector_count is modified when a new connector is > constructed following a hotplug event (e.g. DP-MST). This causes trouble > for drm_setup_crtcs() and friends that assume that fb_helper is > constant: > > [ 1250.872

[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-23 Thread Jani Nikula
On Wed, 23 Nov 2016, Chris Wilson wrote: > +#define drm_fb_helper_for_each_connector(fbh, i__) \ > + for (({lockdep_assert_held(&(fbh)->dev->mode_config.mutex); 1;}), \ > + i__ = 0; i__ < (fbh)->connector_count; i__++) No comments on the substance, but just curious, why is that "1;"

[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-23 Thread Chris Wilson
The fb_helper->connector_count is modified when a new connector is constructed following a hotplug event (e.g. DP-MST). This causes trouble for drm_setup_crtcs() and friends that assume that fb_helper is constant: [ 1250.872997] BUG: KASAN: slab-out-of-bounds in drm_setup_crtcs+0x320/0xf80 at add