From patchwork Fri Mar 15 04:08:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2274891 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 1CCBB3FC8A for ; Fri, 15 Mar 2013 04:10:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751457Ab3COEKK (ORCPT ); Fri, 15 Mar 2013 00:10:10 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:55343 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763Ab3COEKJ (ORCPT ); Fri, 15 Mar 2013 00:10:09 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp2so3239962pbb.20 for ; Thu, 14 Mar 2013 21:10:08 -0700 (PDT) X-Received: by 10.68.137.131 with SMTP id qi3mr12435719pbb.47.1363320608642; Thu, 14 Mar 2013 21:10:08 -0700 (PDT) Received: from localhost ([183.37.197.207]) by mx.google.com with ESMTPS id qp13sm6526971pbb.3.2013.03.14.21.10.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Mar 2013 21:10:07 -0700 (PDT) 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 Subject: [PATCH v3 5/7] usbnet: qmi_wwan: comments on suspend failure Date: Fri, 15 Mar 2013 12:08:57 +0800 Message-Id: <1363320539-23012-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363320539-23012-1-git-send-email-ming.lei@canonical.com> References: <1363320539-23012-1-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 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 comments on the case and requires that both usbnet_suspend() and subdriver->suspend() MUST return 0 in system sleep context. Acked-by: David S. Miller Acked-by: Bjørn Mork Signed-off-by: Ming Lei --- drivers/net/usb/qmi_wwan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 968d5d5..bdceb74 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -271,6 +271,11 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message) struct qmi_wwan_state *info = (void *)&dev->data; int ret; + /* + * Both usbnet_suspend() and subdriver->suspend() MUST return 0 + * in system sleep context, otherwise, the resume callback has + * to recover device from previous suspend failure. + */ ret = usbnet_suspend(intf, message); if (ret < 0) goto err;