diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2009-06-22 12:32:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-12 18:16:39 -0400 |
commit | 6e4061210150d1d6d388c5fba05f6b49a306a27e (patch) | |
tree | 7c059e60623fab637b2049bdf59b42040025b00b /drivers/usb/serial/usb-serial.c | |
parent | bf7fbb022f0a3da27a2bcf8d7c973c813d942384 (diff) |
USB: console: Fix regression in usb console on kernel boot
The commit 335f8514f200e63d689113d29cb7253a5c282967 introduced a
regression which stopped usb consoles from working correctly as a
kernel boot console as well as interactive login device.
The addition of the serial_close() which in turn calls
tty_port_close_start() will change the reference count of port.count
and warn about it. The usb console code had previously incremented
the port.count to indicate it was making use of the device as a
console and the forced change causes a double open on the usb device
which leads to a non obvious kernel oops later on when the tty is
freed.
To fix the problem instead make use of port->console to track if the
port is in fact an active console port to avoid double initialization
of the usb serial device. The port.count is incremented and
decremented only with in the scope of usb_console_setup() for the
purpose of the low level driver initialization.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index a84216464ca0..9e6027b3a2e9 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -220,7 +220,8 @@ static int serial_open (struct tty_struct *tty, struct file *filp) | |||
220 | tty->driver_data = port; | 220 | tty->driver_data = port; |
221 | tty_port_tty_set(&port->port, tty); | 221 | tty_port_tty_set(&port->port, tty); |
222 | 222 | ||
223 | if (port->port.count == 1) { | 223 | /* If the console is attached, the device is already open */ |
224 | if (port->port.count == 1 && !port->console) { | ||
224 | 225 | ||
225 | /* lock this module before we call it | 226 | /* lock this module before we call it |
226 | * this may fail, which means we must bail out, | 227 | * this may fail, which means we must bail out, |