Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4876997ybl; Wed, 22 Jan 2020 06:19:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxKltZ0tVsf8vMJDBUQpL1+KZbXOoMaAtcZNg5NmqrmT47YMritIo7OaL/Xyw6dcX5ZI2CM X-Received: by 2002:aca:4ad1:: with SMTP id x200mr6745804oia.104.1579702799446; Wed, 22 Jan 2020 06:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579702799; cv=none; d=google.com; s=arc-20160816; b=aOvoCr1jJ1Acn0WMR9rqJFQ62iksM4sgGtRrzjROIgusU+yQR98K0E0vXt3EYii27R ZqkwQSGTWd70lM6guR+v3BVswdML1ZFVpef7SUgUyynsMXRf9wEm9ojlA+jmhrgjLQTc 5jl1RyV2QAB87gJ5YUBAazYj7hk4P4Tk74XgIoPRkhoC8I60dNH44uFyn2rxA5GAup4X MxIxbzODXK3O56Bjj8m5Mrc/FVJyaM3hpt2zSv4FloFJKImJSWednYBWW5MrriYduqE4 V7dVb56zTq5y5Znu3bcqzkjEB8yJmchibMLz3XOyAsLk3eCom5rxDzqZJfTyXqnW/wax MPbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:message-id; bh=lByDybL7u608Gzji0Wqhib8Xk+0XQVFgnUEGAzmyrfI=; b=Zxj7LRKFS3mPNYcoNKgKJlN3SrD89e0eC8C70AaYe2qSD3KeSh2krewkS+HSaonNvX aPKoof02v9S2qabfn4VW+4gOH45i7gWHupafpr52h7Bdg6ICYvPsp1/66tFaxJ/nMDo7 /3UILtyKdzv8FZY12xx8yGPDWj1lVEJ98L6uRtXUQXGveM56+rRu7xC72J32rwCJbdFq TAU8HQuKF8137EQ6dDGtNbaFQyBPQXv2/M4mc8PHaaKtprIBxU1SIKAjqzGh56P/0vEm 8SLmRJy7lrv0njOXoArQIqrvztMO6qn246zBEUhcqIYU9CqUK3uOK+AX2odwiL3ijsUE AgaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si20816364oiy.9.2020.01.22.06.19.45; Wed, 22 Jan 2020 06:19:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725924AbgAVORj (ORCPT + 99 others); Wed, 22 Jan 2020 09:17:39 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:55797 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbgAVORj (ORCPT ); Wed, 22 Jan 2020 09:17:39 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout3.hostsharing.net (Postfix) with ESMTPS id 48763102AAF1B; Wed, 22 Jan 2020 15:17:36 +0100 (CET) Received: from localhost (unknown [87.130.102.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id E182A60FC0CE; Wed, 22 Jan 2020 15:17:35 +0100 (CET) X-Mailbox-Line: From 575cb82102aa59a7a8e34248821b78e1dd844777 Mon Sep 17 00:00:00 2001 Message-Id: <575cb82102aa59a7a8e34248821b78e1dd844777.1579701673.git.lukas@wunner.de> From: Lukas Wunner Date: Wed, 22 Jan 2020 15:17:30 +0100 Subject: [PATCH] vt: Fix non-blinking cursor regression To: Greg Kroah-Hartman , Jiri Slaby , Nicolas Pitre Cc: Mikulas Patocka , Matthew Whitehead , Daniel Vetter , Arvind Sankar , linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit a6dbe4427559 ("vt: perform safe console erase in the right order"), when userspace clears both the scrollback buffer and the screen by writing "\e[3J" to an fbdev virtual console, the cursor stops blinking if that virtual console is not in the foreground. I'm witnessing this on every boot of Raspbian since updating to v4.19.37+ because agetty writes the sequence to /dev/tty6 while the console is still switched to /dev/tty1. Switching consoles once makes the cursor blink again. The commit added an invocation of ->con_switch() to flush_scrollback(). Normally this is only invoked from switch_screen() to switch consoles. switch_screen() updates *vc->vc_display_fg to the new console and fbcon_switch() updates ops->currcon. Because the commit only invokes fbcon_switch() but doesn't update *vc->vc_display_fg, it performs an incomplete console switch. When fb_flashcursor() subsequently blinks the cursor, it retrieves the foreground console from ops->currcon. Because *vc->vc_display_fg wasn't updated, con_is_visible() incorrectly returns false and as a result, fb_flashcursor() bails out without blinking the cursor. The invocation of ->con_switch() appears to have been erroneous. After all, why should a console switch be performed when clearing the screen? The commit message doesn't provide a rationale either. So delete it. Fixes: a6dbe4427559 ("vt: perform safe console erase in the right order") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v5.1+ Cc: Nicolas Pitre Cc: Mikulas Patocka Cc: Matthew Whitehead --- drivers/tty/vt/vt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 35d21cdb60d0..eb25fb4ca05f 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -938,8 +938,6 @@ static void flush_scrollback(struct vc_data *vc) set_origin(vc); if (vc->vc_sw->con_flush_scrollback) vc->vc_sw->con_flush_scrollback(vc); - else - vc->vc_sw->con_switch(vc); } /* -- 2.24.0