From 0d41be53f0a65c52f3099d9a4b4fa6e1bca07be8 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Fri, 15 Mar 2013 12:08:58 +0800 Subject: usbnet: smsc95xx: don't recover device if suspend fails in system sleep If suspend callback fails in system sleep context, usb core will ignore the failure and let system sleep go ahead further, so this patch doesn't recover device under this situation. Also add comments on the case. Acked-by: David S. Miller Cc: Steve Glendinning Signed-off-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/smsc95xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/net') diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index e6d2dea1373c..3f38ba868f61 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1660,7 +1660,11 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) ret = smsc95xx_enter_suspend0(dev); done: - if (ret) + /* + * TODO: resume() might need to handle the suspend failure + * in system sleep + */ + if (ret && PMSG_IS_AUTO(message)) usbnet_resume(intf); return ret; } -- cgit v1.2.1