[Feature] USB2.0 Port power off mechanism

Bug #1011415 reported by Yingying Zhao
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
intel
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Raring
Fix Released
Medium
Tim Gardner
Saucy
Fix Released
Undecided
Unassigned

Bug Description

This is an Intel-specific feature. When a USB port is powered off, VBUS is
removed, and port events are lost (device connect & disconnect, remote wake
from USB device suspend, and overcurrent events). OEMs may power-gang several
ports together, so VBUS may not be removed until several ports are powered off.

Related branches

Revision history for this message
Yingying Zhao (yingying-zhao) wrote :

Upstream Schedule: target 3.6

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

At a minimum we are targeting the v3.5 kernel for the Quantal 12.10 release. However, we are considering the v3.6 kernel should the opportunity present itself (ie our release schedules align). Given the patches for this feature are targeting the v3.6 kernel, lets continue to track this and we can consider the possibility of cherry-picking patches should we need to.

Changed in linux (Ubuntu):
assignee: nobody → Leann Ogasawara (leannogasawara)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Yingying Zhao (yingying-zhao) wrote :

Latest update from Sarah: The HSW USB port power off mechanism has been delayed to 3.7.

Revision history for this message
Yingying Zhao (yingying-zhao) wrote :

The V4 patchset has been sent to LKML:
http://marc.info/?l=linux-usb&m=135790632712000&w=2

Revision history for this message
Yingying Zhao (yingying-zhao) wrote :

Add more description from Sarah about this feature:

This is an Intel-specific feature. When a USB port is powered off, VBUS is
removed, and port events are lost (device connect & disconnect, remote wake
from USB device suspend, and overcurrent events). OEMs may power-gang several
ports together, so VBUS may not be removed until several ports are powered off.

The main use case is to be able to power off internal USB ports that are empty,
or have USB devices that are in USB device suspend (U3) without remote wakeup
enabled. For example, a suspended webcam may not have remote wakeup enabled,
but a USB 3G modem might have remote wake enabled. If BIOS writers have done
their job right, we should be able to find out via ACPI tables which USB ports
are external and which are internal (marked as "no physical disconnect").

Another use case is to power down external ports when the user is not
interacting with the system. This would be useful for someone who has a HSW
Ultrabook, who is on a plane, trying to get the very most out of their battery.
 Gnome, KDE, or XFCE could provide a checkbox in the display power savings
settings that says "Power off USB ports on screen blank". The kernel will
provide a sysfs file to mark each port as needing to be powered off, and
userspace should write to those files when that option is selected.

The USB port power off mechanism is probably not useful on servers, since BMC
devices may disconnect and connect on internal USB ports, and a blank screen is
not necessarily indicative of an inactive user. Plus, the ports will not save
that much power.

The ACPI patches are being pushed upstream by Tianyu Lan. Tianyu is also
working on the port power off policy sysfs interface.

Revision history for this message
Yingying Zhao (yingying-zhao) wrote :

Most of usb port auto power off patchset has been merged into v3.9:

3b2ab2b Lan Tianyu Revert "usb: Register usb port's acpi power resources"
192fef1 Lan Tianyu usb: enable usb port device's async suspend.
f6cced1 Lan Tianyu usb: expose usb port's pm qos flags to user space
ad493e5 Lan Tianyu usb: add usb port auto power off mechanism
971fcd4 Lan Tianyu usb: add runtime pm support for usb port device
6802771 Lan Tianyu PM/Qos: Expose dev_pm_qos_flags symbol
88bb965 Lan Tianyu usb: Register usb port's acpi power resources
54a3ac0 Lan Tianyu usb: Using correct way to clear usb3.0 device's remote wakeup feature.
d2123fd Lan Tianyu USB: Set usb port's DeviceRemovable according acpi information
fde2638 Lan Tianyu usb: Create link files between child device and usb port device.
cef7468 Lan Tianyu usb: Add "portX/connect_type" attribute to expose usb port's connect type
9f7344f Lan Tianyu usb: fix compilation error and warning of driver/usb/core/port.c on arm and blackfin
6e30d7c Lan Tianyu usb: Add driver/usb/core/(port.c,hub.h) files

The patches of USB3.0 root hub port bind with ACPI is on the way to upstream:
http://marc.info/?l=linux-usb&m=135908109201612&w=2
       http://marc.info/?l=linux-usb&m=135908109401614&w=2

tags: added: hsw-ult usb
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu):
assignee: Leann Ogasawara (leannogasawara) → Tim Gardner (timg-tpi)
Tim Gardner (timg-tpi)
information type: Private → Public
Revision history for this message
Tim Gardner (timg-tpi) wrote :

I applied all USB driver core commits since v3.8

