# \[PATCH\] pxafb: do console locking before calling fb\_blank()

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2012/02/8598211/t

## \[PATCH\] pxafb: do console locking before calling fb\_blank()

- From: Vasily Khoruzhick \<anarsoul@gmail.com\>
- Date: 2012-02-26 13:52:02 
- Message: https://ratatoskr.run/linux-fbdev/2012/02/8598211.md

```text
Otherwise we hit WARN_CONSOLE_UNLOCKED in do_unblank_screen

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/video/pxafb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 1d1e4f1..c176561 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -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;
 }
-- 
1.7.9.2

```

## \[PATCH\] pxafb: do console locking before calling fb\_blank()

- From: Florian Tobias Schandinat \<FlorianSchandinat@gmx.de\>
- Date: 2012-03-07 10:09:18 
- Message: https://ratatoskr.run/linux-fbdev/2012/03/8599409.md

```text
On 02/26/2012 01:52 PM, Vasily Khoruzhick wrote:
> Otherwise we hit WARN_CONSOLE_UNLOCKED in do_unblank_screen
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/pxafb.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> index 1d1e4f1..c176561 100644
> --- a/drivers/video/pxafb.c
> +++ b/drivers/video/pxafb.c
> @@ -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;
>  }

```
