From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755982AbbEFHka (ORCPT ); Wed, 6 May 2015 03:40:30 -0400 Received: from mga02.intel.com ([134.134.136.20]:60921 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbbEFHkZ (ORCPT ); Wed, 6 May 2015 03:40:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,378,1427785200"; d="scan'208";a="705959380" From: Lu Baolu To: Greg Kroah-Hartman , Mathias Nyman , Alan Stern Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 0/3] usb: notify hcd when USB device suspend or resume Date: Wed, 6 May 2015 15:39:59 +0800 Message-Id: <1430898002-24748-1-git-send-email-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series try to meet a design requirement in xHCI spec. The xHCI spec is designed to allow an xHC implementation to cache the endpoint state. Caching endpoint state allows an xHC to reduce latency when handling ERDYs and other USB asynchronous events. However holding this state in xHC consumes resources and power. The xHCI spec designs some methods through which host controller driver can hint xHC about how to optimize its operation, e.g. to determine when it holds state internally or pushes it out to memory, when to power down logic, etc. When a USB device is going to suspend, states of all endpoints cached in the xHC should be pushed out to memory to save power and resources. Vice versa, when a USB device resumes, those states should be brought back to the cache. It is harmless if a USB devices under USB 3.0 host controller suspends or resumes without a notification to hcd driver. However there may be less opportunities for power savings and there may be increased latency for restarting an endpoint. The precise impact will be different for each xHC implementation. It all depends on what an implementation does with the hints. Change log: v1->v2: - make the callback name specific to the activity in question - no need to export hcd_notify - put the callback in the right place Lu Baolu (3): usb: notify hcd when USB device suspend or resume usb: xhci: implement device_suspend/device_resume entries usb: xhci: remove stop device and ring doorbell in hub control and bus suspend drivers/usb/core/hcd.c | 29 +++++++++++++++++++++++++++ drivers/usb/core/hub.c | 16 +++++++++++++++ drivers/usb/host/xhci-hub.c | 49 +-------------------------------------------- drivers/usb/host/xhci.c | 40 ++++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 5 +++++ include/linux/usb/hcd.h | 10 ++++++++- 6 files changed, 100 insertions(+), 49 deletions(-) -- 2.1.0