--- v5
+++ v3
@@ -1,25 +1,28 @@
Replace comments about places where the console lock should be held with
calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held.
-Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v3:
-New patch in v3 of this patchset
-
-Changes in v4:
--Keep the comments about which fbcon functions need locks in place
---
- drivers/video/fbdev/core/fbcon.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ drivers/video/fbdev/core/fbcon.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
-index c910e74d46ff..cd8d52a967aa 100644
+index c910e74d46ff..ac2cbdf710ee 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
-@@ -828,6 +828,8 @@ static int set_con2fb_map(int unit, int newidx, int user)
+@@ -817,8 +817,6 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
+ *
+ * Maps a virtual console @unit to a frame buffer device
+ * @newidx.
+- *
+- * This should be called with the console lock held.
+ */
+ static int set_con2fb_map(int unit, int newidx, int user)
+ {
+@@ -828,6 +826,8 @@ static int set_con2fb_map(int unit, int newidx, int user)
struct fb_info *oldinfo = NULL;
int found, err = 0;
@@ -28,7 +31,12 @@
if (oldidx = newidx)
return 0;
-@@ -3044,6 +3046,8 @@ static int fbcon_fb_unbind(int idx)
+@@ -3039,11 +3039,12 @@ static inline int fbcon_unbind(void)
+ }
+ #endif /* CONFIG_VT_HW_CONSOLE_BINDING */
+
+-/* called with console_lock held */
+ static int fbcon_fb_unbind(int idx)
{
int i, new_idx = -1, ret = 0;
@@ -37,7 +45,12 @@
if (!fbcon_has_console_bind)
return 0;
-@@ -3094,6 +3098,8 @@ static int fbcon_fb_unregistered(struct fb_info *info)
+@@ -3089,11 +3090,12 @@ static int fbcon_fb_unbind(int idx)
+ return ret;
+ }
+
+-/* called with console_lock held */
+ static int fbcon_fb_unregistered(struct fb_info *info)
{
int i, idx;
@@ -46,7 +59,11 @@
idx = info->node;
for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] = idx)
-@@ -3131,6 +3137,9 @@ static int fbcon_fb_unregistered(struct fb_info *info)
+@@ -3127,10 +3129,12 @@ static int fbcon_fb_unregistered(struct fb_info *info)
+ return 0;
+ }
+
+-/* called with console_lock held */
static void fbcon_remap_all(int idx)
{
int i;
@@ -56,7 +73,12 @@
for (i = first_fb_vc; i <= last_fb_vc; i++)
set_con2fb_map(i, idx, 0);
-@@ -3177,6 +3186,8 @@ static int fbcon_fb_registered(struct fb_info *info)
+@@ -3172,11 +3176,12 @@ static inline void fbcon_select_primary(struct fb_info *info)
+ }
+ #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */
+
+-/* called with console_lock held */
+ static int fbcon_fb_registered(struct fb_info *info)
{
int ret = 0, i, idx;
@@ -65,6 +87,14 @@
idx = info->node;
fbcon_select_primary(info);
+@@ -3325,7 +3330,6 @@ static int fbcon_event_notify(struct notifier_block *self,
+ ret = fbcon_fb_unregistered(info);
+ break;
+ case FB_EVENT_SET_CONSOLE_MAP:
+- /* called with console lock held */
+ con2fb = event->data;
+ ret = set_con2fb_map(con2fb->console - 1,
+ con2fb->framebuffer, 1);
--
2.17.1