From patchwork Wed May 16 22:45:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarah Sharp X-Patchwork-Id: 159772 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47E33B6FB7 for ; Thu, 17 May 2012 08:45:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932193Ab2EPWpt (ORCPT ); Wed, 16 May 2012 18:45:49 -0400 Received: from mga09.intel.com ([134.134.136.24]:49449 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760718Ab2EPWpm (ORCPT ); Wed, 16 May 2012 18:45:42 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 May 2012 15:45:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="144897506" Received: from xanatos.jf.intel.com (HELO xanatos) ([10.7.201.145]) by orsmga002.jf.intel.com with ESMTP; 16 May 2012 15:45:42 -0700 Date: Wed, 16 May 2012 15:45:26 -0700 From: Sarah Sharp To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Alan Stern , linux-bluetooth@vger.kernel.org, gigaset307x-common@lists.sourceforge.net, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, libertas-dev@lists.infradead.org, users@rt2x00.serialmonkey.com Subject: [RFC 05/13] USB: Allow drivers to disable hub-initiated LPM. Message-ID: <20120516224526.GA25856@xanatos> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org [[Resending with a smaller Cc list] USB 3.0 Link Power Management (LPM) is designed to allow individual links in the bus to go into lower power states. There are two ways a link can enter a lower power state: 1. Device-initiated LPM. When a USB device decides it can go into a lower power link state, it sends a message to the parent hub, telling it to go into either U1 or U2. Device-initiated LPM is good for devices that send data to the host, like communications devices. 2. Hub-initiated LPM. After the link has been idle for a specific amount of time, the parent hub will request that the child go into a lower power state. The child can refuse that request. For example, a USB modem may want to refuse the LPM request if it is in the middle of receiving a text message. Hub-initiated LPM is good for devices where only the host initiates the data transfer, like USB printers or USB mass storage devices. Links will be automatically placed into higher power states by the USB hubs and roothubs whenever the host starts a USB transmission. Introduce a new usb_driver flag, disable_hub_initiated_lpm, that allows drivers to disable hub-initiated LPM. Signed-off-by: Sarah Sharp Cc: Marcel Holtmann Cc: Gustavo Padovan Cc: Johan Hedberg Cc: Hansjoerg Lipp Cc: Tilman Schmidt Cc: Karsten Keil Cc: Oliver Neukum Cc: Peter Korsgaard Cc: Jan Dumon Cc: Petko Manolov Cc: Steve Glendinning Cc: "John W. Linville" Cc: Kalle Valo Cc: "Luis R. Rodriguez" Cc: Jouni Malinen Cc: Vasanthakumar Thiagarajan Cc: Senthil Balasubramanian Cc: Christian Lamparter Cc: Brett Rudley Cc: Roland Vossen Cc: Arend van Spriel Cc: "Franky (Zhenhui) Lin" Cc: Kan Yan Cc: Dan Williams Cc: Jussi Kivilinna Cc: Ivo van Doorn Cc: Gertjan van Wingerde Cc: Helmut Schaa Cc: Herton Ronaldo Krzesinski Cc: Hin-Tak Leung Cc: Larry Finger Cc: Chaoming Li Cc: Daniel Drake Cc: Ulrich Kunitz Cc: linux-bluetooth@vger.kernel.org Cc: gigaset307x-common@lists.sourceforge.net Cc: netdev@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: ath9k-devel@lists.ath9k.org Cc: libertas-dev@lists.infradead.org Cc: users@rt2x00.serialmonkey.com --- include/linux/usb.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/usb.h b/include/linux/usb.h index eb46077..998c276 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -875,6 +875,9 @@ struct usbdrv_wrap { * for interfaces bound to this driver. * @soft_unbind: if set to 1, the USB core will not kill URBs and disable * endpoints before calling the driver's disconnect method. + * @disable_hub_initiated_lpm: if set to 0, the USB core will not allow hubs + * to initiate lower power link state transitions when an idle timeout + * occurs. Device-initiated USB 3.0 link PM will still be allowed. * * USB interface drivers must provide a name, probe() and disconnect() * methods, and an id_table. Other driver fields are optional. @@ -915,6 +918,7 @@ struct usb_driver { struct usbdrv_wrap drvwrap; unsigned int no_dynamic_id:1; unsigned int supports_autosuspend:1; + unsigned int disable_hub_initiated_lpm:1; unsigned int soft_unbind:1; }; #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver)