Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1403498

Re: [PATCH] fbcon: use default if cursor blink interval is not valid

From Ming Lei <ming.lei@canonical.com>
Newsgroups linux.kernel
Subject Re: [PATCH] fbcon: use default if cursor blink interval is not valid
Date 2016-05-19 10:40 +0200
Message-ID <rArER-5LS-1@gated-at.bofh.it> (permalink)
References (1 earlier) <rzU6e-W9-17@gated-at.bofh.it> <rzXQu-3gO-9@gated-at.bofh.it> <rAgq6-6Tl-7@gated-at.bofh.it> <rAnKV-3m2-7@gated-at.bofh.it> <rAnKV-3m2-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 19, 2016 at 12:21 PM, Scot Doyle <lkml14@scotdoyle.com> wrote:
> Two current [1] and three previous [2] systems locked during boot
> because the cursor flash timer was set using an ops->cur_blink_jiffies
> value of 0. Previous patches attempted to solve the problem by moving
> variable initialization earlier in the setup sequence [2].
>
> Use the normal cursor blink default interval of 200 ms if
> ops->cur_blink_jiffies is not in the range specified in commit
> bd63364caa8d. Since invalid values are not used, specific system
> initialization timings should not cause lockups.
>
> [1] https://bugs.launchpad.net/bugs/1574814
> [2] see commits: 2a17d7e80f1d, f235f664a8af, a1e533ec07d5
>
> Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
> Cc: <stable@vger.kernel.org> [v4.2]

Tested-by: Ming Lei <ming.lei@canonical.com>

> ---
>  drivers/video/console/fbcon.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
> index 6e92917..da61d87 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -396,13 +396,23 @@ static void fb_flashcursor(struct work_struct *work)
>         console_unlock();
>  }
>
> +static int cursor_blink_jiffies(int candidate)
> +{
> +       if (candidate >= msecs_to_jiffies(50) &&
> +           candidate <= msecs_to_jiffies(USHRT_MAX))
> +               return candidate;
> +       else
> +               return HZ / 5;
> +}
> +
>  static void cursor_timer_handler(unsigned long dev_addr)
>  {
>         struct fb_info *info = (struct fb_info *) dev_addr;
>         struct fbcon_ops *ops = info->fbcon_par;
>
>         queue_work(system_power_efficient_wq, &info->queue);
> -       mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
> +       mod_timer(&ops->cursor_timer, jiffies +
> +           cursor_blink_jiffies(ops->cur_blink_jiffies));
>  }
>
>  static void fbcon_add_cursor_timer(struct fb_info *info)
> @@ -417,7 +427,8 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
>
>                 init_timer(&ops->cursor_timer);
>                 ops->cursor_timer.function = cursor_timer_handler;
> -               ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies;
> +               ops->cursor_timer.expires = jiffies +
> +                   cursor_blink_jiffies(ops->cur_blink_jiffies);
>                 ops->cursor_timer.data = (unsigned long ) info;
>                 add_timer(&ops->cursor_timer);
>                 ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
> @@ -709,7 +720,6 @@ 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)
> @@ -957,7 +967,6 @@ 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);
> --
> 2.1.4
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. David Daney <ddaney.cavm@gmail.com> - 2016-05-17 20:50 +0200
  Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Pavel Machek <pavel@ucw.cz> - 2016-05-17 22:50 +0200
    Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Ming Lei <ming.lei@canonical.com> - 2016-05-18 02:50 +0200
      Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Scot Doyle <lkml14@scotdoyle.com> - 2016-05-18 22:40 +0200
        Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Ming Lei <ming.lei@canonical.com> - 2016-05-19 02:30 +0200
          Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Pavel Machek <pavel@ucw.cz> - 2016-05-19 09:10 +0200
        [PATCH] fbcon: use default if cursor blink interval is not valid Scot Doyle <lkml14@scotdoyle.com> - 2016-05-19 06:30 +0200
          Re: [PATCH] fbcon: use default if cursor blink interval is not valid Jeremy Kerr <jk@ozlabs.org> - 2016-05-19 09:30 +0200
          Re: [PATCH] fbcon: use default if cursor blink interval is not valid Ming Lei <ming.lei@canonical.com> - 2016-05-19 10:40 +0200
          Re: [PATCH] fbcon: use default if cursor blink interval is not valid Pavel Machek <pavel@ucw.cz> - 2016-05-19 11:10 +0200
            Re: [PATCH] fbcon: use default if cursor blink interval is not  valid Scot Doyle <lkml14@scotdoyle.com> - 2016-05-19 16:30 +0200
              Re: [PATCH] fbcon: use default if cursor blink interval is not valid Ming Lei <ming.lei@canonical.com> - 2016-05-19 17:40 +0200
          Re: [PATCH] fbcon: use default if cursor blink interval is not  valid Scot Doyle <lkml14@scotdoyle.com> - 2016-05-20 00:30 +0200
            [PATCH] fbcon: warn on invalid cursor blink intervals Scot Doyle <lkml14@scotdoyle.com> - 2016-05-20 00:40 +0200
              Re: [PATCH] fbcon: warn on invalid cursor blink intervals Jeremy Kerr <jk@ozlabs.org> - 2016-05-20 03:30 +0200
              Re: [PATCH] fbcon: warn on invalid cursor blink intervals Ming Lei <ming.lei@canonical.com> - 2016-05-20 04:20 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Jeremy Kerr <jk@ozlabs.org> - 2016-05-20 04:30 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Ming Lei <ming.lei@canonical.com> - 2016-05-20 04:50 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Jeremy Kerr <jk@ozlabs.org> - 2016-05-20 07:10 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Scot Doyle <lkml14@scotdoyle.com> - 2016-05-20 18:30 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Scot Doyle <lkml14@scotdoyle.com> - 2016-05-24 03:30 +0200
                Re: [PATCH] fbcon: warn on invalid cursor blink intervals Henrique de Moraes Holschuh <hmh@hmh.eng.br> - 2016-05-28 13:50 +0200
              Re: [PATCH] fbcon: warn on invalid cursor blink intervals Henrique de Moraes Holschuh <hmh@hmh.eng.br> - 2016-05-28 13:50 +0200
  Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Scot Doyle <lkml14@scotdoyle.com> - 2016-05-20 00:40 +0200
  Re: [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer. Henrique de Moraes Holschuh <hmh@hmh.eng.br> - 2016-05-28 13:50 +0200

csiph-web