From patchwork Wed Mar 6 10:25:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2224301 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 135A03FCF6 for ; Wed, 6 Mar 2013 10:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756950Ab3CFK1O (ORCPT ); Wed, 6 Mar 2013 05:27:14 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:58775 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756935Ab3CFK1N (ORCPT ); Wed, 6 Mar 2013 05:27:13 -0500 Received: by mail-pb0-f44.google.com with SMTP id wz12so5834794pbc.3 for ; Wed, 06 Mar 2013 02:27:12 -0800 (PST) X-Received: by 10.68.189.234 with SMTP id gl10mr17784927pbc.15.1362565632145; Wed, 06 Mar 2013 02:27:12 -0800 (PST) Received: from localhost ([183.37.194.87]) by mx.google.com with ESMTPS id kb3sm30715075pbc.21.2013.03.06.02.27.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Mar 2013 02:27:11 -0800 (PST) From: Ming Lei To: "David S. Miller" , Greg Kroah-Hartman , Jiri Kosina Cc: Alan Stern , Oliver Neukum , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, Ming Lei , Steve Glendinning Subject: [PATCH v1 6/7] usbnet: smsc75xx: don't recover device if suspend fails in system sleep Date: Wed, 6 Mar 2013 18:25:55 +0800 Message-Id: <1362565557-15884-7-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362565557-15884-1-git-send-email-ming.lei@canonical.com> References: <1362565557-15884-1-git-send-email-ming.lei@canonical.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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. Cc: Steve Glendinning Signed-off-by: Ming Lei --- drivers/net/usb/smsc75xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 9abe517..997a694 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -2011,7 +2011,7 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message) ret = smsc75xx_enter_suspend0(dev); done: - if (ret) + if (ret && PMSG_IS_AUTO(message)) usbnet_resume(intf); return ret; }