[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7438406d-b446-201e-0ec3-5cf0a5b9f32c@kernel.org>
Date: Tue, 11 Oct 2022 08:02:35 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Elliot Berman <quic_eberman@...cinc.com>,
Bjorn Andersson <quic_bjorande@...cinc.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Murali Nalajala <quic_mnalajal@...cinc.com>,
Trilok Soni <quic_tsoni@...cinc.com>,
Srivatsa Vaddagiri <quic_svaddagi@...cinc.com>,
Carl van Schaik <quic_cvanscha@...cinc.com>,
Prakruthi Deepak Heragu <quic_pheragu@...cinc.com>,
Andy Gross <agross@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Jassi Brar <jassisinghbrar@...il.com>,
linux-arm-kernel@...ts.infradead.org,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Sudeep Holla <sudeep.holla@....com>,
Marc Zyngier <maz@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Jonathan Corbet <corbet@....net>,
Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Arnd Bergmann <arnd@...db.de>, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 13/13] tty: gunyah: Add tty console driver for RM
Console Services
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
Powered by blists - more mailing lists