USB port remains active even after using Safely remove hardware
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 by the system to perform a ‘Soft Removal‘ of the USB device. As a consequence of this action, the USB device is marked as ‘Removed for Plug and Play’ purposes only. The device, however, has not been physically disconnected yet. Please note that the method requires you to make changes to the Registry Editor. Before you edit the registry, export the keys in the registry that you plan to edit or back up the whole registry. If a problem occurs, you can restore the registry to its previous state. To apply the workaround globally for all enumerated USB devices, KB2401954 suggests the following. Press Win+R in combination to open the ‘Run’ dialog box. Type ‘regedit.exe’ and press ‘Enter’.
When the Registry Editor opens, navigate to the following path address – After navigating to the path address given above, create a new key ‘hubg’ under ‘usbhub’.
For this, right-click the ‘usbhub’ folder, choose ‘New’ and select the ‘Key’ option. Name the key as ‘hubg’. Now, click ‘hubg’ and switch to the right pane. There, right-click in the space and choose ‘New’. Next, select ‘DWORD (32-bit) Value’. Name the key as ‘DisableOnSoftRemove’. When done, double click on ‘DisableOnSoftRemove’ and choose ‘Hexadecimal’. Change the Value Data to ‘1’ and hit the ‘OK’ button. Exit the Registry Editor and restart your computer. You have successfully configured your PC to disable USB Port when you have Safely Removed USB hardware in Windows.
Effects of NOT disabling USB port on Soft Remove
When a USB port is not disabled on its soft removal, it may exhibit the following behavior-
Effects of disabling USB port on Soft Remove
The effects of disabling USB port on Soft Removal are not clearly known. It is likely that this workaround may influence the stability of USB device enumeration and power-management operations.
Effects of Soft Removing a USB device
If an attached USB device is removed softly, 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). The method will also prevent the USB Host Controller from entering a Global Suspend state. In comparison to the power consumed when Hub or Global Suspend is in use, preventing the two while the Soft Removed USB device is still connected may result in a rise in power consumption. When the Soft Removed USB device is disconnected from the USB hub port, the hub will be ready to enter a USB Suspend state and the USB Host Controller in a Global Suspend state.
Actions that help in removing a USB device softly:
TIP: See this post if Safely Remove Hardware is not working in Windows.