Skip to contentSkip to conversation

drm: Update todo.rst

PATCH In review Daniel Vetter 4 participants 5 messages Jan 21, 2021 – Jan 22, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Update todo.rst

Interrnship season is starting, let's review this. One thing that's pending is Maxime's work to roll out drm_atomic_state pointers to all callbacks, he said he'll remove that entry once it's all done.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/todo.rst | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
Documentation/gpu/todo.rst +15 -13
index 009d8e6c7e3c..492768dd2fd9 100644
@@ -577,20 +577,24 @@ Contact: Daniel Vetter
 
 Level: Intermediate
 
-KMS cleanups
-------------
+Object lifetime fixes
+---------------------
+
+There's two related issues here
+
+- Cleanup up the various ->destroy callbacks, which often are all the same
+  simple code.
 
-Some of these date from the very introduction of KMS in 2008 ...
+- Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
+  which results in use-after free issues on driver unload. This can be serious
+  trouble even for drivers for hardwared integrated on the SoC due to
+  EPROBE_DEFERRED backoff.
 
-- Make ->funcs and ->helper_private vtables optional. There's a bunch of empty
-  function tables in drivers, but before we can remove them we need to make sure
-  that all the users in helpers and drivers do correctly check for a NULL
-  vtable.
+Both these problems can be solved by switching over to drmm_kzalloc(), and the
+various convenience wrappers provided, e.g. drmm_crtc_alloc_with_planes(),
+drmm_universal_plane_alloc(), ... and so on.
 
-- Cleanup up the various ->destroy callbacks. A lot of them just wrapt the
-  drm_*_cleanup implementations and can be removed. Some tack a kfree() at the
-  end, for which we could add drm_*_cleanup_kfree(). And then there's the (for
-  historical reasons) misnamed drm_primary_helper_destroy() function.
+Contact: Daniel Vetter
 
 Level: Intermediate
 
@@ -626,8 +630,6 @@ See the documentation of :ref:`VKMS <vkms>` for more details. This is an ideal
 internship task, since it only requires a virtual machine and can be sized to
 fit the available time.
 
-Contact: Daniel Vetter
-
 Level: See details
 
 Backlight Refactoring
Signature · 6 lines
2.30.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi

we talked about making dma_resv the default lock for GEM objects. Could you add an entry for this? Some interns might feel adventurous. :)

Best regards
Thomas

Am 21.01.21 um 12:29 schrieb Daniel Vetter:

Quoted 64 lines

Interrnship season is starting, let's review this. One thing that's pending is Maxime's work to roll out drm_atomic_state pointers to all callbacks, he said he'll remove that entry once it's all done.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  Documentation/gpu/todo.rst | 28 +++++++++++++++-------------
  1 file changed, 15 insertions(+), 13 deletions(-)
Documentation/gpu/todo.rst +15 -13
index 009d8e6c7e3c..492768dd2fd9 100644
@@ -577,20 +577,24 @@ Contact: Daniel Vetter
 
  Level: Intermediate
 
-KMS cleanups
-------------
+Object lifetime fixes
+---------------------
+
+There's two related issues here
+
+- Cleanup up the various ->destroy callbacks, which often are all the same
+  simple code.
 
-Some of these date from the very introduction of KMS in 2008 ...
+- Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
+  which results in use-after free issues on driver unload. This can be serious
+  trouble even for drivers for hardwared integrated on the SoC due to
+  EPROBE_DEFERRED backoff.
 
-- Make ->funcs and ->helper_private vtables optional. There's a bunch of empty
-  function tables in drivers, but before we can remove them we need to make sure
-  that all the users in helpers and drivers do correctly check for a NULL
-  vtable.
+Both these problems can be solved by switching over to drmm_kzalloc(), and the
+various convenience wrappers provided, e.g. drmm_crtc_alloc_with_planes(),
+drmm_universal_plane_alloc(), ... and so on.
 
-- Cleanup up the various ->destroy callbacks. A lot of them just wrapt the
-  drm_*_cleanup implementations and can be removed. Some tack a kfree() at the
-  end, for which we could add drm_*_cleanup_kfree(). And then there's the (for
-  historical reasons) misnamed drm_primary_helper_destroy() function.
+Contact: Daniel Vetter
 
  Level: Intermediate
 
@@ -626,8 +630,6 @@ See the documentation of :ref:`VKMS <vkms>` for more details. This is an ideal
  internship task, since it only requires a virtual machine and can be sized to
  fit the available time.
 
-Contact: Daniel Vetter
-
  Level: See details
 
  Backlight Refactoring
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 5 lines · Thomas Zimmermann

Hi

we talked about making dma_resv the default lock for GEM objects. Could you add an entry for this? Some interns might feel adventurous. :)

Level: Too hard for Daniel

Not sure that's a great internship tasks :-P

But yeah I'll try to type up something around this maybe. -Daniel

Quoted 78 lines

Best regards
Thomas

Am 21.01.21 um 12:29 schrieb Daniel Vetter:

Quoted 56 lines

Interrnship season is starting, let's review this. One thing that's pending is Maxime's work to roll out drm_atomic_state pointers to all callbacks, he said he'll remove that entry once it's all done.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  Documentation/gpu/todo.rst | 28 +++++++++++++++-------------
  1 file changed, 15 insertions(+), 13 deletions(-)
Documentation/gpu/todo.rst +15 -11
index 009d8e6c7e3c..492768dd2fd9 100644
@@ -577,20 +577,24 @@ Contact: Daniel Vetter
 
  Level: Intermediate
 
-KMS cleanups
-------------
+Object lifetime fixes
+---------------------
+
+There's two related issues here
+
+- Cleanup up the various ->destroy callbacks, which often are all the same
+  simple code.
 
-Some of these date from the very introduction of KMS in 2008 ...
+- Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
+  which results in use-after free issues on driver unload. This can be serious
+  trouble even for drivers for hardwared integrated on the SoC due to
+  EPROBE_DEFERRED backoff.
 
-- Make ->funcs and ->helper_private vtables optional. There's a bunch of empty
-  function tables in drivers, but before we can remove them we need to make sure
-  that all the users in helpers and drivers do correctly check for a NULL
-  vtable.
+Both these problems can be solved by switching over to drmm_kzalloc(), and the
+various convenience wrappers provided, e.g. drmm_crtc_alloc_with_planes(),
+drmm_universal_plane_alloc(), ... and so on.
 
-- Cleanup up the various ->destroy callbacks. A lot of them just wrapt the
-  drm_*_cleanup implementations and can be removed. Some tack a kfree() at the
-  end, for which we could add drm_*_cleanup_kfree(). And then there's the (for
-  historical reasons) misnamed drm_primary_helper_destroy() function.
+Contact: Daniel Vetter
 
  Level: Intermediate
 

Documentation/gpu/todo.rst See the documentation of :ref:`VKMS <vkms>` for more details. This is an ideal · line 635

Quoted 8 lines
Documentation/gpu/todo.rst +0 -2
@@ -626,8 +630,6 @@ See the documentation of :ref:`VKMS <vkms>` for more details. This is an ideal
  internship task, since it only requires a virtual machine and can be sized to
  fit the available time.
 
-Contact: Daniel Vetter
-
  Level: See details
 
  Backlight Refactoring

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
In reply to Daniel Vetter

Hi Daniel,

Quoted 1 line · Daniel Vetter

Interrnship season is starting, let's review this. One thing that's

^ internship

Quoted 2 lines

pending is Maxime's work to roll out drm_atomic_state pointers to all callbacks, he said he'll remove that entry once it's all done.

I plan on sending it by the end of the week

Quoted 22 lines
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/todo.rst | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
Documentation/gpu/todo.rst +2 -2
index 009d8e6c7e3c..492768dd2fd9 100644
@@ -577,20 +577,24 @@ Contact: Daniel Vetter
 
 Level: Intermediate
 
-KMS cleanups
-------------
+Object lifetime fixes
+---------------------

Documentation/gpu/todo.rst Contact: Daniel Vetter · line 590

Quoted 10 lines
Documentation/gpu/todo.rst +8 -1
+
+There's two related issues here
+
+- Cleanup up the various ->destroy callbacks, which often are all the same
+  simple code.
 
-Some of these date from the very introduction of KMS in 2008 ...
+- Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
+  which results in use-after free issues on driver unload. This can be serious
+  trouble even for drivers for hardwared integrated on the SoC due to

^ hardware?

Documentation/gpu/todo.rst Contact: Daniel Vetter · line 591

Quoted 1 line
Documentation/gpu/todo.rst +1 -0
+  EPROBE_DEFERRED backoff.

Thanks!
Maxime

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 11 lines · Maxime Ripard

Hi Daniel,

Quoted 1 line · Daniel Vetter

Interrnship season is starting, let's review this. One thing that's

^ internship

Quoted 2 lines

pending is Maxime's work to roll out drm_atomic_state pointers to all callbacks, he said he'll remove that entry once it's all done.

I plan on sending it by the end of the week

Typos fixed and pushed with your irc-ack.
-Daniel

Quoted 40 lines
Quoted 23 lines
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/todo.rst | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
Documentation/gpu/todo.rst +2 -2
index 009d8e6c7e3c..492768dd2fd9 100644
@@ -577,20 +577,24 @@ Contact: Daniel Vetter
 
 Level: Intermediate
 
-KMS cleanups
-------------
+Object lifetime fixes
+---------------------

Documentation/gpu/todo.rst Contact: Daniel Vetter · line 590

Quoted 10 lines
Documentation/gpu/todo.rst +8 -1
+
+There's two related issues here
+
+- Cleanup up the various ->destroy callbacks, which often are all the same
+  simple code.
 
-Some of these date from the very introduction of KMS in 2008 ...
+- Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
+  which results in use-after free issues on driver unload. This can be serious
+  trouble even for drivers for hardwared integrated on the SoC due to

^ hardware?

Documentation/gpu/todo.rst Contact: Daniel Vetter · line 591

Quoted 1 line
Documentation/gpu/todo.rst +1 -0
+  EPROBE_DEFERRED backoff.

Thanks!
Maxime

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel