[PATCH 000/103] USB: serial/cdc-acm: disconnect-related patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This series against Linus' tree of today (c41b3810c09e) fixes a bunch of
issues related to device disconnect.

As the diffstat shows:

	36 files changed, 602 insertions(+), 1541 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 five more or less critical fixes that should go
in to 3.9-rc.

The second set contains non-critical, but still tagged for stable,
patches which fix the current implementations of TIOCMIWAIT which did
not handle device disconnect (any waiting process had to be
interrupted). This was fixed in ftdi_sio last summer and backported to
stable. I leave it up to you Greg whether this should go in via usb-next
rather than 3.9-rc.

The third set contains various clean-ups and minor fixes.

The fourth set removes legacy disconnect tests which are both broken and
unnecessary.

The fifth 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 sixth 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 in the process. 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. 

The seventh 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 eight 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 cdc-acm, usb-serial,
ftdi_sio and pl2303 ones have been tested on actual hardware.

Johan


Johan Hovold (103):
  USB: cdc-acm: fix device unregistration
  USB: ftdi_sio: fix use after free in TIOCMIWAIT
  USB: garmin_gps: fix memory leak on disconnect
  USB: io_ti: fix get_icount for two port adapters
  USB: serial: fix interface refcounting

  USB: ark3116: fix TIOCMIWAIT and disconnect
  USB: ch341: fix TIOCMIWAIT and disconnect
  USB: cypress_m8: fix TIOCMIWAIT and disconnect
  USB: f81232: fix TIOCMIWAIT and disconnect
  USB: io_edgeport: fix TIOCMIWAIT and disconnect
  USB: io_ti: fix TIOCMIWAIT and disconnect
  USB: mct_u232: fix TIOCMIWAIT and disconnect
  USB: mos7840: fix TIOCMIWAIT and disconnect
  USB: oti6858: fix TIOCMIWAIT and disconnect
  USB: pl2303: fix TIOCMIWAIT and disconnect
  USB: quatech2: fix TIOCMIWAIT and disconnect
  USB: ssu100: fix TIOCMIWAIT and disconnect
  USB: ti_usb_3410_5052: fix TIOCMIWAIT and disconnect

  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: fix usb-serial bus device removal

  USB: serial: add tiocmiwait subdriver operation
  USB: serial: add generic TIOCMIWAIT implementation
  USB: serial: add generic get_icount implementation
  USB: ftdi_sio: use port icount
  USB: ftio_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: cypress_m8: replace custom ioctl operation with tiocmiwait
  USB: f81232: add custom tiocmiwait operation
  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: 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: pl2303: add custom tiocmiwait operation
  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: 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/class/cdc-acm.c           |   3 +-
 drivers/usb/core/urb.c                |   5 +-
 drivers/usb/serial/ark3116.c          |  85 ++--------
 drivers/usb/serial/bus.c              |   5 +-
 drivers/usb/serial/ch341.c            |  31 +---
 drivers/usb/serial/cp210x.c           |   6 +-
 drivers/usb/serial/cyberjack.c        |  19 +--
 drivers/usb/serial/cypress_m8.c       |  88 ++++------
 drivers/usb/serial/digi_acceleport.c  |  92 +++++------
 drivers/usb/serial/f81232.c           |  14 +-
 drivers/usb/serial/ftdi_sio.c         | 124 ++------------
 drivers/usb/serial/garmin_gps.c       |  17 +-
 drivers/usb/serial/generic.c          | 131 ++++++++++-----
 drivers/usb/serial/io_edgeport.c      |  74 +--------
 drivers/usb/serial/io_tables.h        |  12 +-
 drivers/usb/serial/io_ti.c            |  83 ++--------
 drivers/usb/serial/iuu_phoenix.c      |  19 +--
 drivers/usb/serial/keyspan.c          |  26 +--
 drivers/usb/serial/keyspan_pda.c      |  19 +--
 drivers/usb/serial/kl5kusb105.c       |  16 +-
 drivers/usb/serial/mct_u232.c         |  93 +----------
 drivers/usb/serial/metro-usb.c        |   5 +-
 drivers/usb/serial/mos7720.c          |  68 +-------
 drivers/usb/serial/mos7840.c          | 152 +++--------------
 drivers/usb/serial/opticon.c          |  18 +-
 drivers/usb/serial/oti6858.c          |  33 ++--
 drivers/usb/serial/pl2303.c           |  37 ++---
 drivers/usb/serial/quatech2.c         |  95 +----------
 drivers/usb/serial/sierra.c           |  39 ++---
 drivers/usb/serial/spcp8x5.c          | 300 +++++++++-------------------------
 drivers/usb/serial/ssu100.c           |  98 ++---------
 drivers/usb/serial/ti_usb_3410_5052.c |  67 +-------
 drivers/usb/serial/usb-serial.c       | 216 ++++++++++++------------
 drivers/usb/serial/usb_wwan.c         |  25 ++-
 drivers/usb/serial/visor.c            |  16 +-
 include/linux/usb/serial.h            |  12 +-
 36 files changed, 602 insertions(+), 1541 deletions(-)

-- 
1.8.1.1

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux