Skip to content
Commit a8eda9fa authored by Karoly Pados's avatar Karoly Pados Committed by Johan Hovold
Browse files

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: default avatarKaroly Pados <pados@pados.hu>
[ johan: simplify code somewhat ]
Fixes: ba93cc7d ("USB: serial: ftdi_sio: implement GPIO support for FT-X devices")
Cc: stable <stable@vger.kernel.org>	# 4.20
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent b81c2c33
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment