1. 16 1月, 2017 6 次提交
  2. 11 1月, 2017 1 次提交
    • J
      USB: serial: ch341: fix control-message error handling · 2d5a9c72
      Johan Hovold 提交于
      A short control transfer would currently fail to be detected, something
      which could lead to stale buffer data being used as valid input.
      
      Check for short transfers, and make sure to log any transfer errors.
      
      Note that this also avoids leaking heap data to user space (TIOCMGET)
      and the remote device (break control).
      
      Fixes: 6ce76104 ("USB: Driver for CH341 USB-serial adaptor")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      2d5a9c72
  3. 09 1月, 2017 7 次提交
    • J
      USB: serial: ch341: fix baud rate and line-control handling · 55fa15b5
      Johan Hovold 提交于
      Revert to using direct register writes to set the divisor and
      line-control registers.
      
      A recent change switched to using the init vendor command to update
      these registers, something which also enabled support for CH341A
      devices. It turns out that simply setting bit 7 in the divisor register
      is sufficient to support CH341A and specifically prevent data from being
      buffered until a full endpoint-size packet (32 bytes) has been received.
      
      Using the init command also had the side-effect of temporarily
      deasserting the DTR/RTS signals on every termios change (including
      initialisation on open) something which for example could cause problems
      in setups where DTR is used to trigger a reset.
      
      Fixes: 4e46c410 ("USB: serial: ch341: reinitialize chip on
      reconfiguration")
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      55fa15b5
    • J
      USB: serial: ch341: fix line settings after reset-resume · 3cca8624
      Johan Hovold 提交于
      A recent change added support for modifying the default line-control
      settings, but did not make sure that the modified settings were used as
      part of reconfiguration after a device has been reset during resume.
      
      This caused a port that was open before suspend to be unusable until
      being closed and reopened.
      
      Fixes: ba781bdf ("USB: serial: ch341: add support for parity, frame
      length, stop bits")
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      3cca8624
    • J
      USB: serial: ch341: fix resume after reset · ce5e2928
      Johan Hovold 提交于
      Fix reset-resume handling which failed to resubmit the read and
      interrupt URBs, thereby leaving a port that was open before suspend in a
      broken state until closed and reopened.
      
      Fixes: 1ded7ea4 ("USB: ch341 serial: fix port number changed after
      resume")
      Fixes: 2bfd1c96 ("USB: serial: ch341: remove reset_resume callback")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ce5e2928
    • J
      USB: serial: ch341: fix open error handling · f2950b78
      Johan Hovold 提交于
      Make sure to stop the interrupt URB before returning on errors during
      open.
      
      Fixes: 664d5df9 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f2950b78
    • J
      USB: serial: ch341: fix modem-control and B0 handling · 030ee7ae
      Johan Hovold 提交于
      The modem-control signals are managed by the tty-layer during open and
      should not be asserted prematurely when set_termios is called from
      driver open.
      
      Also make sure that the signals are asserted only when changing speed
      from B0.
      
      Fixes: 664d5df9 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      030ee7ae
    • J
      USB: serial: ch341: fix open and resume after B0 · a20047f3
      Johan Hovold 提交于
      The private baud_rate variable is used to configure the port at open and
      reset-resume and must never be set to (and left at) zero or reset-resume
      and all further open attempts will fail.
      
      Fixes: aa91def4 ("USB: ch341: set tty baud speed according to tty
      struct")
      Fixes: 664d5df9 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      a20047f3
    • J
      USB: serial: ch341: fix initial modem-control state · 4e2da446
      Johan Hovold 提交于
      DTR and RTS will be asserted by the tty-layer when the port is opened
      and deasserted on close (if HUPCL is set). Make sure the initial state
      is not-asserted before the port is first opened as well.
      
      Fixes: 664d5df9 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      4e2da446
  4. 24 10月, 2016 4 次提交
  5. 28 2月, 2016 1 次提交
  6. 02 3月, 2015 1 次提交
    • N
      USB: ch341: set tty baud speed according to tty struct · aa91def4
      Nicolas PLANEL 提交于
      The ch341_set_baudrate() function initialize the device baud speed
      according to the value on priv->baud_rate. By default the ch341_open() set
      it to a hardcoded value (DEFAULT_BAUD_RATE 9600). Unfortunately, the
      tty_struct is not initialized with the same default value. (usually 56700)
      
      This means that the tty_struct and the device baud rate generator are not
      synchronized after opening the port.
      
      Fixup is done by calling ch341_set_termios() if tty exist.
      Remove unnecessary variable priv->baud_rate setup as it's already done by
      ch341_port_probe().
      Remove unnecessary call to ch341_set_{handshake,baudrate}() in
      ch341_open() as there already called in ch341_configure() and
      ch341_set_termios()
      Signed-off-by: NNicolas PLANEL <nicolas.planel@enovance.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      aa91def4
  7. 27 2月, 2015 1 次提交
  8. 13 3月, 2014 1 次提交
  9. 09 1月, 2014 1 次提交
  10. 04 1月, 2014 7 次提交
  11. 26 3月, 2013 2 次提交
  12. 22 3月, 2013 1 次提交
  13. 26 10月, 2012 1 次提交
  14. 18 9月, 2012 2 次提交
  15. 14 9月, 2012 1 次提交
  16. 16 5月, 2012 2 次提交
  17. 09 5月, 2012 1 次提交
    • G
      USB: serial: rework usb_serial_register/deregister_drivers() · 68e24113
      Greg Kroah-Hartman 提交于
      This reworks the usb_serial_register_drivers() and
      usb_serial_deregister_drivers() to not need a pointer to a struct
      usb_driver anymore.  The usb_driver structure is now created dynamically
      and registered and unregistered as needed.
      
      This saves lines of code in each usb-serial driver.  All in-kernel users
      of these functions were also fixed up at this time.  The pl2303 driver
      was tested that everything worked properly.
      
      Thanks for the idea to do this from Alan Stern.
      
      Cc: Adhir Ramjiawan <adhirramjiawan0@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Cc: Aleksey Babahin <tamerlan311@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andrew Worsley <amworsley@gmail.com>
      Cc: Bart Hartgers <bart.hartgers@gmail.com>
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Dan Carpenter <error27@gmail.com>
      Cc: Dan Williams <dcbw@redhat.com>
      Cc: Donald Lee <donald@asix.com.tw>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Gary Brubaker <xavyer@ix.netcom.com>
      Cc: Jesper Juhl <jj@chaosbits.net>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Kautuk Consul <consul.kautuk@gmail.com>
      Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Cc: Lonnie Mendez <dignome@gmail.com>
      Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com>
      Cc: Matthias Urlichs <smurf@smurf.noris.de>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Cc: Michal Sroczynski <msroczyn@gmail.com>
      Cc: "Michał Wróbel" <michal.wrobel@flytronic.pl>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Peter Berger <pberger@brimson.com>
      Cc: Preston Fick <preston.fick@silabs.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Rigbert Hamisch <rigbert@gmx.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Simon Arlott <simon@fire.lp0.eu>
      Cc: Support Department <support@connecttech.com>
      Cc: Thomas Tuttle <ttuttle@chromium.org>
      Cc: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
      Cc: Wang YanQing <Udknight@gmail.com>
      Cc: William Greathouse <wgreathouse@smva.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68e24113