From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F203CCCA47E for ; Tue, 21 Jun 2022 21:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355374AbiFUVrt (ORCPT ); Tue, 21 Jun 2022 17:47:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345358AbiFUVrr (ORCPT ); Tue, 21 Jun 2022 17:47:47 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33DBA186E1 for ; Tue, 21 Jun 2022 14:47:47 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1655848065; 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=MW31G5kbLu7/Ci0H2MhhDew+fQAgETw4RoigY7kMdHg=; b=XDBfijn0gdcFhbScEOcVU21nKf/td+AsNM2biCOYygacdDxoAJwlaYC3i4lAJUwVIbl59Z Y7XFJ51Xt4ocAQk5T43Nh0WKqIgNGlaJRmDWqgAz7fkLSJk5h46BI90fhi/SsBjwUPakXi XELp0SGBxFqUrIeJb1PArKIsHoJThxp5fbErz6X8tKlriCTSqeOING9LztUr7KGuhRaLHf ERuE/N/rWVFsCvImB2T2gZPSWlRRGkVCLPGZdwHBHJDtmfTnTneBXgPhRaRVf0Eg3v0l1R tlgAAJSQDoWU6nAR5dXughhiH6pPdo7xGnTtZGEf0ta8f/ZUpI2t/8cMY7Sz4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1655848065; 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=MW31G5kbLu7/Ci0H2MhhDew+fQAgETw4RoigY7kMdHg=; b=reFnj+hQ8X0HNAgyXwNbv8GWk81hcdrqWxrZ71D00HbfBDtrheru8sdeIBDhJCUCE/udWG QeSgrlQQgahjp4CA== To: Sergey Senozhatsky Cc: "Jason A. Donenfeld" , Petr Mladek , Marco Elver , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt Subject: Re: [PATCH v2] printk: allow direct console printing to be enabled always In-Reply-To: References: <20220619204326.556923-1-Jason@zx2c4.com> <87letsw8en.fsf@jogness.linutronix.de> Date: Tue, 21 Jun 2022 23:53:44 +0206 Message-ID: <875yktadtr.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-20, Sergey Senozhatsky wrote: > would it make sense/be possible/etc. to look into possibility > to address that "deferred kthread vs IRQ" race by moving prb entries > emit to the same IRQ handler that emits chars from uart xmit buffer? I think this is an interesting idea. We could have a function that would allow serial drivers (if they had a console on them) to flush any pending printk messages for their console. Each driver would need to call this function for themselves. And also the driver would need to ensure that it is not holding any locks that the console-part of the driver will need. And it would need to be best effort, because the related kthread may already be in the process of printing. But in general I think it could be a nice feature to improve the sort-of-synchronous behavior of printk for drivers that use it. John Ogness