From patchwork Fri Mar 15 04:08:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2274861 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2C4DFDF24C for ; Fri, 15 Mar 2013 04:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751057Ab3COEJh (ORCPT ); Fri, 15 Mar 2013 00:09:37 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:32944 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925Ab3COEJg (ORCPT ); Fri, 15 Mar 2013 00:09:36 -0400 Received: by mail-pb0-f54.google.com with SMTP id rr4so3229904pbb.27 for ; Thu, 14 Mar 2013 21:09:35 -0700 (PDT) X-Received: by 10.68.26.234 with SMTP id o10mr12100077pbg.211.1363320575723; Thu, 14 Mar 2013 21:09:35 -0700 (PDT) Received: from localhost ([183.37.197.207]) by mx.google.com with ESMTPS id kb3sm6510929pbc.21.2013.03.14.21.09.29 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Mar 2013 21:09:34 -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 , Johan Hovold Subject: [PATCH v3 2/7] USB: serial: comments on suspend failure Date: Fri, 15 Mar 2013 12:08:54 +0800 Message-Id: <1363320539-23012-3-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> 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 serial->type->suspend() MUST return 0 in system sleep context. Cc: Johan Hovold Signed-off-by: Ming Lei Acked-by: Johan Hovold --- drivers/usb/serial/usb-serial.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index a19ed74..16eb02b 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1140,6 +1140,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) {