This is v3 of the USB-disconnect series rebased on Linus tree of last week (c41b3810c09) and the recently submitted fixes-series: USB: fixes for 3.9-final I retained Alan's ACK on the urb-poison patch. This series fixes a bunch of issues related to device disconnect. As the diffstat shows: 35 files changed, 601 insertions(+), 1576 deletions(-) a lot of boilerplate and broken code is removed in the process. I've tried to group related patches and the empty lines in the patch list below are supposed to indicate this. The first set contains various clean-ups and minor fixes. The second set removes legacy disconnect tests which are both broken and unnecessary. The third set cleans up disconnect handling in usb-serial core. It also reimplements the stopping of I/O at disconnect and suspend using URB- poisoning, which, it turns out, appears to have broken since first added to USB core. The included fix is not marked for stable as the bug did not affect any in-kernel drivers (until now). The fourth set adds generic icount and TIOCMIWAIT support to usb-serial, and replaces most current implementations with the generic one, thereby fixing a bunch of races and other odd behaviour as well. Some drivers with incomplete icount-support are simply moved over to use the new tiocmiwait usb-serial operation, while TIOCMIWAIT is removed from the two drivers which appeared to support the required interrupts but in fact did not (copy-paste, I guess). I basically rewrote parts of spcp8x5 (and fixed its modem-status handling) in the process. This version of the series also make sure that the custom TIOCMIWAIT-implementations are woken up at disconnect. The fifth set gets rid of the no longer needed disconnect checks in subdriver close and tiocmset callbacks. This can be done as the tty-port implementation guarantees (and has for some time) that close is never called after tty_vhangup returns (as long as we prevent new activations, which we do). This has the added benefit of allowing us to do clean shutdowns and put devices in any low-power modes also on driver unbind. The sixth set removes another unnecessary and broken legacy disconnect test from two drivers. The final patch updates some copyright information. All patches have been compile tested, while the usb-serial, ftdi_sio and pl2303 ones have been tested on actual hardware. Johan v3: - rebase on "USB: fixes for 3.9-final" - reuse tty-port wait queue to implement TIOCMIWAIT - make sure generic TIOCMIWAIT handles all hangups - incorporate disconnect fix series for custom TIOCMIWAIT - add two patches that remove unused, private MSR-wait queues - fix indentation of kl5kusb105-close patch v2: - rebase on c41b3810c09 and two previously posted series - expand usb-serial-bus-remove patch commit message - fix typo in visor patch (already posted once) Johan Hovold (94): USB: ftdi_sio: remove obsolete port data refcounting USB: kl5kusb105: remove unnecessary urb kill on close USB: iuu_phoenix: remove unnecessary urb kill on close USB: pl2303: use interface device for debug USB: pl2303: make set_control_lines a port operation USB: serial: rename tty-port callbacks USB: serial: remove redundant comments USB: serial: clean up debug info USB: serial: remove redundant allocation error messages USB: serial: remove port number from generic-driver debug USB: ark3116: remove bogus disconnect test in close USB: cyberjack: remove bogus disconnect test in close USB: digi_acceleport: remove bogus disconnect test in close USB: iuu_phoenix: remove bogus disconnect test in close USB: keyspan: remove bogus disconnect test in close USB: keyspan_pda: remove bogus disconnect test from dtr_rts USB: keyspan_pda: remove bogus disconnect test in close USB: mos7840: remove bogus disconnect test in close USB: sierra: remove bogus disconnect test in close USB: usb_wwan: remove bogus disconnect test in close USB: serial: remove bogus disconnect test in cleanup USB: ssu100: remove explicit initialisation of disconnect USB: ssu100: remove custom close operation USB: serial: fix generic disconnect implementation USB: serial: remove generic disconnect callback USB: serial: remove generic release callback USB: serial: clean up generic-operation handling USB: cyberjack: fix disconnect handling USB: serial: fix port release USB: serial: rename port release USB: fix urb-poison imbalance USB: serial: use urb poison to reliably kill traffic USB: serial: clean up usb-serial bus device removal USB: serial: add tiocmiwait subdriver operation USB: serial: add generic TIOCMIWAIT implementation USB: serial: wake up MSR-wait queue on disconnect USB: serial: add generic get_icount implementation USB: ftdi_sio: use port icount USB: ftdi_sio: switch to generic TIOCMIWAIT implementation USB: ftdi_sio: switch to generic get_icount implementation USB: ark3116: switch to generic get_icount implementation USB: ark3116: switch to generic TIOCMIWAIT implementation USB: ch341: replace custom ioctl operation with tiocmiwait USB: ch341: fix TIOCMIWAIT and disconnect USB: cypress_m8: replace custom ioctl operation with tiocmiwait USB: cypress_m8: fix TIOCMIWAIT and disconnect USB: digi_acceleport: remove unused MSR-wait queue USB: f81232: add custom tiocmiwait operation USB: f81232: fix TIOCMIWAIT and disconnect USB: io_edgeport: switch to generic get_icount implementation USB: io_edgeport: switch to generic TIOCMIWAIT implementation USB: io_ti: switch to generic get_icount implementation USB: io_ti: switch to generic TIOCMIWAIT implementation USB: iuu_phoenix: remove unused MSR-wait queue USB: mct_u232: switch to generic get_icount implementation USB: mct_u232: switch to generic TIOCMIWAIT implementation USB: mos7720: remove broken get_icount and TIOCMIWAIT USB: mos7840: remove smp barriers from icount handling USB: mos7840: switch to generic get_icount implementation USB: mos7840: switch to generic TIOCMIWAIT implementation USB: oti6858: replace custom ioctl operation with tiocmiwait USB: oti6858: fix TIOCMIWAIT and disconnect USB: pl2303: add custom tiocmiwait operation USB: pl2303: fix TIOCMIWAIT and disconnect USB: quatech2: switch to generic get_icount implementation USB: quatech2: switch to generic TIOCMIWAIT implementation USB: spcp8x5: remove broken TIOCMIWAIT support USB: spcp8x5: remove broken uart-error handling USB: spcp8x5: clean up code USB: spcp8x5: pass usb-serial port to control functions USB: spcp8x5: clean up modem status retrieval USB: spcp8x5: reimplement device type detection USB: spcp8x5: add proper modem-status support USB: ssu100: switch to generic get_icount implementation USB: ssu100: switch to generic TIOCMIWAIT implementation USB: ti_usb_3410_5052: switch to generic get_icount implementation USB: ti_usb_3410_5052: switch to generic TIOCMIWAIT implementation USB: serial: remove unused MSR-wait queue USB: cp210x: always disable uart on close USB: cypress_m8: remove bogus disconnect test from close USB: io_ti: always disable uart on close USB: kl5kusb105: always disable uart on close USB: metro-usb: always disable uart on close USB: mos7720: always disable uart on close USB: opticon: fix return value of tiocmset USB: opticon: remove disconnect test from tiocmset USB: pl2303: fix return value of tiocmset USB: pl2303: remove disconnect test from tiocmset USB: quatech2: always disable uart on close USB: visor: always disable uart on close USB: garmin_gps: remove bogus disconnect test in close USB: garmin_gps: remove bogus disconnect test in bulk callback USB: iuu_phoenix: remove bogus disconnect test in close USB: serial: update copyright information drivers/usb/core/urb.c | 5 +- drivers/usb/serial/ark3116.c | 87 ++-------- drivers/usb/serial/bus.c | 5 +- drivers/usb/serial/ch341.c | 30 +--- drivers/usb/serial/cp210x.c | 6 +- drivers/usb/serial/cyberjack.c | 19 +-- drivers/usb/serial/cypress_m8.c | 94 +++++------ drivers/usb/serial/digi_acceleport.c | 95 +++++------ drivers/usb/serial/f81232.c | 13 +- drivers/usb/serial/ftdi_sio.c | 121 ++------------ drivers/usb/serial/garmin_gps.c | 10 -- drivers/usb/serial/generic.c | 144 +++++++++++----- drivers/usb/serial/io_edgeport.c | 76 +-------- drivers/usb/serial/io_tables.h | 12 +- drivers/usb/serial/io_ti.c | 85 ++-------- drivers/usb/serial/iuu_phoenix.c | 21 +-- drivers/usb/serial/keyspan.c | 26 +-- drivers/usb/serial/keyspan_pda.c | 19 +-- drivers/usb/serial/kl5kusb105.c | 30 ++-- drivers/usb/serial/mct_u232.c | 94 +---------- drivers/usb/serial/metro-usb.c | 5 +- drivers/usb/serial/mos7720.c | 68 +------- drivers/usb/serial/mos7840.c | 154 +++-------------- drivers/usb/serial/opticon.c | 18 +- drivers/usb/serial/oti6858.c | 30 +--- drivers/usb/serial/pl2303.c | 39 ++--- drivers/usb/serial/quatech2.c | 97 +---------- drivers/usb/serial/sierra.c | 39 ++--- drivers/usb/serial/spcp8x5.c | 301 +++++++++------------------------- drivers/usb/serial/ssu100.c | 100 ++--------- drivers/usb/serial/ti_usb_3410_5052.c | 69 +------- drivers/usb/serial/usb-serial.c | 212 ++++++++++++------------ drivers/usb/serial/usb_wwan.c | 25 ++- drivers/usb/serial/visor.c | 16 +- include/linux/usb/serial.h | 12 +- 35 files changed, 601 insertions(+), 1576 deletions(-) -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html