]> 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)
commite35e95024af8ab2a9d5f7a0d0c14b49ae76b7b38
tree279a27b94365580c1cb5e60841fa455bd34409fe
parent98fb40e3228c0582371f7bb169ac4a9e646b76ce
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 deec0c4f1ad447421b334338457164729ada75e1
  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 31afb681d7fbf9e1296c54cb689ff3bedd21a225
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 2f02e617825eca6290ef8e0256d9617135e7bbbb
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