Skip to contentSkip to conversation

pxafb: do console locking before calling fb_blank()

PATCH New Vasily Khoruzhick 2 participants 2 messages Feb 26, 2012 – Mar 7, 2012 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxafb: do console locking before calling fb_blank()

Otherwise we hit WARN_CONSOLE_UNLOCKED in do_unblank_screen

---
 drivers/video/pxafb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/video/pxafb.c +5 -1
index 1d1e4f1..c176561 100644
@@ -54,6 +54,7 @@
 #include <linux/mutex.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
+#include <linux/console.h>
 
 #include <mach/hardware.h>
 #include <asm/io.h>
@@ -730,9 +731,12 @@ static int overlayfb_open(struct fb_info *info, int user)
 	if (user == 0)
 		return -ENODEV;
 
-	if (ofb->usage++ == 0)
+	if (ofb->usage++ == 0) {
 		/* unblank the base framebuffer */
+		console_lock();
 		fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
+		console_unlock();
+	}
 
 	return 0;
 }
Signature · 1 line
1.7.9.2
#1 lore raw

PATCH 1/1 pxafb: do console locking before calling fb_blank()

Quoted 3 lines · Vasily Khoruzhick

Otherwise we hit WARN_CONSOLE_UNLOCKED in do_unblank_screen

Applied.

Thanks,

Florian Tobias Schandinat

Quoted 30 lines
---
 drivers/video/pxafb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/video/pxafb.c +5 -1
index 1d1e4f1..c176561 100644
@@ -54,6 +54,7 @@
 #include <linux/mutex.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
+#include <linux/console.h>
 
 #include <mach/hardware.h>
 #include <asm/io.h>
@@ -730,9 +731,12 @@ static int overlayfb_open(struct fb_info *info, int user)
 	if (user == 0)
 		return -ENODEV;
 
-	if (ofb->usage++ == 0)
+	if (ofb->usage++ == 0) {
 		/* unblank the base framebuffer */
+		console_lock();
 		fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
+		console_unlock();
+	}
 
 	return 0;
 }