Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

USB Port Remains Active for Disabled or Safely Removed USB Device


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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)

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2401954
Revision : 1
Created on : 1/7/2017
Published on : 10/7/2010
Exists online : False
Views : 400