Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4762166imc; Mon, 25 Feb 2019 10:31:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZcvCsz4SMOTYwX1dNPraHBC6jSmBvUKQIorHr99ugcyb0lOhqkrebpI7nkMY6rvKpUlr2t X-Received: by 2002:a63:455f:: with SMTP id u31mr11549311pgk.241.1551119469190; Mon, 25 Feb 2019 10:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551119469; cv=none; d=google.com; s=arc-20160816; b=Co87fLnkshP5sab6gSRu+w6DYduxgN/DOaTrRPz2DGnW/wB9JFos7wKgs0OlKRLTPj abfjQjsOrNaJwhYuuTS8tKmt14r/i3G32D720em5ueni0DGfn+xaBK94HyTMymSpFdgC Pn6m6+ioj0WyxBDIUloKzmiMxmKCNp11s5DCg+h2gjRL4X2S3ZZq7h0e3PTqJrW9d6f5 2WvN3CyVyMYGLo9402ePpHL5JJk6BPlvVF0bVned4wZjBG7s0HZAJbB+PtrMaLFiFtqU x3ZO94ysnjaJMrlFyINOh0zn9vmPbutmcG/LliplrM+tPLZOcBfR0GHScOdE4MTTrbQl lrbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=zEZnvFZQ4qvqz2Xp+2k+yHrN6CfQJ/bFRwyGjvLe5Fw=; b=lrSfxWYb7N3c6m4sodHgbksLrSr+B84Jb02MW5P3XrTdrFqY/kSaz8EqfP5HS70sMr F1syAh9YE41Xu7t4zikMkCDfCQo2Mp4vPVo8qvo7HLlbmpfrG/LYxkrB20ir1iqcvhTq JkXBkBdpTmHcae4CSNMiVuRny/RIa40V+QsVALuQ7kvXO6i9Ng1T7nBSRurn+Nv03kJA 8Hm9IdhJtUCu1ukXkV031XJbWkQgLjZynzjhFTTKLYVOIe2Ge66KmHflVYChciaoXAjo 6gOqk4AsfuCgHmabAFwj9KDQnxhz1qVDZrLhj978o+5CWAlgH3W4R9ocyGRU34vh4bQL Lcww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VDCsgDYr; 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 14si1337272plf.138.2019.02.25.10.30.53; Mon, 25 Feb 2019 10:31:09 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VDCsgDYr; 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 S1728910AbfBYS3P (ORCPT + 99 others); Mon, 25 Feb 2019 13:29:15 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:34818 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfBYS3P (ORCPT ); Mon, 25 Feb 2019 13:29:15 -0500 Received: by mail-qt1-f195.google.com with SMTP id p48so11739766qtk.2 for ; Mon, 25 Feb 2019 10:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=zEZnvFZQ4qvqz2Xp+2k+yHrN6CfQJ/bFRwyGjvLe5Fw=; b=VDCsgDYrv0GjWSGrWd0nvZvnWO0iLPB0Ei3gWdCrviO/7UgteQcPJsAnoHhyi6xnTS 7pJLhShSqkBlNDGiZWTDB0L4sauk8Fl/Qmp2Se+jFtMayWbqGSTlMgGn6nuZt+nEdpr1 r/sxDIIce3Lv7UNCZCyi7CJO6+Yj9439oGRFq3FJN5xdcEIJ2tib7aJx6hCb17PFJYhv nAjCgbZ+ysvI/1Q0NSOgDoH22wDLByhfShBCY9MFj+Av2AN6ZslOcsyz+DHJhFAQZSRx +pmWZgHkgHyO9mR6OgVBVulihfoyu59pmWEUgnNprej/T259EnGZRrwB5LWx7v7N826d 2P5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=zEZnvFZQ4qvqz2Xp+2k+yHrN6CfQJ/bFRwyGjvLe5Fw=; b=dcbU9CPLPKhpzrPPoxZp/ydypGVH3heWyb/nftWmn+PmSXhEp1pDx3ZJHZ+NCqyoE2 f1R0yFQVXlQk0wNRJb3NBxm5hnpWXvYCsv0O1xneWSlc8S21idZmFipbaTX4KvYYfhDY KppVfqxrarh5HKa51p3hwhQ5zRGxwdoqUuO1/9YUP1/z4eLYQ8ve7bcIyGWnqdYai+wy m92V4zV7xnCErYPSgIRYy7CJy08b0G6CLOLSSSctSDbo1tW0739f4uPA0Vq9kj6pwjy/ zaQlAVW59csmt841iFFMqnnNLvCF4vF4VLBQpxzZ0l2UzvIaa9dVQhFIXlYNEGAWhdeL j8Mw== X-Gm-Message-State: AHQUAuYAzbpKSBvoOl/4iYpYc/nA3gCL1vezQltJABYD5fCYcAOFIKns CeD1Oq9GhDyYqTGuCSKqtviC1Q== X-Received: by 2002:ac8:3251:: with SMTP id y17mr9440551qta.152.1551119354114; Mon, 25 Feb 2019 10:29:14 -0800 (PST) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id v80sm6834590qkv.34.2019.02.25.10.29.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 10:29:13 -0800 (PST) Date: Mon, 25 Feb 2019 13:29:12 -0500 (EST) From: Nicolas Pitre To: Yifeng Li cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Adam Borowski , Mikulas Patocka , Alexander Potapenko , Mike Frysinger , Daniel Vetter Subject: Re: [RFC 1/1] tty: vt.c: Fix TIOCL_BLANKSCREEN VT console blanking if blankinterval == 0 In-Reply-To: <20190225164346.1359-2-tomli@tomli.me> Message-ID: References: <20190225164346.1359-1-tomli@tomli.me> <20190225164346.1359-2-tomli@tomli.me> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Feb 2019, Yifeng Li wrote: > 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. > > In this commit, we introduce a 4th "blank_state" - "blank_normal_notimer", > it indicates the console can be blanked, but not automatically by a timer. > Then, we made a change to "con_init()" - if (blankinterval == 0), > "blank_state" will be set to "blank_normal_notimer" (we have similar > changes to "do_unblank_screen()" and "poke_blanked_console()"). Finally, > we change do_blank_screen() - now it will return if "blank_state" is > neither "blank_normal_wait" nor "blank_normal_notimer", thus allowing > the console to be blanked even if there's no timed autoblanking. > > Signed-off-by: Yifeng Li Wouldn't this problem be fixed simply by the following: diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 9646ff63e7..41b17c4b5a 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4151,8 +4151,6 @@ void do_blank_screen(int entering_gfx) return; } - if (blank_state != blank_normal_wait) - return; blank_state = blank_off; /* don't blank graphics */ I just can't find a logical reason for that conditional return. Nicolas