From patchwork Thu May 19 22:31:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scot Doyle X-Patchwork-Id: 9128381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EED860213 for ; Thu, 19 May 2016 22:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31CCB1FFCA for ; Thu, 19 May 2016 22:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25F5920265; Thu, 19 May 2016 22:31:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A36051FFCA for ; Thu, 19 May 2016 22:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932604AbcESWbt (ORCPT ); Thu, 19 May 2016 18:31:49 -0400 Received: from mx1.scotdoyle.com ([23.226.141.211]:40992 "EHLO mx1.scotdoyle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132AbcESWbt (ORCPT ); Thu, 19 May 2016 18:31:49 -0400 Received: by mx1.scotdoyle.com (Postfix) id A4AA6103A010F; Thu, 19 May 2016 22:31:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.scotdoyle.com (Postfix) with ESMTP id 555E4103A0099; Thu, 19 May 2016 22:31:27 +0000 (UTC) Date: Thu, 19 May 2016 17:31:26 -0500 (CDT) From: Scot Doyle To: Tomi Valkeinen , Jean-Christophe Plagniol-Villard cc: 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, Scot Doyle , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] fbcon: warn on invalid cursor blink intervals In-Reply-To: Message-ID: References: <1463510464-28124-1-git-send-email-ddaney.cavm@gmail.com> <20160517204912.GA29719@amd> <573DE2D0.1050402@caviumnetworks.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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] Acked-by: David Daney Tested-by: Jeremy Kerr Tested-by: Henrique de Moraes Holschuh on top of 4.4.11. --- 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;