From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ming Lei Subject: [PATCH 2/7] USB: serial: handle suspend failure path correctly Date: Tue, 5 Mar 2013 12:01:38 +0800 Message-ID: <1362456103-24956-3-git-send-email-ming.lei@canonical.com> References: <1362456103-24956-1-git-send-email-ming.lei@canonical.com> Return-path: In-Reply-To: <1362456103-24956-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "David S. Miller" , Greg Kroah-Hartman , Jiri Kosina Cc: Alan Stern , Oliver Neukum , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ming Lei , Johan Hovold List-Id: linux-input@vger.kernel.org This patch kills traffic even though type->suspend returns failure inside usb_serial_suspend from system sleep context because USB core ignores the failiure and lets system sleep go ahread, so the serial URB traffic need to be killed in this case. Cc: Johan Hovold Signed-off-by: Ming Lei --- drivers/usb/serial/usb-serial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index a19ed74..04ad3d5 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1144,7 +1144,8 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message) r = serial->type->suspend(serial, message); if (r < 0) { serial->suspending = 0; - goto err_out; + if (PMSG_IS_AUTO(msg)) + goto err_out; } } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html