From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 800F5428480 for ; Tue, 7 Jul 2026 15:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783438303; cv=none; b=Scz2Sk39Eu03sQicgo8EPYNRI7E7X2FkoIXiPsUELRLVZUq38Oh2dyXXXYnygVu38YfFuIk5rjk7rVafwrbytr7O3iIQILYpyuEL9ZTBGAETMoG3VtCq6dOdwIkto1pRwvx25bskJW44HH+MR0YISpwyqEERCMXZTErdiR+O8wo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783438303; c=relaxed/simple; bh=is6AVzN2o+b1hAJEgaZMoZOIskeWSdm8HCezvmiVjKA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mWQzil9hw9mUxPb0zlyBqSH3qQa9sJxACBzjBUB8tNrlmScDPAnJZWEDwck3/GlM8TFZRM0jpV40JVWfRBwyN00y8LlGxa01sr9es3k8jNoS+7Z8NTtle7rkvnbg4yVKsp1tSe3TNFLYKqNvGP4m/qKqeXgwxx3ldvsMSon5UvI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=T/YYjdAl; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="T/YYjdAl" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-47de0093c42so2413547f8f.3 for ; Tue, 07 Jul 2026 08:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783438300; x=1784043100; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3dnXXTA5QHDGkY6+1EXQz/Z/TzRlKI5k35UU0v99L+Q=; b=T/YYjdAlXMPMGgadkbrC+FUsTl6p8fQ5d6fz5HlMzwgdT+k9YktUFZX8e5gVPono1H 12/NDGzyqiAS8/qMFAW4keRbFen9WC62d8WwTXxpG6D4iDOHKnbj8KBJUAZQCGM1bmzM jCNHdas2RQYRt66nVn+PJyAOza0mf1Lk+fd/y1vuzQ8+Hq5J9s2U3EFXGyf9RQhHv7Th bKVH6TWprc0eTDucMpWBMi7/06OqTtm1/FjhMqmjKoI1QGP/byazXmdwyLah/se+ix2s haHVyl0oGNhEv7wHC2fEMR/XLFF3NWSI3w/jGt7VX1c16ytXwOW2zxu4ayscl72VN0xX Oe8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783438300; x=1784043100; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3dnXXTA5QHDGkY6+1EXQz/Z/TzRlKI5k35UU0v99L+Q=; b=V9UlYcfE1IB7Xlg+C+2GHOi68PDpuUOSlPnQdqalz/rmLvL4a3AvHaOfJEpqhv1D05 yRi4zjAP/GfUi6NWtaVKk1AyKYXeIsadBBEOcVjjvqlBly/7q+5gEkBu90NG1KxpIOIv CjEA2n3ZG0UkaSB/hp33fUpnZuDzPUZYGZopEOdj4sTDq80BasiuxcvUWb3q6kWkc1b3 ILUBEjWRdFxCKwb0Svb03ufYHoH2CShbS/lmr5jyWTjT2CVUkWeqkCqsP7z1CdPvBd4F 3R85QCv0E99p2ZbCSKVFe7CGMuMPqIFBQsa7NliTTpuytJBjSVwTbzN1DpaxPhSsQMC3 FmcQ== X-Forwarded-Encrypted: i=1; AHgh+RrDaHYMfwuGYUusCTRkeJDFWRPFRrZlQOwpWYUlW6YolI/PudbbBzX0C8tBt1xEZWeFaBCF4HRFTKHuaFM=@vger.kernel.org X-Gm-Message-State: AOJu0YxohGPYC/cWPls1OmQ44KYGYSzB9qNRy8D4pC1HsxoiuorCexqE FKh3FOoUXdcWJt9BcrKn5r96M77bFEfXFd/eUfbzLbNR7pqnT5aRkdsFIiCwhsI8Z9U= X-Gm-Gg: AfdE7cml1Oz7hQfC7zDF+/JTaFyCZchC+gANJ9FR26ZIMmxlYcB82tXlli7GNXkvRxr EnBmfxIvjV/OaYkWrkTu6+03dOb7GU9b24kC0++tcVjakcSVlhTFbkoakZH5GgeqU3upaSsJXmt 1+08HOGdmu7C/68Q585YjgCOwHgAJHXuE8W4h3P+xsO7MQ2jQZpITojM7Oiw4FhPVsz/u7JXFrD G3cZ8LXo1BaM1V4Jc+49IFiWAuORRAV0xE84AarK1YqCPFZdgczB9feieL/wWc5kim3klDKCX3C HWbe1jkchfMve2xx4t6RrA5Cxp1z1smh7z+zk1cXDN5T5gGI9Rx7rjBUZNJRrjVsUs23ZCEFr+m RBTuY9bvvKxqmplM55kz0rr1UGxbaAQK3MDtdR0eMU6jBs0hK6oZBhmks3yFlSdXhtGx4IZhmK2 CAxjpluPU1/IkJ59A= X-Received: by 2002:a05:6000:bc7:b0:47d:dfc6:b27e with SMTP id ffacd0b85a97d-47de66bf187mr4980390f8f.31.1783438299879; Tue, 07 Jul 2026 08:31:39 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960b06sm33961270f8f.28.2026.07.07.08.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 08:31:39 -0700 (PDT) Date: Tue, 7 Jul 2026 17:31:37 +0200 From: Petr Mladek To: John Ogness Cc: Andrew Murray , Jonathan Corbet , Shuah Khan , Russell King , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Steven Rostedt , Sergey Senozhatsky , Andrew Morton , Sebastian Andrzej Siewior , Clark Williams , Randy Dunlap , Linus Torvalds , Greg Kroah-Hartman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-rt-devel@lists.linux.dev Subject: Re: [PATCH v2 3/4] printk: nbcon: move printk_delay to console emiting code Message-ID: References: <20260630-deprecate_boot_delay-v2-0-f9883d36aa4b@thegoodpenguin.co.uk> <20260630-deprecate_boot_delay-v2-3-f9883d36aa4b@thegoodpenguin.co.uk> <87zf08w7qo.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; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zf08w7qo.fsf@jogness.linutronix.de> On Fri 2026-07-03 15:03:51, John Ogness wrote: > Hi, > > Sorry I am so late to this party. > > On 2026-06-30, Andrew Murray wrote: > > diff --git a/include/linux/console.h b/include/linux/console.h > > index d624200cfc1708bf73925892a466efe0c95c5586..3478b556c0eb9579530409dc6fbb9b5a8bff581c 100644 > > --- a/include/linux/console.h > > +++ b/include/linux/console.h > > @@ -290,6 +290,8 @@ struct nbcon_context { > > * @outbuf: Pointer to the text buffer for output > > * @len: Length to write > > * @unsafe_takeover: If a hostile takeover in an unsafe state has occurred > > + * @emitted: The write context attempted to emit the message. Might > > + * be incomplete. > > * @cpu: CPU on which the message was generated > > * @pid: PID of the task that generated the message > > * @comm: Name of the task that generated the message > > @@ -298,7 +300,8 @@ struct nbcon_write_context { > > struct nbcon_context __private ctxt; > > char *outbuf; > > unsigned int len; > > - bool unsafe_takeover; > > + unsigned char unsafe_takeover : 1; > > + unsigned char emitted : 1; > > This is the wrong structure to add this flag. This structure is for > the nbcon drivers. Good point. I see: + "struct nbcon_write_context" is intended for passing information down to the console drivers via .write_thread() and .write_atomic() callbacks. + "struct nbcon_contex" aleady contains section "members set by emit". > struct nbcon_context would be the correct structure. > > > diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c > > index 4b03b019cd5ee25d68e9ace84392045e91241a7f..ae45cb0589c0effafc66f1756bdaecd1c1e53ab9 100644 > > --- a/kernel/printk/nbcon.c > > +++ b/kernel/printk/nbcon.c > > @@ -1525,6 +1532,8 @@ bool nbcon_legacy_emit_next_record(struct console *con, bool *handover, > > } > > > > progress = nbcon_emit_one(&wctxt, use_atomic); > > + if (progress && wctxt.emitted) > > + printk_delay(use_atomic); > > > > if (use_atomic) { > > start_critical_timings(); > > This is too deep (also pointed out by Sashiko) because it multiplies the > delay times the number of consoles. For the legacy printing, it would be > more appropriate to put the delay inside console_flush_all() and > legacy_kthread_func(). True. The question is if the proper solution is worth the complexity. We would need to pass the information down two level of the API. It would require adding a new (output) parameter to console_flush_one_record(), nbcon_legacy_emit_next_record(), and console_emit_next_record(). It is not that complicated but these functions are already hairy enough so we should be careful. Best Regards, Petr