1. 31 7月, 2015 1 次提交
    • M
      USB: pl2303: fix baud-rate divisor calculations · 49bda212
      Michał Pecio 提交于
      This commit fixes the following issues:
      
      1. The 9th bit of buf was believed to be the LSB of divisor's
      exponent, but the hardware interprets it as MSB (9th bit) of the
      mantissa. The exponent is actually one bit shorter and applies
      to base 4, not 2 as previously believed.
      
      2. Loop iterations doubled the exponent instead of incrementing.
      
      3. The exponent wasn't checked for overflow.
      
      4. The function returned requested rate instead of actual rate.
      
      Due to issue #2, the old code deviated from the wrong formula
      described in #1 and actually yielded correct rates when divisor
      was lower than 4096 by using exponents of 0, 2 or 4 base-2,
      interpreted as 0, 1, 2 base-4 with the 9th mantissa bit clear.
      However, at 93.75 kbaud or less the rate turned out too slow
      due to #2 or too fast due to #2 and #3.
      
      I tested this patch by sending and validating 0x00,0x01,..,0xff
      to an FTDI dongle at 234, 987, 2401, 9601, 31415, 115199, 250k,
      500k, 750k, 1M, 1.5M, 3M+1 baud. All rates passed.
      
      I also used pv to check speed at some rates unsupported by FTDI:
      45 (the lowest possible), 2M, 4M, 5M and 6M-1. Looked sane.
      Signed-off-by: NMichal Pecio <michal.pecio@gmail.com>
      Fixes: 399aa9a7 ("USB: pl2303: use divisors for unsupported baud
      rates")
      Cc: stable <stable@vger.kernel.org> # v3.18
      [johan: update summary ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      49bda212
  2. 29 4月, 2015 1 次提交
  3. 27 2月, 2015 1 次提交
  4. 01 9月, 2014 1 次提交
  5. 18 8月, 2014 1 次提交
  6. 17 4月, 2014 1 次提交
  7. 09 1月, 2014 1 次提交
  8. 04 1月, 2014 25 次提交
  9. 03 12月, 2013 1 次提交
  10. 02 11月, 2013 7 次提交