From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Corey Minyard <minyard@acm.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] Provide better abstraction for the serial drivers to xmit buf and tty
Date: Wed, 18 Apr 2007 20:12:05 +0100 [thread overview]
Message-ID: <20070418201205.60afc606@the-village.bc.nu> (raw)
In-Reply-To: <4626442B.5050708@acm.org>
> Currently the uart_info structure is allocated on an open, so it's not
> available until that point in time. The trouble is that console_init() is
> called before memory is set up, so you can't allocate the uart_info
> until it's too late for the console or a debugger that wants to work
> early, though it's ok for IPMI.
A debugger can provide a pre-existing uart_info and buffer. The
initialisation is only done if the uart_state->info pointer is NULL.
> The uart_info struct is not very big, maybe it would be best to pull that
> into uart_port? But the circ buffer might still be a problem, since it
> would need to be dynamically allocated and it might need to be
> checked instead.
How about this (untested idea in the finest Linux tradition)
Add
uart_console_prepare(struct uart_port *port, struct uart_info
*info, void *buffer)
{
port->info = info;
info->xmit.buf = buffer;
... etc ...
info->flags |= UPF_BOOTALLOCATED;
}
in uart_shutdown() check UPF_BOOTALLOCATED and don't free xmit.buf if so.
ditto in uart_remove_one_port for info itself
prev parent reply other threads:[~2007-04-18 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 4:54 [PATCH] Provide better abstraction for the serial drivers to xmit buf and tty Corey Minyard
2007-04-18 9:20 ` Alan Cox
2007-04-18 16:15 ` Corey Minyard
2007-04-18 19:12 ` Alan Cox [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070418201205.60afc606@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=minyard@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox