[PATCH] fbcon: warn on invalid cursor blink intervals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Two systems are locking on boot [1] because ops->cur_blink_jiffies
is set to zero from vc->vc_cur_blink_ms.

Ignore such invalid intervals and log a warning.

[1] https://bugs.launchpad.net/bugs/1574814

Suggested-by: David Daney <david.daney@xxxxxxxxxx>
Signed-off-by: Scot Doyle <lkml14@xxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> [v4.2]
---
 drivers/video/console/fbcon.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 6e92917..fad5b89 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1095,7 +1095,13 @@ 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);
+
+	if (vc->vc_cur_blink_ms >= 50)
+		ops->cur_blink_jiffies =
+		    msecs_to_jiffies(vc->vc_cur_blink_ms);
+	else
+		WARN_ONCE(1, "blink interval < 50 ms");
+
 	p->con_rotate = initial_rotation;
 	set_blitting_type(vc, info);
 
@@ -1309,7 +1315,11 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);
 
-	ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
+	if (vc->vc_cur_blink_ms >= 50)
+		ops->cur_blink_jiffies =
+		    msecs_to_jiffies(vc->vc_cur_blink_ms);
+	else
+		WARN_ONCE(1, "blink interval < 50 ms");
 
 	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
 		return;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux