1. 13 3月, 2017 3 次提交
    • I
      USB: serial: ftdi_sio: only allow valid latency timer values · db924066
      Ian Abbott 提交于
      Valid latency timer values are between 1 ms and 255 ms in 1 ms steps.
      The store function for the "latency_timer" device attribute currently
      allows any value, although only the lower 16 bits will be sent to the
      device, and the device only stores the lower 8 bits.  The hardware
      appears to accept the (invalid) value 0 and treats it the same as 1
      (resulting in a latency of 1 ms).
      
      Change the latency_timer_store() function to accept only the values 0 to
      255, returning an error -EINVAL for out-of-range values.  Call
      kstrtou8() to parse the integer instead of the obsolete
      simple_strtoul().
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      db924066
    • I
      USB: serial: ftdi_sio: detect BM chip with iSerialNumber bug · 7e1e6ced
      Ian Abbott 提交于
      If a BM type chip has iSerialNumber set to 0 in its EEPROM, an incorrect
      value is read from the bcdDevice field of the USB descriptor, making it
      look like an AM type chip.  Attempt to correct this in
      ftdi_determine_type() by attempting to read the latency timer for an AM
      type chip if it has iSerialNumber set to 0.  If that succeeds, assume it
      is a BM type chip.
      
      Currently, read_latency_timer() bails out without reading the latency
      timer for an AM type chip, so factor out the guts of
      read_latency_timer() into a new function _read_latency_timer() that
      attempts to read the latency timer regardless of chip type, and returns
      either the latency timer value or a negative error number.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      7e1e6ced
    • I
      USB: serial: ftdi_sio: don't access latency timer on old chips · 2dea7cd7
      Ian Abbott 提交于
      The latency timer was introduced with the FT232BM and FT245BM chips.  Do
      not bother attempting to read or write it for older chip versions.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      2dea7cd7
  2. 07 2月, 2017 1 次提交
    • J
      USB: serial: ftdi_sio: fix line-status over-reporting · a6bb1e17
      Johan Hovold 提交于
      FTDI devices use a receive latency timer to periodically empty the
      receive buffer and report modem and line status (also when the buffer is
      empty).
      
      When a break or error condition is detected the corresponding status
      flags will be set on a packet with nonzero data payload and the flags
      are not updated until the break is over or further characters are
      received.
      
      In order to avoid over-reporting break and error conditions, these flags
      must therefore only be processed for packets with payload.
      
      This specifically fixes the case where after an overrun, the error
      condition is continuously reported and NULL-characters inserted until
      further data is received.
      Reported-by: NMichael Walle <michael@walle.cc>
      Fixes: 72fda3ca ("USB: serial: ftd_sio: implement sysrq handling on
      break")
      Fixes: 166ceb69 ("USB: ftdi_sio: clean up line-status handling")
      Cc: stable <stable@vger.kernel.org>	# v2.6.35
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      a6bb1e17
  3. 26 1月, 2017 1 次提交
  4. 25 1月, 2017 1 次提交
    • J
      USB: serial: ftdi_sio: fix extreme low-latency setting · c6dce262
      Johan Hovold 提交于
      Since commit 557aaa7f ("ft232: support the ASYNC_LOW_LATENCY
      flag") the FTDI driver has been using a receive latency-timer value of
      1 ms instead of the device default of 16 ms.
      
      The latency timer is used to periodically empty a non-full receive
      buffer, but a status header is always sent when the timer expires
      including when the buffer is empty. This means that a two-byte bulk
      message is received every millisecond also for an otherwise idle port as
      long as it is open.
      
      Let's restore the pre-2009 behaviour which reduces the rate of the
      status messages to 1/16th (e.g. interrupt frequency drops from 1 kHz to
      62.5 Hz) by not setting ASYNC_LOW_LATENCY by default.
      
      Anyone willing to pay the price for the minimum-latency behaviour should
      set the flag explicitly instead using the TIOCSSERIAL ioctl or a tool
      such as setserial (e.g. setserial /dev/ttyUSB0 low_latency).
      
      Note that since commit 0cbd81a9 ("USB: ftdi_sio: remove
      tty->low_latency") the ASYNC_LOW_LATENCY flag has no other effects but
      to set a minimal latency timer.
      Reported-by: NAntoine Aubert <a.aubert@overkiz.com>
      Fixes: 557aaa7f ("ft232: support the ASYNC_LOW_LATENCY flag")
      Cc: stable@vger.kernel.org # v2.6.31: e3e574adSigned-off-by: NJohan Hovold <johan@kernel.org>
      c6dce262
  5. 16 1月, 2017 2 次提交
  6. 12 11月, 2016 1 次提交
  7. 07 11月, 2016 1 次提交
  8. 17 10月, 2016 1 次提交
  9. 08 8月, 2016 2 次提交
  10. 25 4月, 2016 1 次提交
  11. 07 4月, 2016 1 次提交
  12. 28 2月, 2016 1 次提交
  13. 25 1月, 2016 1 次提交
  14. 19 8月, 2015 1 次提交
  15. 21 5月, 2015 1 次提交
  16. 25 3月, 2015 1 次提交
  17. 16 3月, 2015 1 次提交
  18. 03 3月, 2015 1 次提交
  19. 27 2月, 2015 1 次提交
  20. 19 11月, 2014 1 次提交
  21. 23 10月, 2014 1 次提交
  22. 22 10月, 2014 1 次提交
  23. 09 9月, 2014 1 次提交
  24. 01 9月, 2014 1 次提交
  25. 18 8月, 2014 2 次提交
  26. 02 8月, 2014 1 次提交
  27. 12 7月, 2014 1 次提交
  28. 10 7月, 2014 1 次提交
  29. 07 7月, 2014 4 次提交
  30. 23 6月, 2014 1 次提交
  31. 28 5月, 2014 1 次提交
  32. 17 4月, 2014 1 次提交