From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbcE1LpW (ORCPT ); Sat, 28 May 2016 07:45:22 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51178 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881AbcE1LpU (ORCPT ); Sat, 28 May 2016 07:45:20 -0400 X-Sasl-enc: 1Vv0T0ORkHYFIzKCfPghKzSOfJl3t1qi16vNmWo+tXHE 1464435918 Date: Sat, 28 May 2016 08:45:15 -0300 From: Henrique de Moraes Holschuh 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 , ddaney.cavm@gmail.com, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] fbcon: warn on invalid cursor blink intervals Message-ID: <20160528114515.GB13329@khazad-dum.debian.net> References: <1463510464-28124-1-git-send-email-ddaney.cavm@gmail.com> <20160517204912.GA29719@amd> <573DE2D0.1050402@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GPG-Fingerprint1: 4096R/39CB4807 C467 A717 507B BAFE D3C1 6092 0BD9 E811 39CB 4807 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 May 2016, 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] FWIW: Tested-by: Henrique de Moraes Holschuh on top of 4.4.11. And nothing caused it to issue warnings here, so far (with the other recommended patch applied first). > --- > 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; -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh