[lkml]   [2007]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Provide better abstraction for the serial drivers to xmit buf and tty
> 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)


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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-04-18 21:11    [W:0.032 / U:7.088 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site