Commit 2f553b9b authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Greg Kroah-Hartman

fbcon: set a default value to blink interval

commit a1e533ec upstream.

Since commit 27a4c827
	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: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Tested-by: default avatarScot Doyle <lkml14@scotdoyle.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8cedd1c0
...@@ -709,6 +709,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info, ...@@ -709,6 +709,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
} }
if (!err) { if (!err) {
ops->cur_blink_jiffies = HZ / 5;
info->fbcon_par = ops; info->fbcon_par = ops;
if (vc) if (vc)
...@@ -956,6 +957,7 @@ static const char *fbcon_startup(void) ...@@ -956,6 +957,7 @@ static const char *fbcon_startup(void)
ops->currcon = -1; ops->currcon = -1;
ops->graphics = 1; ops->graphics = 1;
ops->cur_rotate = -1; ops->cur_rotate = -1;
ops->cur_blink_jiffies = HZ / 5;
info->fbcon_par = ops; info->fbcon_par = ops;
p->con_rotate = initial_rotation; p->con_rotate = initial_rotation;
set_blitting_type(vc, info); set_blitting_type(vc, info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment