From patchwork Tue Aug 27 04:43:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 13778825 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 00C9F13D8A2; Tue, 27 Aug 2024 04:43:39 +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=1724733821; cv=none; b=TOubZwGYsW3W2HqLwFFU4PmAiily8Nk5Jw/ArY2v5EXC7jHhZW7L6lbZ9l0EDbm6AsPm/O/E5HbtA4ys+ahRuTkw1V3K88nnLI+gS+gEY4kIdddtlkaVYWvx3Xn3Mu7Pp7DWca8MeP940XuBnSRri+nEUAFdnf2PCXL6MlSpMOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724733821; c=relaxed/simple; bh=z7t14psmClgJPnrTS3FePajFlnKKHKwtWJNjr7MCP1s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CxmqMbn5FitQQBs73deh1JoH+n4LdHEZNOAlhbo+VH5EeVCvb4k/o9ehNL5uFWsDtrsicbtp77x2nIe/czmNQNjNBOtHnoywR6IO/8PAsYwTjR4WDf7QbYXhcYvICHLQ2WyPv6hUOmMYbnYgamcNQZjUtQ4QJqRjpnLUgC6Lt4M= 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=BHB3UogT; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YfJpvM+q; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BHB3UogT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YfJpvM+q" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1724733818; 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=u1Oi5xduOOsbRA26g1GCX0jTw6STXCrfhNtn4TB0hdM=; b=BHB3UogTvftKlqiCKPrWz/uqzB8i501qPGPrOUCO/KK9FZzSXn/MNpZkRKD3iyRrM7xHvM 2KTB/PzwAA2Ktocwj11i56wcFFmuaL470kaaPZQO/b7So+4Pr8KzUekWlpR0a7P61j8BjQ crhRE9uCrApEPAc0ckbZXQX+2sU5CTcWe1nk2aWVgO44MaXDE67cIPiP8Pp8O2jKZLpiWn diu+ITjipAImhAMxdSweN6JSx74njGfNUKm/wKKfia2OS0tzG3S3ioxUBW2ylLUVNZ5H3i yDPpdb+cIULtgL83vWDhleU++I6kODJAoR2lfR9sQacT+2GEYx2gSBrbTf1D7g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1724733818; 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=u1Oi5xduOOsbRA26g1GCX0jTw6STXCrfhNtn4TB0hdM=; b=YfJpvM+qlaS5nH8RYoGUUKn/HJ9rbTrZQ/42yE25b1FZhcdB9bTplV23zkuZEkrtTdApRY rriFHnYCuilDAiBg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH printk v4 12/17] proc: consoles: Add notation to c_start/c_stop Date: Tue, 27 Aug 2024 06:49:28 +0206 Message-Id: <20240827044333.88596-13-john.ogness@linutronix.de> In-Reply-To: <20240827044333.88596-1-john.ogness@linutronix.de> References: <20240827044333.88596-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 fs/proc/consoles.c:78:13: warning: context imbalance in 'c_start' - wrong count at exit fs/proc/consoles.c:104:13: warning: context imbalance in 'c_stop' - unexpected unlock Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- fs/proc/consoles.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c index e0758fe7936d..7036fdfa0bec 100644 --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c @@ -68,6 +68,7 @@ static int show_console_dev(struct seq_file *m, void *v) } static void *c_start(struct seq_file *m, loff_t *pos) + __acquires(&console_mutex) { struct console *con; loff_t off = 0; @@ -94,6 +95,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos) } static void c_stop(struct seq_file *m, void *v) + __releases(&console_mutex) { console_list_unlock(); } From patchwork Tue Aug 27 04:43:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 13778826 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 68E58143C72; Tue, 27 Aug 2024 04:43:40 +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=1724733822; cv=none; b=EarNkumpgv746qe34sKlZeNZzXA0hrdPcdbvbUuLYRtg+GviNkd1qXucoaDToQ4371E6/l9wJSpERdyZzONYldV2G3sQ+MPZu7KyGxN7ntfDBdo2cWnhPYoH502TXypE0KkxWdLLyRWOUoL+qUEQmfa/3H6cxeA0icCuTS0ocmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724733822; c=relaxed/simple; bh=RuhFMyH0buaWaNTtg4qur9A9+lQbBJQXU2dz3dvH8mI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EKNSz2O/WnAg8wnrZ9pmsUQpfLDipoPty3YVU5CBIetr5ZuSP4xjIIlS5xGNgsH7gONJOS7gEAkr8rMx1SwYgsU2mEJB4/HTCWfBoUaz72zkK09EhfFIMXcpAjrkkAbu7Dhm7FPIkSkrVT93nT1BibujSNctiTzaLSq6iGvGND4= 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=Q8APdDqs; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fj9J9HDK; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q8APdDqs"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fj9J9HDK" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1724733818; 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=SlCaONAJqxgKpAXbE82io/gLxoDWz0lN5rgg6CE37cM=; b=Q8APdDqsYwyyTz3NGIPG4KO34QZmED7z2WtSy+9wdgKqZcRaEL4lOdDyBiyovwWorP/oGu jbUMTFYG4l5OysJNscTNUpd+qzDbvOlRzCAZmoSSKJdwP8byvEooYsSVIxoa6XDyy29LeE CwW4Fw3b+0XqhhD5XSTeuojk6fs8+V+KD1qW1eP/FZEwKGTYpqjISR81Q5Mp4fQH8yT9zF eSsDYT65ZDqvsqBoBOOV0yEhT9b8Qva9/rR4YUTZzPj9RASzUrymejfY+09ZUlAu1nkzJn E0umIgohdNmhURsB4OCGduMDIsIsItvhZMzGp/Xj349DzMK5DuKTPuJ3jylnow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1724733818; 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=SlCaONAJqxgKpAXbE82io/gLxoDWz0lN5rgg6CE37cM=; b=fj9J9HDKzzFIOutqa1XueBnfkqeAm/yuaALXi0VXaMdysgQ5p6yeczyohat6aVkMn3PvVO uAe07MtNGKTE3mAw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH printk v4 13/17] proc: Add nbcon support for /proc/consoles Date: Tue, 27 Aug 2024 06:49:29 +0206 Message-Id: <20240827044333.88596-14-john.ogness@linutronix.de> In-Reply-To: <20240827044333.88596-1-john.ogness@linutronix.de> References: <20240827044333.88596-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update /proc/consoles output to show 'W' if an nbcon console is registered. Since the write_thread() callback is mandatory, it enough just to check if it is an nbcon console. Also update /proc/consoles output to show 'N' if it is an nbcon console. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- fs/proc/consoles.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c index 7036fdfa0bec..b7cab1ad990d 100644 --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c @@ -21,6 +21,7 @@ static int show_console_dev(struct seq_file *m, void *v) { CON_ENABLED, 'E' }, { CON_CONSDEV, 'C' }, { CON_BOOT, 'B' }, + { CON_NBCON, 'N' }, { CON_PRINTBUFFER, 'p' }, { CON_BRL, 'b' }, { CON_ANYTIME, 'a' }, @@ -58,8 +59,8 @@ static int show_console_dev(struct seq_file *m, void *v) seq_printf(m, "%s%d", con->name, con->index); seq_pad(m, ' '); seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', - con->write ? 'W' : '-', con->unblank ? 'U' : '-', - flags); + ((con->flags & CON_NBCON) || con->write) ? 'W' : '-', + con->unblank ? 'U' : '-', flags); if (dev) seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev));