diff options
author | Karoly Pados <pados@pados.hu> | 2019-01-14 13:30:03 +0100 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2019-01-14 14:40:11 +0100 |
commit | a8eda9fa1bd84065b75bfa81bf675a7af9055478 (patch) | |
tree | 941a79177e89f85bae6de6cf2022df85b9902f88 /drivers/usb/serial/mxuport.c | |
parent | b81c2c33eab79dfd3650293b2227ee5c6036585c (diff) |
USB: serial: ftdi_sio: fix GPIO not working in autosuspend
There is a bug in the current GPIO code for ftdi_sio: it failed to take USB
autosuspend into account. If the device is in autosuspend, calls to
usb_control_msg() fail with -EHOSTUNREACH. Because the standard value for
autosuspend timeout is usually 2-5 seconds, this made it almost impossible
to use the GPIOs on machines that have USB autosuspend enabled. This patch
fixes the issue by acquiring a PM lock on the device for the duration of
the USB transfers. Tested on an FT231X device.
Signed-off-by: Karoly Pados <pados@pados.hu>
[ johan: simplify code somewhat ]
Fixes: ba93cc7da896 ("USB: serial: ftdi_sio: implement GPIO support for FT-X devices")
Cc: stable <stable@vger.kernel.org> # 4.20
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/mxuport.c')
0 files changed, 0 insertions, 0 deletions