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)
committerJiri Slaby <jslaby@suse.cz>
Wed, 2 Jul 2014 10:06:20 +0000 (12:06 +0200)
commit7a797aa04fca5d0c37cd10058770f98aa3e83c24
tree337a06b6f205bbb45abbede6a619fe3238696334
parentbfd75a498e07ea25e891b94a82e2cb216b19c01c
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: Jiri Slaby <jslaby@suse.cz>
drivers/usb/serial/usb_wwan.c