]> git.baikalelectronics.ru Git - kernel.git/commit
USB: console: Fix regression in usb console on kernel boot
authorJason Wessel <jason.wessel@windriver.com>
Mon, 22 Jun 2009 16:32:20 +0000 (11:32 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 12 Jul 2009 22:16:39 +0000 (15:16 -0700)
commit8f70247f3c78d167903486ea915388b05b30f92c
tree7c059e60623fab637b2049bdf59b42040025b00b
parent9b3f5dbf6c0b625374d5d72d8b752c6612b9bbc4
USB: console: Fix regression in usb console on kernel boot

The commit bea8a30230c41ff5fb9fac8695bd0e28dc18ef64 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>
drivers/usb/serial/console.c
drivers/usb/serial/usb-serial.c