Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2362866lqz; Tue, 2 Apr 2024 15:28:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5cQ6QOkxeu7Aq8qLpNRnyzXrN7cTBlQPrAdghKNScXRjG/2zXY/C1AQd9IhK2l5H9ZjqgT3YUqgGZiQIJLnk8zVifnxytS1Ak0jE1XQ== X-Google-Smtp-Source: AGHT+IFAUz/xaEqlFZErGRbOHIzS/ebsBWqVhGtUlvLatkw21k1PcZzK9IKSfDPZ61NKr9CMm8LZ X-Received: by 2002:a05:6871:3422:b0:229:e38e:cd8 with SMTP id nh34-20020a056871342200b00229e38e0cd8mr13635813oac.26.1712096902613; Tue, 02 Apr 2024 15:28:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712096902; cv=pass; d=google.com; s=arc-20160816; b=0W+zCtG9eDuAwnVkXmbN9ZR8MQyZP/f76ivf0XewJJIRWWjckOiFCc24QOpRe5ju5l JxK7wseBJ0kc3GRnm0VCQsUAX6xrjRfq0q0kHoJ2uJgIuoWIXuqKkSnP7m+1sTu3eF0I GSZQ7AMQdzJeUqlTrd+G8OKQjeBG4W0uf6Mf/UhSllahKNhQMZ6xP6WOWhBxnq4C8na2 3xL5eHkdTU++iZBhtoKiWyELTSAboT2MGiTC9IsIHOxNCdJW87rjNVYTyjSkxt9zMf4r 7mF19sxb+64oBovc5bWpA0lkszHhKvdPPIR0k4AcoZmUSBIV1DfDb28vXVPxgWuVM220 J9Xw== 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=i+qJ3uw8FF3SLnXWdWW9caWOJk87KBanZukA+yTmjng=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=eWyMWIY45iMVpYmBA/qigxMd6Uk5waNneVNnTFp1MC9ozBh/gHqJNP84wOPfU5PH1d BIJHBYgjX1fmmkk8vJooZfEfDZT/xOD1eA2PywaTEGPxgBF/0iHt/byW/HxTILvVvKCK qvgRCIpWwogR3qOkpdxZH9cEVKNqvEmPLmy0Y2xGIpWkMwGrddilwlmjtOnqc3YYPkPM O3Ijmm9t1wPJJ1Az8CIOveqjsszFSO/LDT+LU5nt0UdFL8p5g8c8CjOGCKZPX7DiiTIQ xQVKG8qTC3Si4AvGJlVGra5HfNHzHxNdek2QgCQYIy84OUur5Rt57JdXKNWhPDkgmstM 23xA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TGtgEOWL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-128773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128773-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p7-20020a637407000000b005e456ac163bsi11582713pgc.107.2024.04.02.15.28.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 15:28:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TGtgEOWL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-128773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128773-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 5FBE5B27155 for ; Tue, 2 Apr 2024 22:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8665616079A; Tue, 2 Apr 2024 22:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TGtgEOWL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Yi2ciriB" 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 F11D115FA85 for ; Tue, 2 Apr 2024 22:11:42 +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=1712095904; cv=none; b=l4S6naFXP8ftiEpEDd2ypzNJTcdPc7W3EaEcwmKiPkh51kLD+hr2sUMQdl71lj1baOeLIcIVmHGiulp3mseljcUSzvA9FgfAuQDHJvKAXfvt+qRutFykx+idb/5E5ZuxovjDUTXyV5DpTaS6le1KpfHYwb2phq+EtEeMsG6aULc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712095904; c=relaxed/simple; bh=hx4xaO/u4i/Ycgs2YXfR0xt1CzcK8YE0NqUsdUu6qZ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XY+hTNMgs8OKnlZ3dtgK+dLyuHwX9JxleBTef/9Z9qGRdkNEGFbrnCkLlMeIYAMzIWaMbSfv8JNtqaoGXMEn0iboYNdlH0ZuT74VJKz9LS4lUBUhOaxKlAvF/h5eIMlf2DL7eq360Iz31b5cQaXCXHs+orAuw5cbkgGP18p8K8g= 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=TGtgEOWL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Yi2ciriB; 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=1712095901; 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=i+qJ3uw8FF3SLnXWdWW9caWOJk87KBanZukA+yTmjng=; b=TGtgEOWLDZrUvzi6HxEb+jd840svAuCDAKgRRs9lPU6UJ89ucUGveHuaRJHDwJ1ISzSCX7 P94pSJgUwWQCl7KeR/LZLxnNZS+9r25J7SK/eQqmRm6wax+DqSzMSJjsvubwW+tFfutfI2 E2c5bR9+vhq3xf92Q4alW57I5l+it6zpsxUDvnBsoAdrRcxdccIBcWcZvknAmUquMshLpK lb/upa/j662/4i13OeEQzq7vVcduLkmTm5Er9+f9PHuwLMtOAA8UWsN9xDJMiqfZ3jN8dn UQscsiHaZHTb7G12fC1p5bgS+zH8ftCu0BwXdGr70QP5m5NYEEu1Ftg5Qk37vA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712095901; 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=i+qJ3uw8FF3SLnXWdWW9caWOJk87KBanZukA+yTmjng=; b=Yi2ciriBDJJMADCkQuLvnRqql/zUlgXVIWNopY9M7TNmsdaOEX3uRRp2FW0qkk6knLmUmJ 2y5cXmz5HxGXYmCg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v4 13/27] printk: Let console_is_usable() handle nbcon Date: Wed, 3 Apr 2024 00:17:15 +0206 Message-Id: <20240402221129.2613843-14-john.ogness@linutronix.de> In-Reply-To: <20240402221129.2613843-1-john.ogness@linutronix.de> References: <20240402221129.2613843-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 The nbcon consoles use a different printing callback. For nbcon consoles, check for the write_atomic() callback instead of write(). Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/printk/internal.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h index bad22092cd5e..398e99a30427 100644 --- a/kernel/printk/internal.h +++ b/kernel/printk/internal.h @@ -87,6 +87,8 @@ void nbcon_free(struct console *con); /* * Check if the given console is currently capable and allowed to print + * records. Note that this function does not consider the current context, + * which can also play a role in deciding if @con can be used to print * records. * * Requires the console_srcu_read_lock. @@ -101,8 +103,13 @@ static inline bool console_is_usable(struct console *con) if ((flags & CON_SUSPENDED)) return false; - if (!con->write) - return false; + if (flags & CON_NBCON) { + if (!con->write_atomic) + return false; + } else { + if (!con->write) + return false; + } /* * Console drivers may assume that per-cpu resources have been -- 2.39.2