Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In native USB3 mode, uhubctl should automatically change power state for both USB2 and USB3 virtual ports #72

Closed
mvp opened this issue Feb 18, 2018 · 0 comments
Assignees

Comments

@mvp
Copy link
Owner

mvp commented Feb 18, 2018

When compatible USB 3.0 hub connected to USB3 upstream port, it will be detected as 2 independent virtual hubs: USB2 and USB3, and USB devices will be connected to USB2 or USB3 virtual hub depending on their capabilities and connection speed (some more context in issue #68).

To control power for such hubs, one must turn off/on power on both USB2 and USB3
virtual hubs for power off/on changes to take effect.

We should change uhubctl to perform this dual power switch automatically.
Ideally, it should perform this dual power switch by default for affected ports, but add an option to disable dual switching for some odd usage cases.

@mvp mvp self-assigned this Feb 18, 2018
mvp added a commit that referenced this issue Mar 11, 2018
When compatible USB3 hub connected to USB3 upstream port,
it is detected as 2 independent virtual hubs: USB2 and USB3,
and USB devices will be connected to USB2 or USB3 virtual hub
depending on their capabilities and connection speed.

To control power for physical USB3 hubs, we must turn off/on power
on both USB2 and USB3 virtual hubs for power off/on changes to take effect.

Included fixes:

* Enumerate all USB hubs, but mark ones we will work on with actionable flag.
  Because of this, increased max size of hubs array to 128 (maybe need even more?).
* Moved all code that was getting hub info into get_hub_info().
* Display "power" status as first status flag if port is powered.
  (uhubctl is about USB port power, and we should display power as first flag).
* Display "off" status for USB3 port when it is off (was "5gbps SS.Disabled").
  This makes both USB2 and USB3 status to display "off" consistently.
* Added expert option --exact which disables USB3 duality handling.
* Added small wait (150ms) after turning off USB3 port.
  It seems that USB3 reacts slowly to power off command.
  Perhaps we need to implement more deterministic approach for this,
  e.g. keep querying new power state few times until it has finally changed.
  Oddly enough, power on is always instant and does not need waiting.

This fixes issue #72.
@mvp mvp closed this as completed Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant