Skip to contentSkip to conversation

staging/vboxvideo: Another FIXME item

PATCH In review Daniel Vetter 4 participants 4 messages Feb 21, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/vboxvideo: Another FIXME item

Found while grepping around.

Cc Hans de Goede <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Liviu Dudau <[email protected]>
---
 drivers/staging/vboxvideo/vbox_irq.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/staging/vboxvideo/vbox_irq.c +5 -0
index 195484713365..89944134ea86 100644
@@ -123,6 +123,11 @@ static void vbox_update_mode_hints(struct vbox_private *vbox)
 
 	validate_or_set_position_hints(vbox);
 	drm_modeset_lock_all(dev);
+	/*
+	 * FIXME: this needs to use drm_connector_list_iter and some real
+	 * locking for the actual data it changes, not the deprecated
+	 * drm_modeset_lock_all() shotgun approach.
+	 */
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		vbox_conn = to_vbox_connector(connector);
 
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Daniel Vetter

Found while grepping around.

Cc Hans de Goede <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Liviu Dudau <[email protected]>
---
 drivers/staging/vboxvideo/vbox_irq.c | 5 +++++
 1 file changed, 5 insertions(+)
#2 lore raw
In reply to Daniel Vetter

Hi,

Quoted 17 lines · Daniel Vetter

Found while grepping around.

Cc Hans de Goede <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Liviu Dudau <[email protected]>
---
  drivers/staging/vboxvideo/vbox_irq.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/staging/vboxvideo/vbox_irq.c +0 -0
index 195484713365..89944134ea86 100644

drivers/staging/vboxvideo/vbox_irq.c static void vbox_update_mode_hints(struct vbox_private *vbox) · line 130

Quoted 8 lines
drivers/staging/vboxvideo/vbox_irq.c +5 -0
@@ -123,6 +123,11 @@ static void vbox_update_mode_hints(struct vbox_private *vbox)
 
  	validate_or_set_position_hints(vbox);
  	drm_modeset_lock_all(dev);
+	/*
+	 * FIXME: this needs to use drm_connector_list_iter and some real
+	 * locking for the actual data it changes, not the deprecated
+	 * drm_modeset_lock_all() shotgun approach.
+	 */

Question, are the locking expectations from the drm's core pov (for modesetting-drivers) *fully* (and clearly) documented somewhere?

Regards,

Hans

Quoted 4 lines
drivers/staging/vboxvideo/vbox_irq.c +0 -0
  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
  		vbox_conn = to_vbox_connector(connector);
 
#3 lore raw
Quoted 15 lines · Hans de Goede

Hi,

Quoted 12 lines · Daniel Vetter

Found while grepping around.

Cc Hans de Goede <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Liviu Dudau <[email protected]>
---
  drivers/staging/vboxvideo/vbox_irq.c | 5 +++++
  1 file changed, 5 insertions(+)
Quoted 15 lines

drivers/staging/vboxvideo/vbox_irq.c static void vbox_update_mode_hints(struct vbox_private *vbox) · line 129

Quoted 12 lines
drivers/staging/vboxvideo/vbox_irq.c +5 -0
index 195484713365..89944134ea86 100644
@@ -123,6 +123,11 @@ static void vbox_update_mode_hints(struct vbox_private *vbox)
  	validate_or_set_position_hints(vbox);
  	drm_modeset_lock_all(dev);
+	/*
+	 * FIXME: this needs to use drm_connector_list_iter and some real
+	 * locking for the actual data it changes, not the deprecated
+	 * drm_modeset_lock_all() shotgun approach.
+	 */

Question, are the locking expectations from the drm's core pov (for modesetting-drivers) *fully* (and clearly) documented somewhere?

All the things I've touched the past few years wrt locking should have kerneldoc comments explaining the rules. For most drivers you don't need much if any locking though, because the core+helpers take care of everything. So yeah exists, but spread thinly around everywhere.

Above is probably fine since you don't hotplug connectors and modeset_lock_all gives you a good chance you have enough locking. But modeset_lock_all is deprecated for atomic drivers, because it makes it unclear what exactly you're protecting against. The usual BKL considered harmful reasons. I just noticed that qxl has the same pattern, probably similarly grown through fairly long history.
-Daniel

Quoted 11 lines

Regards,

Hans

Quoted 3 lines
drivers/staging/vboxvideo/vbox_irq.c +0 -0
  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
  		vbox_conn = to_vbox_connector(connector);
 
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