From patchwork Wed Mar 6 10:25:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2224251 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 94792DF23A for ; Wed, 6 Mar 2013 10:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756741Ab3CFK0W (ORCPT ); Wed, 6 Mar 2013 05:26:22 -0500 Received: from mail-pb0-f49.google.com ([209.85.160.49]:63338 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756668Ab3CFK0V (ORCPT ); Wed, 6 Mar 2013 05:26:21 -0500 Received: by mail-pb0-f49.google.com with SMTP id xa12so5775794pbc.22 for ; Wed, 06 Mar 2013 02:26:21 -0800 (PST) X-Received: by 10.68.225.40 with SMTP id rh8mr33951855pbc.137.1362565580908; Wed, 06 Mar 2013 02:26:20 -0800 (PST) Received: from localhost ([183.37.194.87]) by mx.google.com with ESMTPS id ip8sm5060912pbc.39.2013.03.06.02.26.15 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Mar 2013 02:26:20 -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 Subject: [PATCH v1 1/7] USB: adds comment on suspend callback Date: Wed, 6 Mar 2013 18:25:50 +0800 Message-Id: <1362565557-15884-2-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 This patch adds comments on interface driver suspend callback to emphasize that the failure return value is ignored by USB core in system sleep context, so do not try to recover device for this case and let resume/reset_resume callback handle the suspend failure if needed. Signed-off-by: Ming Lei --- include/linux/usb.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/usb.h b/include/linux/usb.h index 4d22d0f..6e66dc4 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -978,7 +978,14 @@ struct usbdrv_wrap { * the "usbfs" filesystem. This lets devices provide ways to * expose information to user space regardless of where they * do (or don't) show up otherwise in the filesystem. - * @suspend: Called when the device is going to be suspended by the system. + * @suspend: Called when the device is going to be suspended by the + * system either from system sleep or runtime suspend context, and + * its failure return value will be ignored in system sleep context, + * so do NOT try to recover device for this case. It is suggested + * the callback always return 0 if resume/reset_resume callback can + * handle system sususpend failure at default, otherwise driver + * need to record the suspend failure and let resume/reset_resume + * handle previous system suspend failure to recover device. * @resume: Called when the device is being resumed by the system. * @reset_resume: Called when the suspended device has been reset instead * of being resumed.