From: Scot Doyle <lkml14@scotdoyle.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: David Daney <david.daney@cavium.com>,
Ming Lei <ming.lei@canonical.com>,
Dann Frazier <dann.frazier@canonical.com>,
Peter Hurley <peter@hurleysoftware.com>,
Pavel Machek <pavel@ucw.cz>, Jonathan Liu <net147@gmail.com>,
Alistair Popple <alistair@popple.id.au>,
Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
"Chintakuntla, Radha" <Radha.Chintakuntla@caviumnetworks.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, David Airlie <airlied@linux.ie>,
ddaney.cavm@gmail.com, lkml14@scotdoyle.com,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] fbcon: use default if cursor blink interval is not valid
Date: Wed, 18 May 2016 23:21:53 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.10.1605182252230.12118@laptop> (raw)
In-Reply-To: <ed8fa4ca-49e0-3ff4-5499-fc5250dd8ae2@caviumnetworks.com>
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]
---
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
next prev parent reply other threads:[~2016-05-19 4:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 18:41 [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer David Daney
2016-05-17 20:49 ` Pavel Machek
2016-05-18 0:42 ` Ming Lei
2016-05-18 20:24 ` Scot Doyle
2016-05-18 20:38 ` David Daney
2016-05-19 4:21 ` Scot Doyle [this message]
2016-05-19 7:25 ` [PATCH] fbcon: use default if cursor blink interval is not valid Jeremy Kerr
2016-05-19 8:29 ` Ming Lei
2016-05-19 9:01 ` Pavel Machek
2016-05-19 14:22 ` Scot Doyle
2016-05-19 15:31 ` Ming Lei
2016-05-19 15:59 ` David Daney
2016-05-19 22:25 ` Scot Doyle
2016-05-19 22:31 ` [PATCH] fbcon: warn on invalid cursor blink intervals Scot Doyle
2016-05-19 22:50 ` David Daney
2016-05-20 1:21 ` Jeremy Kerr
2016-05-20 2:17 ` Ming Lei
2016-05-20 2:26 ` Jeremy Kerr
2016-05-20 2:48 ` Ming Lei
2016-05-20 5:04 ` Jeremy Kerr
2016-05-20 16:27 ` Scot Doyle
2016-05-24 1:19 ` Scot Doyle
2016-05-28 11:48 ` Henrique de Moraes Holschuh
2016-06-12 5:05 ` Chintakuntla, Radha
2016-05-28 11:45 ` Henrique de Moraes Holschuh
2016-05-19 0:27 ` [PATCH] tty: vt: Fix soft lockup in fbcon cursor blink timer Ming Lei
2016-05-19 7:08 ` Pavel Machek
2016-05-19 22:35 ` Scot Doyle
2016-05-28 11:44 ` Henrique de Moraes Holschuh
2016-06-14 16:22 ` Ping: " David Daney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.10.1605182252230.12118@laptop \
--to=lkml14@scotdoyle.com \
--cc=Radha.Chintakuntla@caviumnetworks.com \
--cc=airlied@linux.ie \
--cc=alistair@popple.id.au \
--cc=dann.frazier@canonical.com \
--cc=david.daney@cavium.com \
--cc=ddaney.cavm@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jean-philippe.brucker@arm.com \
--cc=jslaby@suse.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=net147@gmail.com \
--cc=pavel@ucw.cz \
--cc=peter@hurleysoftware.com \
--cc=plagnioj@jcrosoft.com \
--cc=stable@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).