From patchwork Thu May 19 14:22:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scot Doyle X-Patchwork-Id: 9127733 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 7A3F260213 for ; Thu, 19 May 2016 14:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DA05281C5 for ; Thu, 19 May 2016 14:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 622B0281C7; Thu, 19 May 2016 14:22:38 +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=unavailable 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 DEC7D281C5 for ; Thu, 19 May 2016 14:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932651AbcESOWd (ORCPT ); Thu, 19 May 2016 10:22:33 -0400 Received: from mx1.scotdoyle.com ([23.226.141.211]:59412 "EHLO mx1.scotdoyle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932234AbcESOWb (ORCPT ); Thu, 19 May 2016 10:22:31 -0400 Received: by mx1.scotdoyle.com (Postfix) id 2659A103A00CB; Thu, 19 May 2016 14:22:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.scotdoyle.com (Postfix) with ESMTP id 076E5103A008C; Thu, 19 May 2016 14:22:27 +0000 (UTC) Date: Thu, 19 May 2016 09:22:27 -0500 (CDT) From: Scot Doyle To: Pavel Machek cc: Tomi Valkeinen , Jean-Christophe Plagniol-Villard , David Daney , Ming Lei , Dann Frazier , Jeremy Kerr , Peter Hurley , Jonathan Liu , Alistair Popple , Jean-Philippe Brucker , "Chintakuntla, Radha" , Greg Kroah-Hartman , Jiri Slaby , David Airlie , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fbcon: use default if cursor blink interval is not valid In-Reply-To: <20160519090139.GA1539@amd> Message-ID: References: <1463510464-28124-1-git-send-email-ddaney.cavm@gmail.com> <20160517204912.GA29719@amd> <20160519090139.GA1539@amd> 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 On Thu, 19 May 2016, Pavel Machek wrote: > Hi! > > > 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 > > Acked-by: Pavel Machek > > > 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) > > And actually... perhaps mod_timer should have some check for too low > timeouts..? > > WARN_ON? > Pavel Interesting idea. I applied this patch to a couple systems and receive the same warning on both: ------ [ 2.060474] ------------[ cut here ]------------ [ 2.061613] WARNING: CPU: 0 PID: 164 at kernel/time/timer.c:791 mod_timer+0x233/0x240 [ 2.062740] timer should expire in the future [ 2.062757] CPU: 0 PID: 164 Comm: kworker/0:2 Not tainted 4.6.0+ #7 [ 2.065870] Hardware name: Toshiba Leon, BIOS 12/04/2013 [ 2.067828] Workqueue: events_power_efficient hub_init_func3 [ 2.069762] 0000000000000000 ffff88007443bbb8 ffffffff8139932b ffff88007443bc08 [ 2.071701] 0000000000000000 ffff88007443bbf8 ffffffff8112e57c 0000031700000000 [ 2.073655] ffff88007486a0b0 00000000fffea2da ffff88007486a000 0000000000000202 [ 2.075594] Call Trace: [ 2.077503] [] dump_stack+0x4d/0x72 [ 2.079426] [] __warn+0xcc/0xf0 [ 2.081325] [] warn_slowpath_fmt+0x4f/0x60 [ 2.083212] [] ? find_next_bit+0x15/0x20 [ 2.085022] [] ? cpumask_next_and+0x2f/0x40 [ 2.086696] [] mod_timer+0x233/0x240 [ 2.088362] [] usb_hcd_submit_urb+0x3f2/0x8c0 [ 2.090026] [] ? urb_destroy+0x24/0x30 [ 2.091698] [] ? insert_work+0x58/0xb0 [ 2.093349] [] usb_submit_urb+0x287/0x530 [ 2.094985] [] hub_activate+0x1fd/0x5d0 [ 2.096625] [] ? finish_task_switch+0x78/0x1f0 [ 2.098268] [] hub_init_func3+0x1a/0x20 [ 2.099908] [] process_one_work+0x140/0x3e0 [ 2.101539] [] worker_thread+0x4e/0x480 [ 2.103173] [] ? process_one_work+0x3e0/0x3e0 [ 2.104790] [] ? process_one_work+0x3e0/0x3e0 [ 2.106259] [] kthread+0xc9/0xe0 [ 2.107731] [] ret_from_fork+0x22/0x40 [ 2.109215] [] ? __kthread_parkme+0x70/0x70 [ 2.110704] ---[ end trace 3519886a1a990d99 ]--- mod_timer is called from over a thousand places. Should timers always expire in the future? --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 73164c3..f6c0b69 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -788,6 +788,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, timer_stats_timer_set_start_info(timer); BUG_ON(!timer->function); + WARN_ONCE(expires == jiffies, "timer should expire in the future"); base = lock_timer_base(timer, &flags);