]> git.baikalelectronics.ru Git - kernel.git/commit
drm/crtc-helper: fix locking for drm_helper_disable_unused_functions
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 20 Mar 2014 13:26:34 +0000 (14:26 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 21 Mar 2014 22:03:19 +0000 (08:03 +1000)
commitd14144eabfdb12b524e100964546fa9e22ad7cee
tree279a27b94365580c1cb5e60841fa455bd34409fe
parentb197218d1aebce0a02216576db873529b683a487
drm/crtc-helper: fix locking for drm_helper_disable_unused_functions

We have two calling contexts for thise function:

- In the crtc helper code itself as part of the ->set_config
  implementation. In this calling context all modeset locks are
  already held, as they should.

- In drivers not implementing fastboot before the fbdev/fbcon setup
  and initialization. This has been added for all drivers in

  commit 18c0ef69182bac9d2cffa950bb27f3c33a7539dc
  Author: Daniel Vetter <daniel.vetter@ffwll.ch>
  Date:   Sun Jan 20 23:12:54 2013 +0100

      drm/fb-helper: don't disable everything in initial_config

  In this calling context we do not hold any modeset locks since the
  immediately following call to initialize the fbev emulation grabs
  all these locks themselves.

- There are two exceptions to the above rule: shmob doesn't have fbdev
  emulation support. I've manually checked the callchain up to the
  driver load function and no kms locks are held.

The right fix therefore is to split this helper into an internal and
external version and add the required locking to the function exported
to drivers.

This remedies locking inconsistencies exposed by me adding locking
WARNs as part of the recent kerneldoc abi polishing done in

commit 943bb8782193eaf8248943d3c0d08707ef4bb527
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jan 23 22:18:47 2014 +0100

    drm/crtc-helper: remove LOCKING from kerneldoc

and

commit 8f17135833303a087bdbc940226921a781b72e40
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jan 23 15:14:15 2014 +0100

    drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.c

v2: It helps when I actually git add the entire thing.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc_helper.c