Incidentally, we specifically turn on power to a USB port when you remove the device, if the port supports D3cold and the device is turned off prior to removal, so that the port can be properly enumerated. This is also true for PCIe and SATA devices which support D3cold.
Of course, the result is the counterintuitive behavior wherein tablets running Windows use more power when you go into Device Manager and disable some devices. They can only be in D3cold when the driver is running and managing the device.
- Jake Oshins
(occasional power management guy)
Windows Kernel Team
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, January 9, 2014 10:43 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB Reset for DFU with WINUSB
xxxxx@avantes.com wrote:
Tim Roberts, xxxxx@probo.com wrote:
> You must be remembering something else, because this is not correct.
> “devcon restart” simply unloads and reloads the driver.
> Nothing else. No power action is taken.
I can clearly see the power led of our device going off and on again. If you measure the current in the 5V line of the USB cable, you can clearly see it dipping. The command does not work when using external power. What else to conclude from this?
It’s coming from some place other then “devcon restart”. I do that
dozens of times a week. I KNOW it doesn’t cycle the power. I just did
it again right now, just to prove I wasn’t crazy.
Now, it’s quite possible that your DRIVER is killing the device’s power
during your unload, but there’s nothing in the kernel that will do so.
“devcon restart” does the same operation as going into Device Manager,
disabling the device, then enabling the device. Do you see the power go
away when you do that? I can’t imagine you do, because it would be
impossible to re-enable it – the device would go away once the USB
power is removed.
Do you hear the “bing bong” and “bong bing” tones that indicate a USB
device being re-enumerated?
I’m not a hardware guy, but I know that USB power can be controlled from the PC.
Oh, no question. The hub controls that. In fact, there is a ioctl you
can send to the hub driver to request cycling of power on a given port.
However, that ioctl is not sent when a USB client driver unloads. It
would be horribly inconvenient if a device lost its firmware and state
every time a driver had to reload.
What I meant is that you cannot deduce from the devcon source code whether USB power is being cut or not after the ‘restart’ command. But I am glad that you like this code. I especially love the ‘goto’ statements in it. And I thought that I was old school.
Well, devcon was written 20 years ago.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer