remarkable-linux/drivers/usb/serial
Dave Young f278a2f7bb tty: Fix regressions caused by commit b50989dc
The following commit made console open fails while booting:

	commit b50989dc44
	Author: Alan Cox <alan@linux.intel.com>
	Date:   Sat Sep 19 13:13:22 2009 -0700

	tty: make the kref destructor occur asynchronously

Due to tty release routines run in a workqueue now, error like the
following will be reported while booting:

INIT open /dev/console Input/output error

It also causes hibernation regression to appear as reported at
http://bugzilla.kernel.org/show_bug.cgi?id=14229

The reason is that now there's latency issue with closing, but when
we open a "closing not finished" tty, -EIO will be returned.

Fix it as per the following Alan's suggestion:

  Fun but it's actually not a bug and the fix is wrong in itself as
  the port may be closing but not yet being destructed, in which case
  it seems to do the wrong thing.  Opening a tty that is closing (and
  could be closing for long periods) is supposed to return -EIO.

  I suspect a better way to deal with this and keep the old console
  timing is to split tty->shutdown into two functions.

  tty->shutdown() - called synchronously just before we dump the tty
  onto the waitqueue for destruction

  tty->cleanup() - called when the destructor runs.

  We would then do the shutdown part which can occur in IRQ context
  fine, before queueing the rest of the release (from tty->magic = 0
  ...  the end) to occur asynchronously

  The USB update in -next would then need a call like

       if (tty->cleanup)
               tty->cleanup(tty);

  at the top of the async function and the USB shutdown to be split
  between shutdown and cleanup as the USB resource cleanup and final
  tidy cannot occur synchronously as it needs to sleep.

  In other words the logic becomes

       final kref put
               make object unfindable

       async
               clean it up

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
[ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
[ Changed serial naming to match new rules, dropped tty_shutdown as per
  comments from Alan Stern  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-27 13:35:16 -07:00
..
aircable.c USB: usb-serial: replace shutdown with disconnect, release 2009-06-15 21:44:47 -07:00
ark3116.c USB: ark3116: add IrDA support for Gembird UIR-22 2009-09-23 06:46:32 -07:00
belkin_sa.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
belkin_sa.h belkin_sa: clean up code 2008-07-22 13:03:22 -07:00
bus.c USB: usb-serial: call port_probe and port_remove at the right times 2009-06-15 21:44:47 -07:00
ch341.c USb: Break support for WinChipHead CH341 340 USB->Serial "chip" 2009-09-23 06:46:35 -07:00
ChangeLog.history trivial: Fix misspelling of firmware 2009-03-30 15:21:59 +02:00
console.c USB serial: update the console driver 2009-09-19 13:13:42 -07:00
cp210x.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
cyberjack.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
cypress_m8.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
cypress_m8.h trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
digi_acceleport.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
empeg.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
ezusb.c USB: remove use of err() in drivers/usb/serial 2008-10-17 14:41:10 -07:00
ezusb_convert.pl
ftdi_sio.c USB: serial: ftdi: handle gnICE+ JTAG adaptors 2009-09-23 06:46:16 -07:00
ftdi_sio.h USB: serial: ftdi: handle gnICE+ JTAG adaptors 2009-09-23 06:46:16 -07:00
funsoft.c funsoft: Switch to linux/uaccess 2008-07-22 13:03:23 -07:00
garmin_gps.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
generic.c USB: use kfifo to buffer usb-generic serial writes 2009-09-23 06:46:34 -07:00
hp4x.c USB: remove info() macro from usb/serial drivers 2008-10-17 14:41:09 -07:00
io_16654.h
io_edgeport.c trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
io_edgeport.h USB: io_edgeport: Convert to generic boolean 2007-04-27 13:28:36 -07:00
io_ionsp.h
io_tables.h USB: usb-serial: replace shutdown with disconnect, release 2009-06-15 21:44:47 -07:00
io_ti.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
io_ti.h
io_usbvend.h USB: io_ti: Digi EdgePort update for new devices 2007-07-12 16:29:48 -07:00
ipaq.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ipaq.h
ipw.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ir-usb.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
iuu_phoenix.c USB: iuu_phoenix: add a way to select the default VCC 2009-09-23 06:46:36 -07:00
iuu_phoenix.h USB: add iuu_phoenix driver 2008-02-01 14:34:47 -08:00
Kconfig trivial: fix typos/grammar errors in Kconfig texts 2009-03-30 15:22:01 +02:00
keyspan.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
keyspan.h tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
keyspan_pda.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
keyspan_usa26msg.h
keyspan_usa28msg.h
keyspan_usa49msg.h
keyspan_usa67msg.h USB Serial Keyspan: add support for USA-49WG & USA-28XG 2007-07-12 16:29:45 -07:00
keyspan_usa90msg.h
kl5kusb105.c trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
kl5kusb105.h
kobil_sct.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
kobil_sct.h
Makefile USB: serial: rename cp2101 driver to cp210x 2009-03-24 16:20:44 -07:00
Makefile-keyspan_pda_fw
mct_u232.c tty: USB: serial/mct_u232, fix tty refcnt 2009-09-19 13:13:37 -07:00
mct_u232.h USB: mct232: speed, new termios and compliance cleanups 2008-02-01 14:34:56 -08:00
mos7720.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
mos7840.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
moto_modem.c USB: serial: Spelling correction in Motorola USB Phone driver 2009-09-23 06:46:29 -07:00
navman.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
omninet.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
opticon.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
option.c USB: serial: full autosuspend support for the option driver 2009-09-23 06:46:25 -07:00
oti6858.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
oti6858.h USB: oti6858 usb-serial driver (in Nokia CA-42 cable) 2007-07-12 16:29:47 -07:00
pl2303.c USB-serial: pl2303: use 1.5 instead of 2 stop bits with 5 data bits 2009-09-23 06:46:37 -07:00
pl2303.h USB: serial: pl2303: new hardware support - sanwa multimeter 2009-09-23 06:46:15 -07:00
qcserial.c USB: qcserial: Add extra device IDs 2009-04-17 10:50:24 -07:00
safe_serial.c USB: remove use of err() in drivers/usb/serial 2008-10-17 14:41:10 -07:00
siemens_mpi.c USB: add siemens_mpi usb-serial "stub" driver 2009-01-07 10:00:13 -08:00
sierra.c drivers/usb/serial/sierra.c: fix CONFIG_PM=n build 2009-09-24 07:21:06 -07:00
spcp8x5.c trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
symbolserial.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ti_usb_3410_5052.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
ti_usb_3410_5052.h USB: two more usb ids for ti_usb_3410_5052 2009-02-09 11:19:48 -08:00
usb-serial.c tty: Fix regressions caused by commit b50989dc 2009-09-27 13:35:16 -07:00
usb_debug.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
visor.c tty: USB does not need the filp argument in the drivers 2009-09-19 13:13:26 -07:00
visor.h USB: visor add ACER S10 palm device id 2007-08-22 14:27:43 -07:00
whiteheat.c tty: USB serial termios bits 2009-09-19 13:13:33 -07:00
whiteheat.h whiteheat: coding style 2008-07-22 13:03:22 -07:00