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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6B45C433F5 for ; Tue, 11 Oct 2022 06:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LPz3BbukrTTqQbpwiDj1xXrkHDzyb9yPWfqfIHQU+PY=; b=OpmzRgqpn+o5iT 3njaw/1C73Qz9RpdJm40UyVaqhInhC8bL/yJ6mnNmPsvyVxa1TOqrB3kfHETnYUE2qcz25j96TlQn E6P+eaFV+lsDh8xKXkpqtt4yloZtJMFi72uQd+mS6snOovQ1I3cDYge8mYH2LvGcMx3tG/f/ZuXNG UZyf+J4bg/q2Ia4Fd7L86HWJnM3fA7lw55DoJ3RmLHaIhvhOrCbLZVErixUrYvV/J+f68haWKK+Yo L/wl2Zl28vNLsq2VwGWsHKvCqeWMvHZqIHNXx3tVvPPqMTY/osgajV20JaJMAhbv5gtTTsO4ERRc8 q501DZxSpdQJoCJwZdeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oi8Mp-003LJN-K6; Tue, 11 Oct 2022 06:03:51 +0000 Received: from mail-wr1-f47.google.com ([209.85.221.47]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oi8Lg-003Kkq-8a for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 06:02:41 +0000 Received: by mail-wr1-f47.google.com with SMTP id bp11so7173786wrb.9 for ; Mon, 10 Oct 2022 23:02:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c8oFuI+x6kR8yEhpzpaADt1Pt7upeF77ruYQZxt6LGM=; b=uXMzC/MrU5uDQjbmTbVl3LxlYpXNMPE9lwqg+3p9zn0pzJfOyYdzXifrL9jSklrZPk 01p5CK7//V4KbEXpAtbckLNmKVn+fsdSn4Wite2DBcNBLIEM4qKKp2FVhITWp/HvInob n562EpoIKMeQ37flqTvONYOTnz6P0zqwwZORaqYSibbIJ7VVzw3IHu0A6gw9NwFK6+Ir VZvokMm/WDDG7arjJ+6AWCEt90ywkNLWnWZ3D2lVLHYEYrUMnx4bEgcYPgtoybzGU4Gm XxmUfJzfVy+TQPjfJj5ezYW5w0RnCdW9CbfNizDcrQ1HLNmTztn6Jx8D88eNHOAaQzC2 vclg== X-Gm-Message-State: ACrzQf1JUFsOtTSk5+qMoBKSxNTrx7YFY0vrtwqlqHQMjnzi6hxU40ty MTc7dt5pwRbHD3k5wBhhPAw= X-Google-Smtp-Source: AMsMyM4sYzCnoUZrJDLxBsXARmm93ntdlJ2SebeXIof0NbiX8qLQAqnVIyPhGzeKtYhnMsGgI4eyNg== X-Received: by 2002:a05:6000:1843:b0:22e:77b0:2e5 with SMTP id c3-20020a056000184300b0022e77b002e5mr13577737wri.215.1665468157864; Mon, 10 Oct 2022 23:02:37 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id u10-20020a5d434a000000b00228de351fc0sm10564262wrr.38.2022.10.10.23.02.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Oct 2022 23:02:37 -0700 (PDT) Message-ID: <7438406d-b446-201e-0ec3-5cf0a5b9f32c@kernel.org> Date: Tue, 11 Oct 2022 08:02:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v5 13/13] tty: gunyah: Add tty console driver for RM Console Services Content-Language: en-US To: 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 , Arnd Bergmann , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221011000840.289033-1-quic_eberman@quicinc.com> <20221011000840.289033-14-quic_eberman@quicinc.com> From: Jiri Slaby In-Reply-To: <20221011000840.289033-14-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221010_230240_338462_184A276E X-CRM114-Status: GOOD ( 15.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11. 10. 22, 2:08, Elliot Berman wrote: > Gunyah provides a console for each VM using the VM console resource > manager APIs. This driver allows console data from other > VMs to be accessed via a TTY device and exports a console device to dump > Linux's own logs to our console. ... > +struct rm_cons_drv_data { > + struct tty_driver *tty_driver; > + struct device *dev; > + > + spinlock_t ports_lock; > + struct rm_cons_port *ports[RM_CONS_TTY_ADAPATERS]; > + > + struct notifier_block rm_cons_notif; > + struct console console; > + > + /* 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. > + char *co_xmit_buf[2]; > + int co_xmit_idx; > + unsigned int co_xmit_count; > + spinlock_t co_xmit_lock; > + struct work_struct co_flush_work; > +}; > + > +static int rm_cons_notif_handler(struct notifier_block *nb, unsigned long cmd, void *data) > +{ > + int count, i; > + struct rm_cons_port *rm_port = NULL; > + struct tty_port *tty_port = NULL; > + struct rm_cons_drv_data *cons_data = > + container_of(nb, struct rm_cons_drv_data, rm_cons_notif); > + const struct gh_rm_notification *notif = data; > + struct gh_rm_notif_vm_console_chars const * const msg = notif->buff; So you did not comment on/address all my notes? -- js _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel