lkml.org 
[lkml]   [2022]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 13/13] tty: gunyah: Add tty console driver for RM Console Services
From


On 10/10/2022 11:02 PM, Jiri Slaby wrote:
> 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.
>

Sure, I can do this instead.

\
 
 \ /
  Last update: 2022-10-12 00:04    [W:0.163 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site