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 F2AC0C433FE for ; Tue, 11 Oct 2022 11:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbiJKLJo (ORCPT ); Tue, 11 Oct 2022 07:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiJKLJl (ORCPT ); Tue, 11 Oct 2022 07:09:41 -0400 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60591D73; Tue, 11 Oct 2022 04:09:37 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 005F72B066FE; Tue, 11 Oct 2022 07:09:34 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Tue, 11 Oct 2022 07:09:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1665486574; x=1665490174; bh=RM6oJ+Wm8I //KZ/oFLABpSMFlOHOa+xN+BM+5SLLxTE=; b=aSIYxCtYdt1yek8Ky0J+MBBZGd YNsaNQ38C8MlliiHZiynR73WHIEKlaMYrUM/xptOq/d1VGxGKHilri/wt4TPhIFl 64pWwEtnf3Mm+GBlyIbpVJpQnIu9y4g0d9eCxZLWYdqXFtjPyxTjbNw9ilvakv0s kTrl5vahN583XPq/hWNgme/dnMN0//GaRZfS9XwvyoL/O8sPfeDb8mVlY1H3DBz1 tsPsgCvF/r+aJNF6QQAjG70KR4G0PF6amSQjNEACaEL8rf2MK4osNJnaWCfaBIl3 xyB1psknJFftHp9vNRmjc1vTmSguTPn70u5jJmIgnouMXY3jQ+mF8YwbruLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1665486574; x=1665490174; bh=RM6oJ+Wm8I//KZ/oFLABpSMFlOHO a+xN+BM+5SLLxTE=; b=jflLYEknFINqe7qRTsk0daaR0znwMVl7nJ1IGdyv2ncY bVqpuAfif81zf9VlFFkyx4IUQoxDrHT8FtR/CGpTze63zrHIVbL1Q+fMroo/Z2dY pyd8G7jevH56aCaY4REcLf7jDd/DM4ioJvsToesOIgYmUg/Pp9v0fjWsbM/ULdQU 1llbnH6kO5bK+hMIMfzpiS1/CL6hZahPp9t3/yDhMt37JQWUfw/SiWQgJwCEJvVY PvBWDFObOFEzSiPMWB9n8kguEKV6oVYvvMC84SfDlTANpR8pJEx/QXM66QIjwJv/ UnKlF1rNoJ6V+kVms7q4RXjJxWsUchfap5IawwCxrQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejiedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2CA43B60086; Tue, 11 Oct 2022 07:09:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1015-gaf7d526680-fm-20220929.001-gaf7d5266 Mime-Version: 1.0 Message-Id: <85ca7eb4-3e0c-4ffb-8bac-a435594ca0f7@app.fastmail.com> In-Reply-To: <7438406d-b446-201e-0ec3-5cf0a5b9f32c@kernel.org> References: <20221011000840.289033-1-quic_eberman@quicinc.com> <20221011000840.289033-14-quic_eberman@quicinc.com> <7438406d-b446-201e-0ec3-5cf0a5b9f32c@kernel.org> Date: Tue, 11 Oct 2022 13:09:13 +0200 From: "Arnd Bergmann" To: "Jiri Slaby" , "Elliot Berman" , "Bjorn Andersson" , "Greg Kroah-Hartman" Cc: "Murali Nalajala" , "Trilok Soni" , "Srivatsa Vaddagiri" , "Carl van Schaik" , "Prakruthi Deepak Heragu" , "Andy Gross" , "Dmitry Baryshkov" , "Jassi Brar" , linux-arm-kernel@lists.infradead.org, "Mark Rutland" , "Lorenzo Pieralisi" , "Sudeep Holla" , "Marc Zyngier" , "Rob Herring" , "Krzysztof Kozlowski" , "Jonathan Corbet" , "Will Deacon" , "Catalin Marinas" , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 13/13] tty: gunyah: Add tty console driver for RM Console Services Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 11, 2022, at 8:02 AM, Jiri Slaby wrote: > On 11. 10. 22, 2:08, Elliot Berman wrote: >> + >> + /* below are for printk console. >> + * gh_rm_console_* calls will sleep and console_write can be called from >> + * atomic ctx. Two xmit buffers are used. The active buffer is tracked with >> + * co_xmit_idx. Writes go into the co_xmit_buf[co_xmit_idx] buffer. >> + * A work is scheduled to flush the bytes. The work will swap the active buffer >> + * and write out the other buffer. >> + */ > > Ugh, why? This is too ugly and unnecessary. What about passing the kfifo > to gh_rm_console_write() instead? You do memcpy() there anyway. Another problem here is that you really want the console output to be printed from atomic context, otherwise one would never see e.g. the output of a panic() call. Having a deferred write is probably fine for normal tty operations, but you probably want a different device for the console here, e.g. the hvc_dcc driver. Arnd