USB Port Remains Active for Disabled or Safely Removed USB Device

Article translations Article translations
Article ID: 2401954 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

If you have a USB device connected to a computer running Windows Vista, Windows Server 2008, Windows 7, or Windows Server 2008 R2, and you then Disable the device in Device Manager, or Safely Remove the device using the system tray icon, you may observe one of the following symptoms:
  • The USB device shows continued indications of activity (such as an LED that remains illuminated).
  • The USB device continues to receive USB packets and continues to consume power corresponding to an active device state.
  • Physically disconnecting the Disabled or Safely Removed USB device may, in some cases, cause an error in an active transfer to a different USB device.
These symptoms are not observed on a computer running Windows XP or Windows Server 2003 under similar conditions.

CAUSE

When a USB device is Disabled in Device Manager or Safely Removed using the system tray icon, a Remove Device request (PnP IRP IRP_MN_REMOVE_DEVICE) is issued to perform a "Soft Removal" of the USB device. The USB device is marked as Removed for Plug and Play purposes, although the device has not been physically disconnected yet.

In Windows XP and Windows Server 2003, when a USB device is marked as Removed, the USB hub port to which it is connected is Disabled. When the port is Disabled, no further USB traffic is sent to the device.

In Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2, when a USB device is marked as Removed, the USB hub port to which it is connected is not Disabled. When the USB hub port remains Enabled after the USB device is marked as Removed, the Symptoms described above may occur.

RESOLUTION

To work around this problem, a registry value can be set to cause Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 to revert to the Windows XP and Windows Server 2003 behavior of disabling the USB hub port to which a Soft Removed USB device is attached. This workaround can be applied on a per-device basis (for all instances of a specific device (Vendor ID, Product ID, and Revision), or globally (for all enumerated USB devices).

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows

Per-Device Setting

To apply the workaround for a specific device, add a REG_DWORD value named DisableOnSoftRemove that has a value of 1 to the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\usbflags\vvvvpppprrrr
(where vvvv is the device's Vendor ID, pppp is the device's Product ID, and rrrr is the device's Revision number).
  1. Click Start, click Run, type regedit in the Open box, and then click OK .
  2. Locate and then click the following subkey in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags
  3. On the Edit menu, point to New, and then click Key.
  4. Type the name of the new key in the following form:
    vvvvpppprrrr
    where vvvv is a 4-digit hexadecimal number that identifies the vendor (idDevice from the USB Device Descriptor),
    pppp is a 4-digit hexadecimal number that identifies the product (idVendor from the USB Device Descriptor), and
    rrrr is a 4-digit binary-coded decimal number that contains the revision number of the device (bcdDevice from the USB Device Descriptor).
  5. On the Edit menu, point to New, and then click DWORD (32-bit) Value.
  6. Type DisableOnSoftRemove for the name of the DWORD Value, and then press ENTER.
  7. Right-click DisableOnSoftRemove, and then click Modify.
  8. In the Value data box, type 1 , and then click OK.
  9. Exit Registry Editor.

Global Setting

To apply the workaround globally for all enumerated USB devices, add a REG_DWORD value named DisableOnSoftRemove that has a value of 1 to the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\HubG
  1. Click Start, click Run, type regedit in the Open box, and then click OK .
  2. Locate and then click the following subkey in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub
  3. On the Edit menu, point to New, and then click Key.
  4. Type HubG for the name of the new key, and then press ENTER.
  5. On the Edit menu, point to New, and then click DWORD (32-bit) Value.
  6. Type DisableOnSoftRemove for the name of the DWORD Value, and then press ENTER.
  7. Right-click DisableOnSoftRemove, and then click Modify.
  8. In the Value data box, type 1 , and then click OK.
  9. Exit Registry Editor.

MORE INFORMATION

Effects of NOT disabling USB port on Soft Remove


The known effects of not disabling USB port on Soft Remove (Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 default behavior) include:
  • USB device continues to receive USB packets and continues to consume power corresponding to an active device state.
  • USB device shows continued indications of activity (such as an LED that remains illuminated).
  • Physically disconnecting the Disabled or Safely Removed USB device may cause an error in an active transfer to a different USB device.

Effects of disabling USB port on Soft Remove

There are no specific known effects of disabling USB port on Soft Removal (with the above workaround applied, and Windows XP/Server 2003 default behavior). However, since this is not the default behavior for Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2, this configuration has not been tested as thoroughly as the default behavior of keeping the USB port enabled upon Soft Removal. Thus, it is possible this workaround may affect the stability of USB device enumeration and power-management operations.

Effects of Soft Removing a USB device

The known effects of Soft Removing a USB device (with or without the above workaround applied) include:
  • If an attached USB device is Soft Removed, but not physically disconnected, the USB hub (including a Root Hub) to which the device is attached will not enter a USB Suspend state (Selective Suspend of the hub itself) on Windows 7 and Windows Server 2008 R2. (Suspending the USB hub is not supported on earlier versions of Windows.)
  • This will also prevent the USB Host Controller from entering a Global Suspend state on Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2.
  • Preventing Hub and Global Suspend may cause an increase in power consumption while the Soft Removed USB device is still connected, compared to the power consumed when Hub or Global Suspend are used.
  • If the Soft Removed USB device is disconnected from the USB hub port, the hub will be able to enter a USB Suspend state and the USB Host Controller will be able to enter a Global Suspend state, assuming the normal conditions for entering these power-saving states are also met on the versions of Windows that support these power-management features.

Methods for Soft Removing a USB device

A USB device may be placed in a Soft Removed state by the following actions:
  • Safely Removing the USB device using the Safely Remove Hardware icon in the notification area.
  • Disabling the USB device in Device Manager.
  • Using the SetupDiRemoveDevice API to programmatically disable the USB device.

For more information about performing the above actions, see:

Managing Devices (Microsoft TechNet)
Enable or Disable a Plug and Play Device (Microsoft TechNet)
SetupDiChangeState Function (Windows Driver Kit)

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2401954 - Last Review: October 7, 2010 - Revision: 1.0
APPLIES TO
  • Windows Vista Ultimate
  • Windows Vista Ultimate 64-bit Edition
  • Windows Vista Enterprise
  • Windows Vista Enterprise 64-bit Edition
  • Windows Vista Business
  • Windows Vista Business 64-bit Edition
  • Windows Vista Home Premium
  • Windows Vista Home Premium 64-bit Edition
  • Windows Vista Home Basic
  • Windows Vista Home Basic 64-bit Edition
  • Windows Server 2008 Standard
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Service Pack 2
  • Windows 7 Ultimate
  • Windows 7 Enterprise
  • Windows 7 Professional
  • Windows 7 Home Premium
  • Windows 7 Home Basic
  • Windows Server 2008 R2 Standard
  • Windows Server 2008 R2 Enterprise
  • Windows Server 2008 R2 Datacenter
Keywords: 
KB2401954

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com