diff options
author | Daniel Vetter <[email protected]> | 2019-05-28 11:03:02 +0200 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2019-06-13 10:07:09 +0200 |
commit | 94193d2aae63c49b706b1b7e535f23cfeccec93e (patch) | |
tree | fb4bdabdea1b031129a431f47357aaefb23e8dc4 | |
parent | fe2d70d6f6ff038c20705c34695bd34ac072af14 (diff) |
fbcon: Document what I learned about fbcon locking
It's not pretty.
Signed-off-by: Daniel Vetter <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Yisheng Xie <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/video/fbdev/core/fbcon.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 31d6a4e54436..b8067e07f8a8 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -88,6 +88,25 @@ # define DPRINTK(fmt, args...) #endif +/* + * FIXME: Locking + * + * - fbcon state itself is protected by the console_lock, and the code does a + * pretty good job at making sure that lock is held everywhere it's needed. + * + * - access to the registered_fb array is entirely unprotected. This should use + * proper object lifetime handling, i.e. get/put_fb_info. This also means + * switching from indices to proper pointers for fb_info everywhere. + * + * - fbcon doesn't bother with fb_lock/unlock at all. This is buggy, since it + * means concurrent access to the same fbdev from both fbcon and userspace + * will blow up. To fix this all fbcon calls from fbmem.c need to be moved out + * of fb_lock/unlock protected sections, since otherwise we'll recurse and + * deadlock eventually. Aside: Due to these deadlock issues the fbdev code in + * fbmem.c cannot use locking asserts, and there's lots of callers which get + * the rules wrong, e.g. fbsysfs.c entirely missed fb_lock/unlock calls too. + */ + enum { FBCON_LOGO_CANSHOW = -1, /* the logo can be shown */ FBCON_LOGO_DRAW = -2, /* draw the logo to a console */ |