Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp101606rdb; Thu, 1 Feb 2024 03:28:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBYEI6xO3I5S/rBpGcvxZtlPHxv3lr81TbBxLsKOcRzfXPGlyio6kR8i3j3vgyb1bIVuw3 X-Received: by 2002:a50:8e5c:0:b0:55e:ea35:19f9 with SMTP id 28-20020a508e5c000000b0055eea3519f9mr3707946edx.7.1706786926182; Thu, 01 Feb 2024 03:28:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706786926; cv=pass; d=google.com; s=arc-20160816; b=Jcx5UOP0oflSgbBSEWGvT8bNtVToHU9ORbIs1NIz4dMVqRiQRZdqN0rZcQfnNR6AbL XQ8UhUcI8ny6zP7bxoNKE8ihhF/VhehlGUSvsQT92LgpxoatLt7JQRvU+eTfTRysLjTF AzVNBj07aoxzrcmqpgAP9yS2euK8huOJbBeU/PmZ7wq53JXmYAwZjg4h13xrGRlyRjFD PUpBtwzQVQJ2WK5Mt1E4JPRAA7AIy2Uaqn76rsD1/HL4FflrrG+SV+LfO+L+WYFiRfYs 8ddZYjfJHXoClwU6+tKgZTfK6zpCZTze5U4Pi+ZMNnesYQoOlfyd5jh8+lsEZ6S0wTQH px1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=EqDFDjr65DaTO5ggMTdy8mexaExyCS1krDj5TMD2nUw=; fh=SC10v4VkAz2eg/UjKhdMCmQvbKVNA2Hx3nLpYksX0KI=; b=Qfm1ZbolG5P5ECLM0lHH3xymhb4eO2xUWPH/vdeyQs2pxXdxSE0TUK9aB5RiUKKbsp 8pMwIJd/QbFkALjiRssPYCpavBhwHbCH3w8NeZN2OwjYK5CBtOKyxzwgEetZv5pJVWub BzEgDy5KbrNQTrcgMiS3RRC25hC6dUyytEUuL2JvwAgdXQXy+hsxEYC3kx2R8/Yl6J6x /5xOsN5FwcUp0oF2bNezSpILZNHVM9JOrJuRR4kDtpPqMw0ZjGHEDipT12ZkW+svxtko lOaaxlF1Koxj6I6yuMNszYi5Vxqnal9F3nRgkbuzDAvBQjcWnw5jFxW9inxhkarIq6M0 ZFyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QzE2sx9W; 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-48011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48011-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=1; AJvYcCWVD5yb7MgQzbbZUYy5Chb6tvjCeTl7UmA0reCHbcaEsqn0AXDMsrt7oZb47emiaviw7JefxWNyoeevq6p6XX4y5berQaII5NbGNkhEWw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ig10-20020a056402458a00b0055ced89681csi1092321edb.587.2024.02.01.03.28.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 03:28:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QzE2sx9W; 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-48011-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48011-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D76351F24346 for ; Thu, 1 Feb 2024 11:28:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8958815CD7E; Thu, 1 Feb 2024 11:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QzE2sx9W"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RvvNU0ek" 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 4104815CD43; Thu, 1 Feb 2024 11:28:34 +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=1706786915; cv=none; b=iSDHi+r/ERLSgxPQ5RjZEaVmaUDuWLxIQ0+diiBu/BfOePe3tcDObuB6dbpjKp1zuKk8CSHZJDFRG5P29hgm9XowtRidFSBJqJLtfO7D41wanIBUluuE1LitI4KoHw1wB0i98ddpEiXeaxJbmQBaZmlfBNtdqmzHADxE8YNoyzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706786915; c=relaxed/simple; bh=EqDFDjr65DaTO5ggMTdy8mexaExyCS1krDj5TMD2nUw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=AZnSzNnOEjr8WhlNfYhKfhPWQ7NJmZ1cJzLimUK/Eqev4XgE/wU6KGAtx5Buba4H9W9UtIlY/LlRjQqRKtZWMX3DeQSuhHnuSQG6Xq8ZLmpr9xVg0JK+R/F/S3FU8v37JAAVdhQl15NDZ9bkmQe1lQsiQBO3AQNCaYP9SxGOVu0= 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=QzE2sx9W; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RvvNU0ek; 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=1706786906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EqDFDjr65DaTO5ggMTdy8mexaExyCS1krDj5TMD2nUw=; b=QzE2sx9Wxfn6tw0aBb0420I35AUa7LEYnmu5QEZW0zSj8eazpjB5B1EEBm57nLKwin6F3v FoFkC4E1k/PGBNqkZa8k1F/cJJZ+xHee1/rcwhPO/I1WXQ7U+u92eReJ+cwvVQPl2lI6WN SZYJ1+OoZ8O7uG8Nd1mFRqMdWkyDTIoWYt+hXAaGN4Lezhqao5YF2z+4vVWjBPsdOdSUUy YI9M5L4IW+sfyi8jZJgsKIRzM+I6XwvdSgxJlujldtdTMHDYVrwdLuQ0iEdttXHdL5Xg0y zKI61sSDJIhj04D7lwvQx8Zl3qKYtviJw6dgsRnbL1NjD+nKl4d8UpgDe2aKgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706786906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EqDFDjr65DaTO5ggMTdy8mexaExyCS1krDj5TMD2nUw=; b=RvvNU0ekbs845Rjzq7oecrmt8UowWVMaI4WtKRCMAce1vmWlsseYmTUmj4cypTdTad/kXh O6D9w6n3+NKGcDAg== To: Sreenath Vijayan , corbet@lwn.net, gregkh@linuxfoundation.org, jirislaby@kernel.org, pmladek@suse.com Cc: rdunlap@infradead.org, rostedt@goodmis.org, senozhatsky@chromium.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, taichi.shimoyashiki@sony.com, daniel.palmer@sony.com, anandakumar.balasubramaniam@sony.com, sreenath.vijayan@sony.com Subject: Re: [PATCH v4 1/2] printk: Add function to dump printk buffer directly to consoles In-Reply-To: <8cb5936021c5811bd03a6bc18300b1384009ac26.1706772349.git.sreenath.vijayan@sony.com> References: <8cb5936021c5811bd03a6bc18300b1384009ac26.1706772349.git.sreenath.vijayan@sony.com> Date: Thu, 01 Feb 2024 12:34:22 +0106 Message-ID: <87sf2co23t.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 2024-02-01, Sreenath Vijayan wrote: > It is useful to be able to dump the printk buffer directly to > consoles in some situations so as to not flood the buffer. > To do this, we reuse the CONSOLE_REPLAY_ALL mode code in > console_flush_on_panic() by moving the code to a helper function > console_rewind_all(). This is done because console_flush_on_panic() > sets console_may_schedule to 0 but this should not be done in our > case. Then console_rewind_all() is called from the new function > dump_printk_buffer() with console lock held to set the console > sequence number to oldest record in the buffer for all consoles. > Releasing the console lock will flush the contents of printk buffer > to the consoles. > > Suggested-by: John Ogness > Signed-off-by: Sreenath Vijayan > Signed-off-by: Shimoyashiki Taichi Reviewed-by: John Ogness