From patchwork Tue May 24 04:55:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 625484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3rDNR26FRlz9snk; Tue, 24 May 2016 14:56:14 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1b54Nx-00050H-Mh; Tue, 24 May 2016 04:56:05 +0000 Received: from mail-pf0-f196.google.com ([209.85.192.196]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1b54Ns-000509-Of for kernel-team@lists.ubuntu.com; Tue, 24 May 2016 04:56:00 +0000 Received: by mail-pf0-f196.google.com with SMTP id f144so868688pfa.2 for ; Mon, 23 May 2016 21:56:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=pRE3tu5P8JF/ATr/T1jBdL/X8G5Gzgeoky8dL3Jn0a0=; b=YfZ+nLrNR+vYxEGH4Hp/gqtZyhO9wsCwTleunhQylUlrRZ11Y6h7SCTBB+y8OllQrF hBQstCHwdTHsnQ8tabuItfNE0gJmbxjaAMLCxFLagY5Fbxw41bhb7H8X0ud2EciI8nmG Qoukva3XU29Ck9FocoE+rGcYCbRLpRGELChy6ckyusbfYTZ9cKf79Id6ezgbt9Y0ejGW YDnegK5zC99WMFgCxI4ptjpXjA0+LQXmWblO3P9myxal88UQnH6Rzv50U4iO/SO2veRD Nw3J5x2syQeVZSCa8N1BZG6e/HThTRarVmvvFyO8nygZ8+qLnLH8N+037f8KJO+DG3RB 7SNA== X-Gm-Message-State: ALyK8tLC92Stl8cwBiHwS5f20Gw0wOEviTJjIoLw0RB5rdbtOBkYAwETfGL5JWpn546+OA== X-Received: by 10.98.55.129 with SMTP id e123mr3749095pfa.4.1464065759323; Mon, 23 May 2016 21:55:59 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id w125sm50378152pfb.53.2016.05.23.21.55.58 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 23 May 2016 21:55:58 -0700 (PDT) From: Ming Lei To: kernel-team@lists.ubuntu.com Subject: [PATCH Xenial SRU] tty: vt: Fix soft lockup in fbcon cursor blink timer. Date: Tue, 24 May 2016 12:55:54 +0800 Message-Id: <1464065754-19883-1-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: David Daney BugLink: http://bugs.launchpad.net/bugs/1574814 We are getting somewhat random soft lockups with this signature: [ 86.992215] [] el1_irq+0xa0/0x10c [ 86.997082] [] cursor_timer_handler+0x30/0x54 [ 87.002991] [] call_timer_fn+0x54/0x1a8 [ 87.008378] [] run_timer_softirq+0x1c4/0x2bc [ 87.014200] [] __do_softirq+0x114/0x344 [ 87.019590] [] irq_exit+0x74/0x98 [ 87.024458] [] __handle_domain_irq+0x98/0xfc [ 87.030278] [] gic_handle_irq+0x94/0x190 This is caused by the vt visual_init() function calling into fbcon_init() with a vc_cur_blink_ms value of zero. This is a transient condition, as it is later set to a non-zero value. But, if the timer happens to expire while the blink rate is zero, it goes into an endless loop, and we get soft lockup. The fix is to initialize vc_cur_blink_ms before calling the con_init() function. Tested-by: Ming Lei Acked-by: Pavel Machek Acked-by: Scot Doyle Signed-off-by: David Daney Cc: stable@vger.kernel.org --- drivers/tty/vt/vt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 4af9a8f..d80f4ec 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -761,6 +761,7 @@ static void visual_init(struct vc_data *vc, int num, int init) vc->vc_complement_mask = 0; vc->vc_can_do_color = 0; vc->vc_panic_force_write = false; + vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS; vc->vc_sw->con_init(vc, init); if (!vc->vc_complement_mask) vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;