0fe51aa5eee51db7c7ecd201d42a977ad79c58b6 USB: Don't use EHCI port sempahore for USB 3.0 hubs.
2d4fa940f99663c82ba55b2244638833b388e4e2 USB: Prepare for refactoring by adding extra udev checks.
a24a6078754f28528bc91e7e7b3e6ae86bd936d8 USB: Rip out recursive call on warm port reset.
d3b9d7a9051d7024a93c76a84b2f84b3b66ad6d5 USB: Fix connected device switch to Inactive state.
c2f60db740f2935a5e8a348298b590f2462e952f USB: Use helper function hub_set_port_link_state
470f0be8aa78034030d3e05580e85ba7d0e26da7 USB: Refactor hub_port_wait_reset.
8d8479db3dde3ef7a9bc803e565842764fa21a53 usb/core: consider link speed while looking at bMaxPower
430ee58e03f1ed9c2a2b697e2f2e0bb870ce1a23 usb/core: update power budget for SuperSpeed
6e30d7cba992d626c9d16b3873a7b90c700d0e95 usb: Add driver/usb/core/(port.c,hub.h) files
9f7344fbaf191de63df315c7e0fa4c976e2ea419 usb: fix compilation error and warning of driver/usb/core/port.c on arm and blackfin
cef7468caff29d3333fba4d0ececd82063ce80d5 usb: Add "portX/connect_type" attribute to expose usb port's connect type
fde26380315d7d57816efc143b7924c82dba764d usb: Create link files between child device and usb port device.
d2123fd9e1a56b8006986ed37e0aaf93ef0dd978 USB: Set usb port's DeviceRemovable according acpi information
bdb6bc06f7d694652c12fb8779bb031c2f220823 USB: fix sign-extension bug in the hub driver
88bb965ed711e8a5984e70208ebc901a6ff4141f usb: Register usb port's acpi power resources
971fcd492cebf544714f12d94549d2f0d2002645 usb: add runtime pm support for usb port device
ad493e5e580546e6c3024b76a41535476da1546a usb: add usb port auto power off mechanism
f6cced1a08b475c5ac946823bb057714be7af4f6 usb: expose usb port's pm qos flags to user space
192fef18d0f5ac9a05a93ff6314fc9865c10fbf9 usb: enable usb port device's async suspend.
3b2ab2b84c68fb92accbc735927bc8221e4de973 Revert "usb: Register usb port's acpi power resources"

Changed in linux (Ubuntu Raring):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.8.0-10.19

---------------
linux (3.8.0-10.19) raring; urgency=low

  [ Andy Whitcroft ]

  * [Config] annotate CONFIG_PATA_ACPI

  [ Tim Gardner ]

  * rebase to v3.8.2

  [ Upstream Kernel Changes ]

  * NFC: Fixed nfc core and hci unregistration and cleanup
    - LP: #1083994
  * NFC: Added error handling in event_received hci ops
    - LP: #1083994
  * NFC: Changed event_received hci ops result semantic
    - LP: #1083994
  * NFC: Fixed skb leak in tm_send() nfc and hci ops implementations
    - LP: #1083994
  * NFC: Add HCI quirks to support driver (non)standard implementations
    - LP: #1083994
  * USB: Don't use EHCI port sempahore for USB 3.0 hubs.
    - LP: #1011415
  * USB: Prepare for refactoring by adding extra udev checks.
    - LP: #1011415
  * USB: Rip out recursive call on warm port reset.
    - LP: #1011415
  * USB: Fix connected device switch to Inactive state.
    - LP: #1011415
  * USB: Use helper function hub_set_port_link_state
    - LP: #1011415
  * USB: Refactor hub_port_wait_reset.
    - LP: #1011415
  * usb/core: consider link speed while looking at bMaxPower
    - LP: #1011415
  * usb/core: update power budget for SuperSpeed
    - LP: #1011415
  * usb: Add driver/usb/core/(port.c,hub.h) files
    - LP: #1011415
  * usb: fix compilation error and warning of driver/usb/core/port.c on arm
    and blackfin
    - LP: #1011415
  * usb: Add "portX/connect_type" attribute to expose usb port's connect
    type
    - LP: #1011415
  * usb: Create link files between child device and usb port device.
    - LP: #1011415
  * USB: Set usb port's DeviceRemovable according acpi information
    - LP: #1011415
  * USB: fix sign-extension bug in the hub driver
    - LP: #1011415
  * usb: add runtime pm support for usb port device
    - LP: #1011415
  * usb: add usb port auto power off mechanism
    - LP: #1011415
  * usb: expose usb port's pm qos flags to user space
    - LP: #1011415
  * usb: enable usb port device's async suspend.
    - LP: #1011415
  * drm: add prime helpers
    - LP: #1138440
  * drm/nouveau: use prime helpers
    - LP: #1138440
  * drm/radeon: use prime helpers
    - LP: #1138440

  [ Upstream Kernel Changes ]

  * rebase to v3.8.2
    - LP: #961286

  [Tim Gardner]

  * Release Tracking Bug
    - LP: #1144449
 -- Tim Gardner <email address hidden> Fri, 01 Mar 2013 07:10:07 -0700

