1. 09 Jun, 2022 1 commit
  2. 26 Aug, 2021 1 commit
  3. 19 May, 2021 2 commits
  4. 13 Apr, 2021 6 commits
  5. 08 Apr, 2021 5 commits
    • Johan Hovold's avatar
      USB: serial: io_ti: switch to 30-second closing wait · 2813b165
      Johan Hovold authored
      
      Switch to using the system-wide default 30-second closing-wait timeout
      instead of the driver specific 40-second timeout.
      
      The timeout can be changed per port using TIOCSSERIAL (setserial) if
      needed.
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      2813b165
    • Johan Hovold's avatar
      USB: serial: io_ti: drop closing_wait module parameter · d669a51d
      Johan Hovold authored
      
      Now that all USB serial drivers supports setting the closing_wait
      parameter through TIOCSSERIAL (setserial) it's time to drop the
      corresponding io_ti module parameter.
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      d669a51d
    • Johan Hovold's avatar
      USB: serial: stop reporting legacy UART types · f64d74a5
      Johan Hovold authored
      
      The TIOCGSERIAL ioctl can be used to set and retrieve the UART type for
      legacy UARTs, but some USB serial drivers have been reporting back
      random types in order to "make user-space happy".
      
      Some applications have historically expected TIOCGSERIAL to be
      implemented, but judging from the Debian sources, the port type not
      being PORT_UNKNOWN is only used to check for the existence of legacy
      serial ports (ttySn).
      
      Drivers like ftdi_sio have been using PORT_UNKNOWN for twenty years (and
      option for 10 years) without anyone complaining so let's stop reporting
      back anything else.
      
      In the unlikely event that this do cause problems, this should be fixed
      tree-wide anyway (e.g. for all USB serial drivers and also CDC-ACM).
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      f64d74a5
    • Johan Hovold's avatar
      USB: serial: add generic support for TIOCSSERIAL · 01fd45f6
      Johan Hovold authored
      
      TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
      serial devices is only useful for setting the close_delay and
      closing_wait parameters.
      
      The closing_wait parameter determines how long to wait for the transfer
      buffers to drain during close and the default timeout of 30 seconds may
      not be sufficient at low line speeds. In other cases, when for example
      flow is stopped, the default timeout may instead be too long.
      
      Add generic support for TIOCSSERIAL and TIOCGSERIAL with handling of the
      three common parameters close_delay, closing_wait and line for the
      benefit of all USB serial drivers while still allowing drivers to
      implement further functionality through the existing callbacks.
      
      This currently includes a few drivers that report their base baud clock
      rate even if that is really only of interest when setting custom
      divisors through the deprecated ASYNC_SPD_CUST interface; an interface
      which only the FTDI driver actually implements.
      
      Some drivers have also been reporting back a fake UART type, something
      which should no longer be needed and will be dropped by a follow-on
      patch.
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      01fd45f6
    • Johan Hovold's avatar
      USB: serial: io_ti: fix TIOCGSERIAL implementation · c2f58d24
      Johan Hovold authored
      
      TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
      serial devices is only useful for setting the close_delay and
      closing_wait parameters.
      
      The port parameter is used to set the I/O port and does not make any
      sense to use for USB serial devices.
      
      The xmit_fifo_size parameter could be used to set the hardware transmit
      fifo size of a legacy UART when it could not be detected, but the
      interface is limited to eight bits and should be left unset when not
      used.
      
      Similarly, baud_base could be used to set the UART base clock when it
      could not be detected but might as well be left unset when it is not
      known.
      
      The close_delay and closing_wait parameters returned by TIOCGSERIAL are
      specified in centiseconds (not jiffies). The driver does not yet support
      changing close_delay, but let's report back the default value actually
      used (0.5 seconds).
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      c2f58d24
  6. 09 Feb, 2021 1 commit
  7. 18 Jan, 2021 2 commits
  8. 13 Oct, 2018 1 commit
  9. 26 Jun, 2018 1 commit
  10. 04 Nov, 2017 2 commits
  11. 15 May, 2017 1 commit
  12. 29 Mar, 2017 1 commit
  13. 28 Mar, 2017 4 commits
  14. 08 Mar, 2017 2 commits
  15. 26 Jan, 2017 1 commit
  16. 04 Jan, 2017 4 commits
    • Johan Hovold's avatar
      USB: serial: io_ti: bind to interface after fw download · e35d6d7c
      Johan Hovold authored
      
      Bind to the interface, but do not register any ports, after having
      downloaded the firmware. The device will still disconnect and
      re-enumerate, but this way we avoid an error messages from being logged
      as part of the process:
      
      io_ti: probe of 1-1.3:1.0 failed with error -5
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      e35d6d7c
    • Johan Hovold's avatar
      USB: serial: io_ti: fix I/O after disconnect · 2330d0a8
      Johan Hovold authored
      Cancel the heartbeat work on driver unbind in order to avoid I/O after
      disconnect in case the port is held open.
      
      Note that the cancel in release() is still needed to stop the heartbeat
      after late probe errors.
      
      Fixes: 26c78daa
      
       ("USB: io_ti: Add heartbeat to keep idle EP/416
      ports from disconnecting")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      2330d0a8
    • Johan Hovold's avatar
      USB: serial: io_ti: fix another NULL-deref at open · 4f9785cc
      Johan Hovold authored
      In case a device is left in "boot-mode" we must not register any port
      devices in order to avoid a NULL-pointer dereference on open due to
      missing endpoints. This could be used by a malicious device to trigger
      an OOPS:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000030
      ...
      [<bf0caa84>] (edge_open [io_ti]) from [<bf0b0118>] (serial_port_activate+0x68/0x98 [usbserial])
      [<bf0b0118>] (serial_port_activate [usbserial]) from [<c0470ca4>] (tty_port_open+0x9c/0xe8)
      [<c0470ca4>] (tty_port_open) from [<bf0b0da0>] (serial_open+0x48/0x6c [usbserial])
      [<bf0b0da0>] (serial_open [usbserial]) from [<c0469178>] (tty_open+0xcc/0x5cc)
      
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      4f9785cc
    • Johan Hovold's avatar
      USB: serial: io_ti: fix NULL-deref at open · a323fefc
      Johan Hovold authored
      Fix NULL-pointer dereference when clearing halt at open should a
      malicious device lack the expected endpoints when in download mode.
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000030
      ...
      [<bf011ed8>] (edge_open [io_ti]) from [<bf000118>] (serial_port_activate+0x68/0x98 [usbserial])
      [<bf000118>] (serial_port_activate [usbserial]) from [<c0470ca4>] (tty_port_open+0x9c/0xe8)
      [<c0470ca4>] (tty_port_open) from [<bf000da0>] (serial_open+0x48/0x6c [usbserial])
      [<bf000da0>] (serial_open [usbserial]) from [<c0469178>] (tty_open+0xcc/0x5cc)
      
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      a323fefc
  17. 11 Nov, 2016 1 commit
  18. 09 Oct, 2015 4 commits