USB: serial: ch341: fix lockup of devices with limited prescaler
authorJohan Hovold <johan@kernel.org>
Thu, 14 May 2020 09:36:45 +0000 (11:36 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 27 May 2020 13:01:05 +0000 (15:01 +0200)
commitc432df155919582a3cefa35a8f86256c830fa9a4
tree840012c25e60d3bded15dfa3050434fd28476bfa
parentc404bf4aa9236cb4d1068e499ae42acf48a6ff97
USB: serial: ch341: fix lockup of devices with limited prescaler

Michael Hanselmann reports that

[a] subset of all CH341 devices stop responding to bulk
transfers, usually after the third byte, when the highest
prescaler bit (0b100) is set. There is one exception, namely a
prescaler of exactly 0b111 (fact=1, ps=3).

Fix this by forcing a lower base clock (fact = 0) whenever needed.

This specifically makes the standard rates 110, 134 and 200 bps work
again with these devices.

Fixes: 35714565089e ("USB: serial: ch341: reimplement line-speed handling")
Cc: stable <stable@vger.kernel.org> # 5.5
Reported-by: Michael Hanselmann <public@hansmi.ch>
Link: https://lore.kernel.org/r/20200514141743.GE25962@localhost
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c