Changed in linux (Ubuntu Raring):
status: Fix Committed → Fix Released
tags: added: haswell-ult
removed: hsw-ult
Revision history for this message
XiongZhang (xiong-y-zhang) wrote :

 Several patches are still on the way to upstream, I will paste it after it is merged into upstream.

Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote : Re: [Feature] USB3 Port power off mechanism

Add a Saucy nomination as Intel informs me there are a few additional patches to pull in for Saucy.

Changed in linux (Ubuntu Saucy):
assignee: Tim Gardner (timg-tpi) → nobody
importance: Medium → Undecided
status: Fix Released → New
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1011415

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Leann Ogasawara (leannogasawara) wrote : Re: [Feature] USB3 Port power off mechanism

Marking this Fix Released for Saucy. Per my notes from a call with Intel, the remaining patches needed for Saucy should have already landed in the v3.9 kernel.

Changed in linux (Ubuntu Saucy):
status: Incomplete → Fix Released
Changed in intel:
status: New → Fix Released
Revision history for this message
XiongZhang (xiong-y-zhang) wrote :

From Tian Yu (intel designer):
I have some fix and improvement patches under internal review

So we need to wait his patch to upstream.

Changed in intel:
status: Fix Released → New
Revision history for this message
XiongZhang (xiong-y-zhang) wrote :

the following three commits will be in kernel 3.12 and are marked for stable for bug fixing this feature, please backport it to raring and saucy kernel.

These are currently in Greg KH's usb-next tree (queued for 3.12), and are marked for stable:

commit aa5ceae24bf8dff1d6fe87c6c4b08e69c6d33550 "USB: handle LPM errors during
device suspend correctly"
commit 98a4f1ff7bea8002ab79d6776e30d27932e88244 "usb: don't check pm qos
NO_POWER_OFF flag in usb_port_suspend()"
commit d49dad3e11638f66be4e16573ffaa8c46a09e3b3 "usb: Don't fail port power
resume on device disconnect."

External links:
https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/drivers/usb/core/hub.c?h=usb-next&id=aa5ceae24bf8dff1d6fe87c6c4b08e69c6d33550
https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/drivers/usb/core/hub.c?h=usb-next&id=98a4f1ff7bea8002ab79d6776e30d27932e88244
https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/drivers/usb/core/hub.c?h=usb-next&id=d49dad3e11638f66be4e16573ffaa8c46a09e3b3

Revision history for this message
XiongZhang (xiong-y-zhang) wrote :

All the above patches enable usb 2.0 port power off mechanism. Usb 3.0 port power off is not upstream. So I change this feature's title to usb 2.0 port power off mechanism. For Usb 3.0 port power off, I will fill a new entry.

summary: - [Feature] USB3 Port power off mechanism
+ [Feature] USB2.0 Port power off mechanism
Revision history for this message
XiongZhang (xiong-y-zhang) wrote :

Hi Tim Gardner:
In commit#15, there are three bug fix patches needed to back port to 13.04 and 13.10 kernel. Now these three patches are merged into kernel 3.12, please back port them to 13.04 and 13.10.

1.
 commit aa5ceae24bf8dff1d6fe87c6c4b08e69c6d33550
Author: Alan Stern <email address hidden>
Date: Tue Jul 30 15:39:02 2013 -0400

    USB: handle LPM errors during device suspend correctly

2.
commit 98a4f1ff7bea8002ab79d6776e30d27932e88244
Author: Lan Tianyu <email address hidden>
Date: Wed Jul 3 22:17:54 2013 +0800

    usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend()

3.
commit d49dad3e11638f66be4e16573ffaa8c46a09e3b3
Author: Sarah Sharp <email address hidden>
Date: Mon Aug 5 18:58:15 2013 -0700

    usb: Don't fail port power resume on device disconnect.

Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Saucy):
status: Fix Released → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.11.0-7.14

---------------
linux (3.11.0-7.14) saucy; urgency=low

  [ Andy Whitcroft ]

  * [Packaging] sort out linux-tools naming
    - LP: #1205284
  * [Packaging] linux-tools: switch to common generic version helper

  [ Paolo Pisati ]

  * [Config] highbank: ecx1000: CPU_IDLE causes instabilities, disable it

  [ Tim Gardner ]

  * Release tracker
    - LP: #1226160

  [ Tony Lindgren ]

  * SAUCE: ARM: dts: Fix muxing and regulator for wl12xx on the SDIO bus
    for pandaboard

  [ Upstream Kernel Changes ]

  * USB: handle LPM errors during device suspend correctly
    - LP: #1011415
  * usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend()
    - LP: #1011415
  * usb: Don't fail port power resume on device disconnect.
    - LP: #1011415

  [ Upstream Kernel Changes ]

  * rebase to v3.11.1
 -- Tim Gardner <email address hidden> Wed, 11 Sep 2013 07:30:17 -0600

Changed in linux (Ubuntu Saucy):
status: Fix Committed → Fix Released
Changed in intel:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.