From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bl2on0057.outbound.protection.outlook.com ([65.55.169.57]:60879 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751646AbcESWuQ (ORCPT ); Thu, 19 May 2016 18:50:16 -0400 Message-ID: <573E431E.5000405@caviumnetworks.com> Date: Thu, 19 May 2016 15:50:06 -0700 From: David Daney MIME-Version: 1.0 To: Scot Doyle CC: Tomi Valkeinen , Jean-Christophe Plagniol-Villard , David Daney , Ming Lei , Dann Frazier , Jeremy Kerr , Peter Hurley , Pavel Machek , Jonathan Liu , Alistair Popple , Jean-Philippe Brucker , "Chintakuntla, Radha" , Greg Kroah-Hartman , Jiri Slaby , David Airlie , , , , , Subject: Re: [PATCH] fbcon: warn on invalid cursor blink intervals References: <1463510464-28124-1-git-send-email-ddaney.cavm@gmail.com> <20160517204912.GA29719@amd> <573DE2D0.1050402@caviumnetworks.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 05/19/2016 03:31 PM, Scot Doyle wrote: > 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 > Signed-off-by: Scot Doyle > Cc: [v4.2] This seems better. I didn't test it, but... Acked-by: David Daney > --- > 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; >