From patchwork Wed Jan 9 03:55:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 155047 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp258608jaa; Tue, 8 Jan 2019 20:01:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ji2J+wLiAg4l1lP/+aa64RkZmgz84JByy34SMTeGxA8uPZN3kitw65BbZJcXiiNyao9Hx X-Received: by 2002:a62:9719:: with SMTP id n25mr4565736pfe.240.1547006514415; Tue, 08 Jan 2019 20:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547006514; cv=none; d=google.com; s=arc-20160816; b=FU2eP+8Fe+9QKg628ibs+y4Qx9x2THbe0kvJXZ/zav+w9uNxyZ6xm7Q1ivQWRbxhui XP5pQ4/elLEE2dwkqRxQuA17Tj0t9AHaPKKYZuU4qXfK6xTQliEtraaLdrNb3kD/X3k3 kwQ6yRh1xOY/f0/KlSrFIE6NPy0LswP39mjKVyQH2+rZH9MHI6kQOY+5Nzvjb7J5Ewbc od240aUMZGv6v2z26SGamIdCmPDcsG39GNAhSE/shs6yW1KsFv2kikr63ziMWvW4MrJV HvY0mmXWBKRMxxKGli+xGTHsOzkqduWd5CbzMxDJSf676UrEIRqdOQJ8IBU2LHQEjaMz MP8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qy7ecYNlukhEFJ1qzRyH/ib5ioiLv914cTZEKVeuLFw=; b=yC8Y5fdgqvp77lEf5YH5wcKDIvDS4wgOzVFAyt6ASWMb2HQKncg+aG9x+NwKD7aO31 Ok3Ue/E3tPiVt8eadcuOj/nLJ4XTWcjgIe4c2aKmPgiKx/U2/+EH4dMvHPPVQ+gxfznE 0phcr/VXIG8RATVCxhcQG0XeL2nKn//8uwQC/z4VAaVECeq151HmYa6et4fa1VCjuvRg 4qTBb5EP1IlniPHJ2qS4WoGiYMaEGjU9nAvkMVs5ucNNV2aJXGi4Jq3FWRpSm14NntFj 32YFoy8BTFrUTIZPvrJ1PTxW8UiHPORKQQX9ef2TiKQ6sJ201VG8B7C+mGlIdy4/ScOU 4nSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=a3lYeLFy; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si24458041pgn.20.2019.01.08.20.01.54; Tue, 08 Jan 2019 20:01:54 -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=@pobox.com header.s=sasl header.b=a3lYeLFy; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729435AbfAIEBx (ORCPT + 31 others); Tue, 8 Jan 2019 23:01:53 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]:59751 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbfAIEBw (ORCPT ); Tue, 8 Jan 2019 23:01:52 -0500 X-Greylist: delayed 360 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Jan 2019 23:01:51 EST Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 20A1E4D5FF; Tue, 8 Jan 2019 22:55:51 -0500 (EST) (envelope-from nicolas.pitre@linaro.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=zys7wzfBEXI8WLsQRJK2ztCU7 R8=; b=a3lYeLFy7EbcTJGngJRCZXzWIerFwm5osXoz1Caw0aMbhcPJ2HiS5BfLz duHedGMFUOFBCa4zLYEUX/9LOUVLRczB9jlubgg6cgLQjvb51pL/r2fVb/7JeAD2 2jCqLkU3LU+lzLEWkRuTbwx118uCUoK0cpzrSVPPMo30A+QKas= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 193254D5FE; Tue, 8 Jan 2019 22:55:51 -0500 (EST) (envelope-from nicolas.pitre@linaro.org) Received: from yoda.home (unknown [70.82.104.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 1B1314D5FD; Tue, 8 Jan 2019 22:55:48 -0500 (EST) (envelope-from nicolas.pitre@linaro.org) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 1562C2DA06F5; Tue, 8 Jan 2019 22:55:46 -0500 (EST) From: Nicolas Pitre To: Greg Kroah-Hartman Cc: Dave Mielke , linux-kernel@vger.kernel.org Subject: [PATCH 6/6] vcs: fasync(): make it consistent with poll() Date: Tue, 8 Jan 2019 22:55:04 -0500 Message-Id: <20190109035504.8413-7-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190109035504.8413-1-nicolas.pitre@linaro.org> References: <20190109035504.8413-1-nicolas.pitre@linaro.org> MIME-Version: 1.0 X-Pobox-Relay-ID: 72BF9086-13C2-11E9-959D-90A5DACCD188-78420484!pb-smtp21.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We use POLLPRI not POLLIN to wait for data with poll() as there is never any incoming data stream per se. Let's use the same semantic with fasync() for consistency, including the fact that a vt may go away. No known user space ever relied on the SIGIO reason so far, let alone FASYNC, so the risk of breakage is pretty much nonexistent. Signed-off-by: Nicolas Pitre --- drivers/tty/vt/vc_screen.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 1bbe2a30cd..1d887113ff 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -93,9 +93,18 @@ vcs_notifier(struct notifier_block *nb, unsigned long code, void *_param) struct vcs_poll_data *poll = container_of(nb, struct vcs_poll_data, notifier); int currcons = poll->cons_num; - - if (code != VT_UPDATE && code != VT_DEALLOCATE) + int fa_band; + + switch (code) { + case VT_UPDATE: + fa_band = POLL_PRI; + break; + case VT_DEALLOCATE: + fa_band = POLL_HUP; + break; + default: return NOTIFY_DONE; + } if (currcons == 0) currcons = fg_console; @@ -106,7 +115,7 @@ vcs_notifier(struct notifier_block *nb, unsigned long code, void *_param) poll->event = code; wake_up_interruptible(&poll->waitq); - kill_fasync(&poll->fasync, SIGIO, POLL_IN); + kill_fasync(&poll->fasync, SIGIO, fa_band); return NOTIFY_OK; }