linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fbcon: set a default value to blink interval
@ 2016-02-15 18:41 Jean-Philippe Brucker
  2016-02-15 21:12 ` Scot Doyle
  2016-02-26 11:21 ` Tomi Valkeinen
  0 siblings, 2 replies; 3+ messages in thread
From: Jean-Philippe Brucker @ 2016-02-15 18:41 UTC (permalink / raw)
  To: linux-fbdev
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Scot Doyle,
	Greg Kroah-Hartman, Pavel Machek, Thierry Reding, stable

Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
	fbcon: use the cursor blink interval provided by vt

two attempts have been made at fixing a possible hang caused by
cursor_timer_handler. That function registers a timer to be triggered at
"jiffies + fbcon_ops.cur_blink_jiffies".

A new case had been encountered during initialisation of clcd-pl11x:

    fbcon_fb_registered
    do_fbcon_takeover

    ->  do_register_con_driver
        fbcon_startup
    (A) add_cursor_timer (with cur_blink_jiffies = 0)

    ->  do_bind_con_driver
        visual_init
        fbcon_init
    (B) cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);

If we take an softirq anywhere between A and B (and we do),
cursor_timer_handler executes indefinitely.

Instead of patching all possible paths that lead to this case one at a
time, fix the issue at the source and initialise cur_blink_jiffies to
200ms when allocating fbcon_ops. This was its default value before
aforesaid commit. fbcon_cursor or fbcon_init will refine this value
downstream.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Cc: <stable@vger.kernel.org> # v4.2
---
 drivers/video/console/fbcon.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 92f3949..6e92917 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -709,6 +709,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
 	}
 
 	if (!err) {
+		ops->cur_blink_jiffies = HZ / 5;
 		info->fbcon_par = ops;
 
 		if (vc)
@@ -956,6 +957,7 @@ static const char *fbcon_startup(void)
 	ops->currcon = -1;
 	ops->graphics = 1;
 	ops->cur_rotate = -1;
+	ops->cur_blink_jiffies = HZ / 5;
 	info->fbcon_par = ops;
 	p->con_rotate = initial_rotation;
 	set_blitting_type(vc, info);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fbcon: set a default value to blink interval
  2016-02-15 18:41 [PATCH] fbcon: set a default value to blink interval Jean-Philippe Brucker
@ 2016-02-15 21:12 ` Scot Doyle
  2016-02-26 11:21 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Scot Doyle @ 2016-02-15 21:12 UTC (permalink / raw)
  To: Jean-Philippe Brucker
  Cc: linux-fbdev, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Greg Kroah-Hartman, Pavel Machek, Thierry Reding, stable

On Mon, 15 Feb 2016, Jean-Philippe Brucker wrote:
> Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
> 	fbcon: use the cursor blink interval provided by vt
> 
> two attempts have been made at fixing a possible hang caused by
> cursor_timer_handler. That function registers a timer to be triggered at
> "jiffies + fbcon_ops.cur_blink_jiffies".
...
> Instead of patching all possible paths that lead to this case one at a
> time, fix the issue at the source and initialise cur_blink_jiffies to
> 200ms when allocating fbcon_ops. This was its default value before
> aforesaid commit. fbcon_cursor or fbcon_init will refine this value
> downstream.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> Cc: <stable@vger.kernel.org> # v4.2

I agree with the approach and the patch works on my x86_64.

Tested-by: Scot Doyle <lkml14@scotdoyle.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fbcon: set a default value to blink interval
  2016-02-15 18:41 [PATCH] fbcon: set a default value to blink interval Jean-Philippe Brucker
  2016-02-15 21:12 ` Scot Doyle
@ 2016-02-26 11:21 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2016-02-26 11:21 UTC (permalink / raw)
  To: Jean-Philippe Brucker, linux-fbdev
  Cc: Jean-Christophe Plagniol-Villard, Scot Doyle, Greg Kroah-Hartman,
	Pavel Machek, Thierry Reding, stable


[-- Attachment #1.1: Type: text/plain, Size: 1423 bytes --]


On 15/02/16 20:41, Jean-Philippe Brucker wrote:
> Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
> 	fbcon: use the cursor blink interval provided by vt
> 
> two attempts have been made at fixing a possible hang caused by
> cursor_timer_handler. That function registers a timer to be triggered at
> "jiffies + fbcon_ops.cur_blink_jiffies".
> 
> A new case had been encountered during initialisation of clcd-pl11x:
> 
>     fbcon_fb_registered
>     do_fbcon_takeover
> 
>     ->  do_register_con_driver
>         fbcon_startup
>     (A) add_cursor_timer (with cur_blink_jiffies = 0)
> 
>     ->  do_bind_con_driver
>         visual_init
>         fbcon_init
>     (B) cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
> 
> If we take an softirq anywhere between A and B (and we do),
> cursor_timer_handler executes indefinitely.
> 
> Instead of patching all possible paths that lead to this case one at a
> time, fix the issue at the source and initialise cur_blink_jiffies to
> 200ms when allocating fbcon_ops. This was its default value before
> aforesaid commit. fbcon_cursor or fbcon_init will refine this value
> downstream.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> Cc: <stable@vger.kernel.org> # v4.2
> ---
>  drivers/video/console/fbcon.c |    2 ++
>  1 file changed, 2 insertions(+)

Thanks, queued for 4.5 fixes.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-26 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15 18:41 [PATCH] fbcon: set a default value to blink interval Jean-Philippe Brucker
2016-02-15 21:12 ` Scot Doyle
2016-02-26 11:21 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).