* USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent
@ 2020-09-15 2:14 Sid Spry
2020-09-15 4:50 ` Greg KH
2020-09-15 14:45 ` Alan Stern
0 siblings, 2 replies; 3+ messages in thread
From: Sid Spry @ 2020-09-15 2:14 UTC (permalink / raw)
To: linux-usb
Hi, after a fair bit of looking I do not see a way to do a hard reset of
a device. Windows seems to expose some functionality that hints these things
are possible. Does anyone know if it is and is implemented in the Linux
drivers?
I only find reference to automatic power management in /sys.
The ioctl in the title (IOCTL_USB_HUB_CYCLE_PORT) is joined by others that seem
to actually control the power to the port.
I recently saw patches that would control hub power state via additional
hardware. It would be good to have a uniform way for userspace to take
advantage of this power control. Userspace may have further hints that can be
applied to power consumption, and may need to decide to undertake device
recovery.
What originally made me investigate this issue was a series of MCU development
boards that crash needing power removed to recover. This seems to be impossible
to do on most hardware. Why? There's no good reason to remove a complete power
down from the spec. There are also instances where a hard reset for PCIe, e.g.
cards malfunctioning when used with VFIO-VGA would have saved hardware from
being hopelessly broken. So if you are involved in hardware design please
consider these things.
Cheers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent
2020-09-15 2:14 USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent Sid Spry
@ 2020-09-15 4:50 ` Greg KH
2020-09-15 14:45 ` Alan Stern
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-09-15 4:50 UTC (permalink / raw)
To: Sid Spry; +Cc: linux-usb
On Mon, Sep 14, 2020 at 09:14:44PM -0500, Sid Spry wrote:
> Hi, after a fair bit of looking I do not see a way to do a hard reset of
> a device. Windows seems to expose some functionality that hints these things
> are possible. Does anyone know if it is and is implemented in the Linux
> drivers?
You can do this from userspace on hardware that supports it by using the
`usbreset` tool that is in the usbutils package.
But as you have found out, this is not a requirement for USB hardware to
support, so not all hubs do support this, sorry.
good luck!
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent
2020-09-15 2:14 USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent Sid Spry
2020-09-15 4:50 ` Greg KH
@ 2020-09-15 14:45 ` Alan Stern
1 sibling, 0 replies; 3+ messages in thread
From: Alan Stern @ 2020-09-15 14:45 UTC (permalink / raw)
To: Sid Spry; +Cc: linux-usb
On Mon, Sep 14, 2020 at 09:14:44PM -0500, Sid Spry wrote:
> Hi, after a fair bit of looking I do not see a way to do a hard reset of
> a device. Windows seems to expose some functionality that hints these things
> are possible. Does anyone know if it is and is implemented in the Linux
> drivers?
As Greg mentioned, on many systems it is not possible. On systems where
it is possible, it can be performed by running a utility program.
> I only find reference to automatic power management in /sys.
>
> The ioctl in the title (IOCTL_USB_HUB_CYCLE_PORT) is joined by others that seem
> to actually control the power to the port.
I don't understand this sentence. What do you mean when you say that
IOCTL_USB_HUB_CYCLE_PORT is joined by others?
And I don't see how there can be any ioctls that control power to a USB
port when the hardware itself doesn't permit power to be turned off.
> I recently saw patches that would control hub power state via additional
> hardware.
URLs for these patches?
> It would be good to have a uniform way for userspace to take
> advantage of this power control. Userspace may have further hints that can be
> applied to power consumption, and may need to decide to undertake device
> recovery.
>
> What originally made me investigate this issue was a series of MCU development
> boards that crash needing power removed to recover. This seems to be impossible
> to do on most hardware. Why?
Indeed, it is impossible on a lot of hardware. But how come you are
asking us why? You should be asking the hardware designers.
> There's no good reason to remove a complete power
> down from the spec. There are also instances where a hard reset for PCIe, e.g.
> cards malfunctioning when used with VFIO-VGA would have saved hardware from
> being hopelessly broken. So if you are involved in hardware design please
> consider these things.
We are involved in software design, not hardware design.
Alan Stern
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-15 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-15 2:14 USB Hardware Power Control, IOCTL_USB_HUB_CYCLE_PORT Equivalent Sid Spry
2020-09-15 4:50 ` Greg KH
2020-09-15 14:45 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).