Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1275787lqj; Mon, 3 Jun 2024 16:30:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnhxgapY9E3X9Fb9V/gD7Cxc2IsDuU/vmXTzd889alNO+zpPogUTAdVBtTaHK/Sv/qo0YblBKGE/sB5Gu4guUxtW8jdHwEHMZDviAlCg== X-Google-Smtp-Source: AGHT+IF6NYJSq0h8jg334phMSGnCii2OpvvrAKKo1CL4AQIpNWQCzAk4FL5y+feZyrE8G66gK9a2 X-Received: by 2002:a17:903:2443:b0:1f6:7b40:9852 with SMTP id d9443c01a7336-1f67b40be92mr52946545ad.68.1717457431022; Mon, 03 Jun 2024 16:30:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717457431; cv=pass; d=google.com; s=arc-20160816; b=VPqsAwng3/6GgOVC9N4gzq+Q+3/H3rx+bgXLyd7X9ITKBnLZ9CXYSJ8mKyyqKGy9ob niD6evYewzjDse405XtWtKNOIYfThZpSKUvhbp0gi6D5QhKkZVghWBR90+LLW9Ns0HvR IO/medpxkziICD3SXuYCVZrSwoXtO9KC+6MU4sXnkw/CjGWcm9Nxey7W3u+KBortSQYn tk7UY0FHErq6Or1PJ2mWNkB3xxi5fGqxoJ567+TeGzvI/hLkSNau69yNzsvi+1/Ev7xW bgDifn3wk2QoHMymXmDY+a7qpVEjKriEgdscqoTJlM6Q8w3cH88XuGQFjb39+L9MVYna PycA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=AVOojb4+PpMY1V+1K9x0e9ZnUQCXKs719BnreW8cqRo=; fh=HKaqXHh+fz3Srk83AIMeiRhuuxUdJ/iTyHPcHN2kxVI=; b=PBF9Cua/8pi9I9jPe/+M8ND/MDAcUDwthgcUGDZdSghW0PVUmt6nu+lcdSrpymyfDT +K2jv675h2EVRYQQBq3CFIjyNzPpspASKo0r15JVcjaS7IvVR7MhSe6DDSZtYrks4+cj Aop1KTECy7f3aqloZp35EUkPPZLff04qNgjq8OheHWZF5E9/NQU4EaARF3jLkLdnYc7F aEgvC9FLWRWr+zPyTgK81qDESlkZ6EJnKmyEAYCY4LeM6h1eMKCIRUxDJWuo/21VCe18 uydFdk6/Aa+yhe0Jm9AbtUvMw160mViGpyiM2jKkGGAndxRD6tteC9lWc4+9bcUo8rJ1 5oAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RubfaJ21; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=3VHXF6oe; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-199835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f67d98f113si23792605ad.267.2024.06.03.16.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 16:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RubfaJ21; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=3VHXF6oe; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-199835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 651A0B23786 for ; Mon, 3 Jun 2024 23:27:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2F951411EA; Mon, 3 Jun 2024 23:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RubfaJ21"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3VHXF6oe" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4014083CD8; Mon, 3 Jun 2024 23:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717457104; cv=none; b=Xmk6eTV/uHGJkIQp/I2Zx0KpB/OFRzpf1tnZl5HOIMzZiQVV3WpHLrqLoXv5ERHfQbNDLr2RI5sKh2CNmKD3NkJl97cWL3kNCFD6dh14EVIjSARY2ATAeBFPBwlqZfO+nfvBpIS2tLVCUjbMnW/2ozbHool9HMIBnmLlaZ2DHvA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717457104; c=relaxed/simple; bh=iFe7QTOJaIZ96iBr5IJNXeHec/OczXjluE+9uE64m5U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lJrVoRFOsFVWhsqvTwKcg9zQvN/GrFgKlahjsLlomwns1YticUBjJqPFyFQQ3jD7ciFpFbXvSGM0ohhGdTQdR7VadiSp8gPjd41Q0sXmuKpBiPoaacdvORy+Hwl1P0Dd22f2sRhrIGjuZj62/jwAUGuHVnX6J5FDSqxEZDhju1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RubfaJ21; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3VHXF6oe; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717457100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AVOojb4+PpMY1V+1K9x0e9ZnUQCXKs719BnreW8cqRo=; b=RubfaJ21CaXktnflUH7lDlQT0oDJ4xfHIFVQvMDtT+1w44RUsTKBxRViXeoUKY/zceV1bU HeKeZJZCjUGlxY6yPU4wsaIvbr4iZmKHEwbTRtw3obLvtsaflGd5f8UboRPVqulLAKb8in L1Fn5CZ4HvOwhDwxxfm9OwL084/7aHPe3BhdwoxV3kXlPmPB/8dYsgcy8TLx7PERR92b67 FmijEEwoF3KWX+M5aSlP8VQpUd9jwzHKEHGThEDGmE9pAYI3umf7dUSf2IUm6pOLDJ4Szi wh/xDjw+FjX72Owum1j34Q4tAjE63HMzH5daPzimwddr9eoqSOFcntGa9UqVgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717457100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AVOojb4+PpMY1V+1K9x0e9ZnUQCXKs719BnreW8cqRo=; b=3VHXF6oejKzbZBE03RCA1YmIECu7IUwL9FS6L0OkNOAerzWOodexOCtM1ODvmzCfeJRKkM j4oOnwZIuGB5DFDg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH printk v2 15/18] tty: sysfs: Add nbcon support for 'active' Date: Tue, 4 Jun 2024 01:30:50 +0206 Message-Id: <20240603232453.33992-16-john.ogness@linutronix.de> In-Reply-To: <20240603232453.33992-1-john.ogness@linutronix.de> References: <20240603232453.33992-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Allow the 'active' attribute to list nbcon consoles. Signed-off-by: John Ogness --- drivers/tty/tty_io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 407b0d87b7c1..c9c914bc033c 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -3567,8 +3567,13 @@ static ssize_t show_cons_active(struct device *dev, for_each_console(c) { if (!c->device) continue; - if (!c->write) - continue; + if (c->flags & CON_NBCON) { + if (!c->write_atomic && !c->write_thread) + continue; + } else { + if (!c->write) + continue; + } if ((c->flags & CON_ENABLED) == 0) continue; cs[i++] = c; -- 2.39.2