summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* USB: iuu_phoenix: remove unused MSR-wait queueJohan Hovold2013-03-251-2/+0
| | | | | | | | | Remove unused, private modem-status wait queue from driver. If TIOCMIWAIT is ever implemented it must not rely on a private wait queue which may have been released when woken up. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: io_ti: switch to generic TIOCMIWAIT implementationJohan Hovold2013-03-251-30/+4
| | | | | | | | | | | Switch to the generic TIOCMIWAIT implementation which does not suffer from the races involved when using the deprecated sleep_on functions. This also fixes the issue with processes waiting for modem-status-changes not being woken up at disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: io_ti: switch to generic get_icount implementationJohan Hovold2013-03-251-32/+8
| | | | | | | | | | Switch to the generic get_icount implementation. Note that the interrupt counters will no longer be reset at open which is in accordance with which how the other drivers work. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: io_edgeport: switch to generic TIOCMIWAIT implementationJohan Hovold2013-03-252-34/+5
| | | | | | | | | | Switch to the generic TIOCMIWAIT implementation. This also fixes the issue with processes waiting for modem-status-changes not being woken up at disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: io_edgeport: switch to generic get_icount implementationJohan Hovold2013-03-252-42/+11
| | | | | | | | | | Switch to the generic get_icount implementation. Note that the interrupt counters will no longer be reset at open which is in accordance with which how the other drivers work. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: f81232: fix TIOCMIWAIT and disconnectJohan Hovold2013-03-251-2/+2
| | | | | | | | | | | Use tty-port modem-status-change wait queue on which processes are woken up at hangup and disconnect. Currently a process waiting on modem-status changes will not be woken on device disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: f81232: add custom tiocmiwait operationJohan Hovold2013-03-251-6/+3
| | | | | | | | Break out TIOCMIWAIT handling from custom ioctl operation and use tiocmiwait operation field instead. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: digi_acceleport: remove unused MSR-wait queueJohan Hovold2013-03-251-3/+0
| | | | | | | | | Remove unused, private modem-status wait queue from driver. If TIOCMIWAIT is ever implemented it must not rely on a private wait queue which may have been released when woken up. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: cypress_m8: fix TIOCMIWAIT and disconnectJohan Hovold2013-03-251-2/+2
| | | | | | | | | | | Use tty-port modem-status-change wait queue on which processes are woken up at hangup and disconnect. Currently a process waiting on modem-status changes will not be woken on device disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: cypress_m8: replace custom ioctl operation with tiocmiwaitJohan Hovold2013-03-251-49/+36
| | | | | | | Replace custom ioctl operation with tiocmiwait. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ch341: fix TIOCMIWAIT and disconnectJohan Hovold2013-03-251-3/+2
| | | | | | | | | | | | | | Use tty-port modem-status-change wait queue on which processes are woken up at hangup and disconnect. Currently a process waiting on modem-status changes will not be woken on device disconnect as wake up was only done in dtr_rts which isn't guaranteed to be called (e.g. if HUPCL is not set). Also remove the redundant wake-up call from dtr_rts. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ch341: replace custom ioctl operation with tiocmiwaitJohan Hovold2013-03-251-22/+3
| | | | | | | Replace custom ioctl operation with tiocmiwait. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ark3116: switch to generic TIOCMIWAIT implementationJohan Hovold2013-03-251-28/+2
| | | | | | | | | | | Switch to the generic TIOCMIWAIT implementation which does not suffer from the races involved when using the deprecated sleep_on functions. This also fixes the issue with processes waiting for modem-status-changes not being woken up at disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ark3116: switch to generic get_icount implementationJohan Hovold2013-03-251-40/+18
| | | | | | | Switch to the generic get_icount implementation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ftdi_sio: switch to generic get_icount implementationJohan Hovold2013-03-251-23/+1
| | | | | | | Switch to the generic get_icount implementation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ftdi_sio: switch to generic TIOCMIWAIT implementationJohan Hovold2013-03-251-34/+2
| | | | | | | | Switch to the generic TIOCMIWAIT implementation which does not suffer from the races involved when using the deprecated sleep_on functions. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ftdi_sio: use port icountJohan Hovold2013-03-251-17/+14
| | | | | | | Use the port-data icount for interrupt counters. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: add generic get_icount implementationJohan Hovold2013-03-252-0/+29
| | | | | | | | Add generic get_icount implementation that subdrivers relying on the port interrupt counters can use. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: wake up MSR-wait queue on disconnectJohan Hovold2013-03-251-0/+1
| | | | | | | | | | | | | | | | | | Make sure processes waiting for modem-status changes are woken up at disconnect. This is needed for custom subdriver TIOCMIWAIT-implementations which do not yet handle hangup. Even though processes on the tty-port wait queue are woken up at hangup the wake-up call in usb-serial disconnect is still needed if a woken-up process may go back to sleep (e.g. due to an incomplete TIOCMIWAIT-implementation). If a disconnect occurs after a hangup, any process waiting for changes will not be woken up a second time by the tty-layer as the port will then have been disassociated from the tty. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: add generic TIOCMIWAIT implementationJohan Hovold2013-03-252-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | Add generic TIOCMIWAIT implementation which correctly handles hangup, USB-device disconnect, does not rely on the deprecated sleep_on functions and hence does not suffer from the races currently affecting several usb-serial drivers. This makes it much easier to add TIOCMIWAIT support to subdrivers as the tricky details related to hangup and disconnect (e.g. atomicity, that the private port data may have been freed when woken up, and waking up processes at disconnect) have been handled once and for all. To add support to a subdriver, simply set the tiocmiwait-port-operation field, update the port icount fields and wake up any process sleeping on the tty-port modem-status-change wait queue on changes. Note that the tty-port initialised flag can be used to detect disconnected as the port will be hung up as part of disconnect (and cannot be reactivated due to the disconnected flag). However, as the tty-port implementation currently wakes up processes before calling port shutdown, the tty-hupping flag must also be checked to detect hangup for now. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: add tiocmiwait subdriver operationJohan Hovold2013-03-252-4/+12
| | | | | | | Add tiocmiwait operation to struct usb_serial_driver. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: clean up usb-serial bus device removalJohan Hovold2013-03-251-2/+3
| | | | | | | | | | | | | | | | | | Make sure to unregister the tty-device before calling subdriver port_remove. This way remove will reverse probe, and specifically any port data released in port_remove will be available throughout tty unregister. Note that the order currently does not matter as the tty-layer can make callbacks also after the device has been unregistered. This is handled in usb-serial core using the disconnected flag, which is already set when usb-serial bus device remove is called. Cc: Peter Hurley <peter@hurleysoftware.com> Reported-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: use urb poison to reliably kill trafficJohan Hovold2013-03-251-18/+37
| | | | | | | | | | Use usb_poison_urb to reliably kill all urbs on disconnect and suspend. This way there will be no question that the urbs cannot be resubmitted by buggy subdrivers. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: fix urb-poison imbalanceJohan Hovold2013-03-251-1/+4
| | | | | | | | | | | | | | | | The calls to usb_poison_urb and usb_unpoison_urb are expected to be balanced. However, if an urb that has not yet been submitted is poisoned, its reject counter will not be increased as its ep-field is NULL. A consecutive call to unpoison will thus in fact poison the urb as its reject counter will be decremented to a negative value, effectively preventing the urb from being submitted. Note that there are currently no in-kernel drivers affected by this. Cc: Alan Stern <stern@rowland.harvard.edu> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: rename port releaseJohan Hovold2013-03-251-2/+2
| | | | | | | | Rename port_release so that all usb_serial_port functions have a common prefix. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: fix port releaseJohan Hovold2013-03-251-7/+0
| | | | | | | | | We should not call kill_traffic (and usb_kill_urb) once disconnect returns. Any pending urbs are killed at disconnect and new submissions are prevented by usb_unbind_interface (and usb_disable_interface). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: cyberjack: fix disconnect handlingJohan Hovold2013-03-251-10/+2
| | | | | | | | | | | | | Make sure the interrupt urb submitted in port_probe is killed in port_remove. The interrupt-urb completion handler references the port and may get called after port_remove has returned and the port has been unregistered (although this is currently prevented by usb-serial core as we are using a non-private urb). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: clean up generic-operation handlingJohan Hovold2013-03-251-6/+6
| | | | | | | | | | | | | | Most USB serial drivers are, and should be, using as much of the generic implementation as possible. Rename the fixup_generic function to a more descriptive name. Reword the related debug message in a more neutral tone (and remember to add the missing newline). Finally, move the operations initialisation to after the initial sanity checks. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove generic release callbackJohan Hovold2013-03-253-8/+1
| | | | | | | | Remove empty generic release implementation and make the release callback non-mandatory (like attach, probe and disconnect). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove generic disconnect callbackJohan Hovold2013-03-253-9/+2
| | | | | | | | Remove the now empty generic disconnect callback and make the disconnect callback non-mandatory. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: fix generic disconnect implementationJohan Hovold2013-03-251-11/+1
| | | | | | | | | There is no need for the generic disconnect callback to stop the read and write urbs a second time as this has already been taken care of by close (which is called from hangup as part of disconnect). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ssu100: remove custom close operationJohan Hovold2013-03-251-6/+0
| | | | | | | | The generic close operation will be used if the close field is left uninitialised. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ssu100: remove explicit initialisation of disconnectJohan Hovold2013-03-251-1/+0
| | | | | | | | The disconnect callback is set to the generic implementation by usb-serial core if NULL. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove bogus disconnect test in cleanupJohan Hovold2013-03-251-14/+10
| | | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in cleanup. The device is never cleared, and cleanup is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: usb_wwan: remove bogus disconnect test in closeJohan Hovold2013-03-251-13/+12
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: sierra: remove bogus disconnect test in closeJohan Hovold2013-03-251-22/+17
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: mos7840: remove bogus disconnect test in closeJohan Hovold2013-03-251-22/+6
| | | | | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Simplify urb killing, and remove some related debug and dead code while at it. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: keyspan_pda: remove bogus disconnect test in closeJohan Hovold2013-03-251-7/+2
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: keyspan_pda: remove bogus disconnect test from dtr_rtsJohan Hovold2013-03-251-6/+4
| | | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in dtr_rts. The device is never cleared, and disconnect is handled for dtr_rts in usb-serial core anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: keyspan: remove bogus disconnect test in closeJohan Hovold2013-03-251-19/+7
| | | | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Remove some out-commented bogus code while at it. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: iuu_phoenix: remove bogus disconnect test in closeJohan Hovold2013-03-251-8/+5
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: digi_acceleport: remove bogus disconnect test in closeJohan Hovold2013-03-251-47/+45
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: cyberjack: remove bogus disconnect test in closeJohan Hovold2013-03-251-5/+2
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ark3116: remove bogus disconnect test in closeJohan Hovold2013-03-251-10/+7
| | | | | | | | | | Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove port number from generic-driver debugJohan Hovold2013-03-251-6/+4
| | | | | | | | Remove redundant port number from debug output (already printed as part of device name). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove redundant allocation error messagesJohan Hovold2013-03-251-28/+9
| | | | | | | Failed allocations already get an OOM message and a stack dump. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: clean up debug infoJohan Hovold2013-03-251-19/+20
| | | | | | | | Remove redundant port number from debug output (already printed as part of device name). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: remove redundant commentsJohan Hovold2013-03-251-15/+5
| | | | | | | Remove redundant comments and fix some minor coding style issues. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: serial: rename tty-port callbacksJohan Hovold2013-03-251-9/+9
| | | | | | | | | | Rename the tty-port callbacks using a common prefix to more clearly separate them from the tty and usb driver callbacks. Rename serial_down to serial_port_shutdown to match the callback name. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: pl2303: make set_control_lines a port operationJohan Hovold2013-03-251-5/+6
| | | | | | | | Pass usb-serial port rather than usb device to set_control_lines, and make sure port device is used for all port related debugging. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud