diff mbox

fbcon: initialize blink interval before calling fb_set_par

Message ID alpine.DEB.2.11.1510091500100.1816@local (mailing list archive)
State New, archived
Headers show

Commit Message

Scot Doyle Oct. 9, 2015, 3:08 p.m. UTC
Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
    fbcon: use the cursor blink interval provided by vt

a PPC64LE kernel fails to boot when fbcon_add_cursor_timer uses an
uninitialized ops->cur_blink_jiffies. Prevent by initializing
in fbcon_init before the call to info->fbops->fb_set_par.

Reported-and-tested-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
 drivers/video/console/fbcon.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Benjamin Herrenschmidt Oct. 9, 2015, 8:48 p.m. UTC | #1
On Fri, 2015-10-09 at 15:08 +0000, Scot Doyle wrote:
> Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
>     fbcon: use the cursor blink interval provided by vt
> 
> a PPC64LE kernel fails to boot when fbcon_add_cursor_timer uses an
> uninitialized ops->cur_blink_jiffies. Prevent by initializing
> in fbcon_init before the call to info->fbops->fb_set_par.

> Reported-and-tested-by: Alistair Popple <alistair@popple.id.au>
> Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>

Please add

CC: <stable@vger.kernel.org> [v4.2]

This bug will cause any machine using fbcon to occasionally fail
to boot due to having a timer callback try to mod_timer with
"jiffies + 0" without an exit condition.

Cheers,
Ben.

> ---
>  drivers/video/console/fbcon.c | 1 +
>  1 file changed, 1 insertion(+) 
> 
> diff --git a/drivers/video/console/fbcon.c
> b/drivers/video/console/fbcon.c
> index 1aaf893..92f3949 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -1093,6 +1093,7 @@ static void fbcon_init(struct vc_data *vc, int
> init)
>                 con_copy_unimap(vc, svc);
>  
>         ops = info->fbcon_par;
> +       ops->cur_blink_jiffies = msecs_to_jiffies(vc
> ->vc_cur_blink_ms);
>         p->con_rotate = initial_rotation;
>         set_blitting_type(vc, info);
>  
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux
> -fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benjamin Herrenschmidt Oct. 20, 2015, 9 p.m. UTC | #2
On Fri, 2015-10-09 at 15:08 +0000, Scot Doyle wrote:
> Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
>     fbcon: use the cursor blink interval provided by vt
> 
> a PPC64LE kernel fails to boot when fbcon_add_cursor_timer uses an
> uninitialized ops->cur_blink_jiffies. Prevent by initializing
> in fbcon_init before the call to info->fbops->fb_set_par.

Any reason that hasn't hit upstream (and stable) yet ? This is pretty
major...

> Reported-and-tested-by: Alistair Popple <alistair@popple.id.au>
> Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
> ---
>  drivers/video/console/fbcon.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/video/console/fbcon.c
> b/drivers/video/console/fbcon.c
> index 1aaf893..92f3949 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -1093,6 +1093,7 @@ static void fbcon_init(struct vc_data *vc, int
> init)
>                 con_copy_unimap(vc, svc);
>  
>         ops = info->fbcon_par;
> +       ops->cur_blink_jiffies = msecs_to_jiffies(vc
> ->vc_cur_blink_ms);
>         p->con_rotate = initial_rotation;
>         set_blitting_type(vc, info);
>  
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux
> -fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Scot Doyle Oct. 20, 2015, 10:04 p.m. UTC | #3
On Wed, 21 Oct 2015, Benjamin Herrenschmidt wrote:
> On Fri, 2015-10-09 at 15:08 +0000, Scot Doyle wrote:
> > Since commit 27a4c827c34ac4256a190cc9d24607f953c1c459
> >     fbcon: use the cursor blink interval provided by vt
> > 
> > a PPC64LE kernel fails to boot when fbcon_add_cursor_timer uses an
> > uninitialized ops->cur_blink_jiffies. Prevent by initializing
> > in fbcon_init before the call to info->fbops->fb_set_par.
> 
> Any reason that hasn't hit upstream (and stable) yet ? This is pretty
> major...

It's currently in the tty-linus branch of Greg's tty tree, so should be 
included in the next rc.
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 1aaf893..92f3949 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1093,6 +1093,7 @@  static void fbcon_init(struct vc_data *vc, int init)
 		con_copy_unimap(vc, svc);
 
 	ops = info->fbcon_par;
+	ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
 	p->con_rotate = initial_rotation;
 	set_blitting_type(vc, info);