Commit e85c348d authored by Jason Wessel's avatar Jason Wessel Committed by Stephen Rothwell

USB: console: pass initial console baud on to first tty open

The first open of the usb serial HW has the termios initialized to the
default of 9600 baud, and this will override what ever was setup via
the original console initialization.

The solution is to save the console baud rate and re-use it later on
the first open, so as to allow the use of baud rates other than 9600
for the usb serial console.
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4463f59b
...@@ -175,6 +175,7 @@ static int usb_console_setup(struct console *co, char *options) ...@@ -175,6 +175,7 @@ static int usb_console_setup(struct console *co, char *options)
/* The console is special in terms of closing the device so /* The console is special in terms of closing the device so
* indicate this port is now acting as a system console. */ * indicate this port is now acting as a system console. */
port->console = 1; port->console = 1;
port->console_init_baud = baud;
retval = 0; retval = 0;
out: out:
......
...@@ -245,7 +245,9 @@ static int serial_open (struct tty_struct *tty, struct file *filp) ...@@ -245,7 +245,9 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
* first time the port is opened and it is not a * first time the port is opened and it is not a
* console port where the HW has already been * console port where the HW has already been
* initialized */ * initialized */
if (!port->console) { if (port->console) {
tty_encode_baud_rate(tty, port->console_init_baud, port->console_init_baud);
} else {
retval = serial->type->open(tty, port, filp); retval = serial->type->open(tty, port, filp);
if (retval) if (retval)
goto bailout_interface_put; goto bailout_interface_put;
......
...@@ -107,6 +107,7 @@ struct usb_serial_port { ...@@ -107,6 +107,7 @@ struct usb_serial_port {
char throttled; char throttled;
char throttle_req; char throttle_req;
char console; char console;
int console_init_baud;
unsigned long sysrq; /* sysrq timeout */ unsigned long sysrq; /* sysrq timeout */
struct device dev; struct device dev;
enum port_dev_state dev_state; enum port_dev_state dev_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment