]> git.baikalelectronics.ru Git - kernel.git/commit
drm/property: Enforce more lifetime rules
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Oct 2019 14:49:52 +0000 (16:49 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Nov 2019 17:17:36 +0000 (18:17 +0100)
commitf7b7dbd01382b34efe2f71de8476f4300d9b3932
tree7331ce8f04b9da3637a5b2c3ed645cff008611ac
parentce8b84013969e8210cd17aed864fee19c6e7891c
drm/property: Enforce more lifetime rules

Properties can't be attached after registering, userspace would get
confused (no one bothers to reprobe really).

- Add kerneldoc
- Enforce this with some checks. This needs a somewhat ugly check
  since connectors can be added later on, but we still need to attach
  all properties before they go public.

Note that we already enforce that properties themselves are created
before the entire device is registered.

Unfortunately this doesn't work for drivers which have a ->load
callback, see

commit 5342bfbf9131a8c222f144c317ae0658392bc37c (tag:
drm-misc-next-fixes-2019-09-18)
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Sep 17 14:09:35 2019 +0200

    drm/kms: Duct-tape for mode object lifetime checks

for the full story.

v2: Fix the superflous newline (Jani) and add commit citation to
explain why we need to check for dev->registered (Thierry).

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rajat Jain <rajatja@google.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191023144953.28190-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_mode_object.c