summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-03-15 04:08:54 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 17:55:46 (GMT)
commit93e4f47f4d1a3483f009202e8a66a3a08de5c4b6 (patch)
tree5dde1f9ff6ff273d80e1f53677fc5a682dd149f7
parent303f0847925ece27129487a2bfc05199ab2a0b51 (diff)
downloadlinux-93e4f47f4d1a3483f009202e8a66a3a08de5c4b6.tar.xz
USB: serial: comments on suspend failure
If suspend callback fails in system sleep context, usb core will ignore the failure and let system sleep go ahead further, so this patch comments on the case and requires that serial->type->suspend() MUST return 0 in system sleep context. Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/serial/usb-serial.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index bbe7f2e..2fc0500 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1137,6 +1137,11 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
serial->suspending = 1;
+ /*
+ * serial->type->suspend() MUST return 0 in system sleep context,
+ * otherwise, the resume callback has to recover device from
+ * previous suspend failure.
+ */
if (serial->type->suspend) {
r = serial->type->suspend(serial, message);
if (r < 0) {