[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190226114118.28725-1-tomli@tomli.me>
Date: Tue, 26 Feb 2019 19:41:18 +0800
From: Yifeng Li <tomli@...li.me>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
Adam Borowski <kilobyte@...band.pl>,
Mikulas Patocka <mpatocka@...hat.com>,
Alexander Potapenko <glider@...gle.com>,
Yifeng Li <tomli@...li.me>,
Mike Frysinger <vapier@...omium.org>,
Daniel Vetter <daniel.vetter@...ll.ch>
Subject: [PATCH] tty: vt.c: Fix TIOCL_BLANKSCREEN console blanking if blankinterval == 0
In vt.c, "blank_state" will be initialized to "blank_normal_wait" in
con_init() if AND ONLY IF ("blankinterval" > 0). If "blankinterval" is 0,
"blank_state" will be "blank_off" (== 0), and a call to do_blank_screen()
will always abort. Even if a forced blanking is required from the user by
calling TIOCL_BLANKSCREEN, the console won't be blanked.
After Linux 4.12, blankinterval is 0 by default, which caused an unexpected
breakage of previously working "setterm -blank force". "blankinterval"
should not act like a kill switch for TIOCL_BLANKSCREEN.
My original proposal was adding a new "blank_normal_notimer" to indicate
manual console blanking via ioctl, however, it has been pointed out that
that fix was unnecessary, since do_blank_screen() is safe to reentry. To
fix it, we simply remove the "blank_state != blank_off" check. See Ref
for a detailed discussion.
Suggested-by: Nicolas Pitre <nicolas.pitre@...aro.org>
Fixes: a4199f5e ("tty: Disable default console blanking interval")
Reference: https://lore.kernel.org/lkml/20190225164346.1359-1-tomli@tomli.me
Signed-off-by: Yifeng Li <tomli@...li.me>
---
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 41ec8e5010f3..279f5b2ac44a 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -4168,8 +4168,6 @@ void do_blank_screen(int entering_gfx)
return;
}
- if (blank_state != blank_normal_wait)
- return;
blank_state = blank_off;
/* don't blank graphics */
--
2.20.1
Powered by blists - more mailing lists