USB: usb_wwan: fix potential blocked I/O after resume
authorJohan Hovold <jhovold@gmail.com>
Mon, 26 May 2014 17:23:18 +0000 (19:23 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 Jul 2014 12:33:40 +0000 (13:33 +0100)
commit75a5d8feae868a9b2d84b719fcf4c975c7e02162
tree0f5d7fd16dd35583cc9beb62db43a3b17bcf92fa
parent19306d4c1e27348d989d519d8c30c5fcd1b998ad
USB: usb_wwan: fix potential blocked I/O after resume

commit fb7ad4f93d9f0f7d49beda32f5e7becb94b29a4d upstream.

Keep trying to submit urbs rather than bail out on first read-urb
submission error, which would also prevent I/O for any further ports
from being resumed.

Instead keep an error count, for all types of failed submissions, and
let USB core know that something went wrong.

Also make sure to always clear the suspended flag. Currently a failed
read-urb submission would prevent cached writes as well as any
subsequent writes from being submitted until next suspend-resume cycle,
something which may not even necessarily happen.

Note that USB core currently only logs an error if an interface resume
failed.

Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/usb_wwan.c